";
foreach($arrWordList as $oneword){
echo $oneword."+";
}
echo "
";
}
$query = "select title from 'index' where \"title_en\" like ".$PDO->quote("%".$searching.'%')." OR \"title\" like ".$PDO->quote("%".$searching.'%')." group by title limit 0,20";
$Fetch = PDO_FetchAll($query);
$queryTime=(microtime_float()-$time_start)*1000;
$iFetch=count($Fetch);
if($iFetch>0){
for($i=0;$i<$iFetch;$i++){
$word=$Fetch[$i]["title"];
echo "$word";
}
}
break;
}
case "search":
{
$time_start = microtime_float();
echo "
";
//前20条记录
$time_start=microtime_float();
PDO_Connect("sqlite:"._FILE_DB_RESRES_INDEX_);
if(isset($_GET["booklist"])){
$query = "select * from 'index' where (\"title_en\" like ".$PDO->quote("%".$_GET["word"].'%')." OR \"title\" like ".$PDO->quote("%".$_GET["word"].'%').") and book in {$_GET["booklist"]} limit 0,50";
}
else{
$query = "select * from 'index' where \"title_en\" like ".$PDO->quote("%".$_GET["word"].'%')." OR \"title\" like ".$PDO->quote("%".$_GET["word"].'%')." limit 0,50";
}
$Fetch = PDO_FetchAll($query);
$queryTime=(microtime_float()-$time_start)*1000;
$iFetch=count($Fetch);
if($iFetch>0){
PDO_Connect("sqlite:"._FILE_DB_PALITEXT_);
for($i=0;$i<$iFetch;$i++){
$title=$Fetch[$i]["title"];
$book=$Fetch[$i]["book"];
$paragraph=$Fetch[$i]["paragraph"];
echo "
";
//查黑体字结束
echo "";
break;
}
case "update":
$target=$_GET["target"];
switch($target){
case "bold";
$wordlist=$_GET["wordlist"];
$booklist=$_GET["booklist"];
$aBookList=ltrim($booklist,"(");
$aBookList=rtrim($aBookList,")");
$aBookList=str_replace("'","",$aBookList);
$aBookList=str_getcsv($aBookList);
$arrBookType=json_decode(file_get_contents("../public/book_name/booktype.json"));
//查找这些词出现在哪些书中
$newBookList=render_book_list($wordlist,$aBookList);
//前20条记录
$time_start=microtime_float();
$dictFileName=_FILE_DB_PALI_INDEX_;
PDO_Connect("sqlite:$dictFileName");
$query = "select * from word where \"wordindex\" in $wordlist and \"book\" in $booklist group by book,paragraph limit 0,20";
$Fetch = PDO_FetchAll($query);
//echo "