Просмотр исходного кода

Merge branch 'laravel' of https://github.com/visuddhinanda/mint into laravel

visuddhinanda 2 лет назад
Родитель
Сommit
068f80cd41
1 измененных файлов с 13 добавлено и 3 удалено
  1. 13 3
      app/Console/Commands/TestSearchPali.php

+ 13 - 3
app/Console/Commands/TestSearchPali.php

@@ -42,14 +42,24 @@ class TestSearchPali extends Command
         if(empty($word)){
             $word = 'citta';
         }
-        $result = PaliSearch::search([$word],[],'case',0,3);
+        $words = str_replace('_',' ',$word);
+        $words = explode(',',$word);
+        $this->info("searching word={$word} limit=10,offset=0");
+        $result = PaliSearch::search($words,[],'case',0,10);
         if($result){
             $this->info("word={$word} total=".$result['total']);
         }else{
             $this->error("word={$word} search fail");
         }
-
-        $result = PaliSearch::search([$word],[267],'case',0,3);
+        $this->info("searching word={$word} limit=10,offset=10");
+        $result = PaliSearch::search($words,[],'case',10,10);
+        if($result){
+            $this->info("word={$word} total=".$result['total']);
+        }else{
+            $this->error("word={$word} search fail");
+        }
+        $this->info("searching word={$word} book=267");
+        $result = PaliSearch::search($words,[267],'case',0,3);
         if($result){
             $this->info("word={$word} book=267 total=".$result['total']);
         }else{