2
0
Эх сурвалжийг харах

Merge pull request #1817 from visuddhinanda/laravel

search 所有环境都用tulip
visuddhinanda 2 жил өмнө
parent
commit
485b2d89b8

+ 7 - 1
app/Console/Commands/TestSearchPali.php

@@ -9,7 +9,7 @@ class TestSearchPali extends Command
 {
     /**
      * The name and signature of the console command.
-     *
+     * php artisan test:search.pali
      * @var string
      */
     protected $signature = 'test:search.pali {word?}';
@@ -51,6 +51,12 @@ class TestSearchPali extends Command
         }else{
             $this->error("word={$word} search fail");
         }
+
+        $rpc_result = PaliSearch::book_list($words,
+                                            [],
+                                            'case');
+        $this->info('book list count='.count($rpc_result['rows']));
+
         $this->info("searching word={$word} limit=10,offset=10");
         $result = PaliSearch::search($words,[],'case',10,10);
         if($result){

+ 6 - 5
app/Http/Controllers/SearchController.php

@@ -268,15 +268,16 @@ class SearchController extends Controller
                     $result = DB::select($query, [$key]);
 
                 }else{
-                    if (App::environment(['local', 'staging'])) {
-                        $rpc_result = PaliSearch::book_list(explode(';',$key) ,$bookId,
+
+                    $rpc_result = PaliSearch::book_list(explode(';',$key),
+                                                        $bookId,
                                                         $request->get('match','case'));
-                        $result = collect($rpc_result['rows']);
-                    }else{
+                    $result = collect($rpc_result['rows']);
+                    /*
                         $queryWhere = $this->getQueryWhere($key,$request->get('match','case'));
                         $query = "SELECT pcd_book_id, count(*) as co FROM fts_texts WHERE {$queryWhere['query']} {$queryBookId} GROUP BY pcd_book_id ORDER BY co DESC;";
                         $result = DB::select($query, $queryWhere['param']);
-                    }
+                    */
                 }
                 break;
             case 'page':