質問

Hello I have a problem with elasticsearch php api, elastica.

if I run this:

$elasticaQueryMatch= new Elastica\Query\Match();
$elasticaQueryMatch->setField('fax', "16147591649");
$elasticaResultSet = $elasticaIndex->search($elasticaQueryMatch); 
var_dump($elasticaResultSet);

I get 7 results and the telephone number for all of the results is "16147591649"

Then if I run this:

$elasticaQueryMatch= new Elastica\Query\Match();
$elasticaQueryMatch->setField('telephone', "16147591649");
$elasticaResultSet = $elasticaIndex->search($elasticaQueryMatch); 
var_dump($elasticaResultSet);

I get 0 results

役に立ちましたか?

解決

Fixed it by creating a new index, changed my mapping and then rebuilt my index. It was the mapping and the analyzers for certain fields that were causing issues.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top