2016-05-10 35 views
0

Laravel 5.1mustafaaloko/elasticquent5パッケージ(found here)を使用しています。部分検索結果が返されない部分の検索結果

しかし、結果を返そうとすると、正確な単語を検索すると結果が得られません。単語の一部を検索しようとすると、何も返されません。私はProfile::addAllToIndex();dd(Profile::search(Input::get('search_term')));

マイ設定を使用しています

は次のようになります。

<?php 

return array(

    /* 
    |-------------------------------------------------------------------------- 
    | Custom Elasticsearch Client Configuration 
    |-------------------------------------------------------------------------- 
    | 
    | This array will be passed to the Elasticsearch client. 
    | See configuration options here: 
    | 
    | http://www.elasticsearch.org/guide/en/elasticsearch/client/php-api/current/_configuration.html 
    */ 

    'config' => [ 
     'hosts'  => ['ahp.dev:9200'], 
     'logging' => true, 
     'logPath' => storage_path() . '/logs/elasticsearch.log', 
     'logLevel' => Monolog\Logger::WARNING, 
    ], 

    /* 
    |-------------------------------------------------------------------------- 
    | Default Index Name 
    |-------------------------------------------------------------------------- 
    | 
    | This is the index name that Elastiquent will use for all 
    | Elastiquent models. 
    */ 

    'default_index' => 'default', 

); 

答えて

1

かわりsearchsearchByQueryを使用しようとquery_stringクエリ

Profile::searchByQuery(array('query_string' => array('query' => Input::get('search_term')))); 
+0

を使用する必要があります私がしなければなりませんでした'Input :: get( 'search_term')'の前後に ''*''を追加して適応を作ってください。ありがとうございました! – Haring10

+0

ああ、忘れてしまった。それはうまくいった! – Val

+0

は、待機期間が終了すると正解として受け入れます – Haring10

関連する問題