Question

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

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top