سؤال

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