[英]Elasticsearch not returning partial results
我正在使用Laravel 5.1
和mustafaaloko/elasticquent5
軟件包( 在此處找到 )。
但是,當嘗試返回結果時,只有在搜索准確的單詞時才能獲得結果。 如果我嘗試搜索單詞的一部分,則不會返回任何內容。
我正在使用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',
);
你應該嘗試使用searchByQuery
,而不是search
,並使用query_string
查詢
Profile::searchByQuery(array('query_string' => array('query' => Input::get('search_term'))));
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.