Closed DamienP33 closed 7 years ago
As you can see here, the =
operator maps to the term
elasticsearch query type. Depending on your data and ES mapping, this might not be the operator you want to use.
With LIKE operator is OK
I tried several cases and I get strange results :
$r = $rulerZ->filter($repository, 'list.number = :number', ['number' => 100]); // OK
$r = $rulerZ->filter($repository, 'list.number >= 12'); // OK
$r = $rulerZ->filter($repository, 'list.id = "7a9f44092f7c37ab9fef87344e866eb7"'); // OK
$r = $rulerZ->filter($repository, 'list.text = "foo"'); // KO
$r = $rulerZ->filter($repository, "list.text like foo"); // OK
$r = $rulerZ->filter($repository, "list.text like :text", ['text' => 'foo']); // KO
$r = $rulerZ->filter($repository, "firstName = :name", ['name' => "Damien"]); // KO
$r = $rulerZ->filter($repository, "firstName like :name", ['name' => "Damien"]); // KO
$r = $rulerZ->filter($repository, "firstName like Damien"); // OK
$r = $rulerZ->filter($repository, "firstName = 'Damien'"); // KO
$r = $rulerZ->filter($repository, "id = '1ab73ebef97b37e8bcf49307dcf49a88'" ); // OK
$r = $rulerZ->filter($repository, "id like 1ab73ebef97b37e8bcf49307dcf49a88" ); // KO
I begin on Elastic, but is this normal ?
If I take the following example:
$r = $rulerZ->filter($repository, "firstName like Damien"); // OK
$r = $rulerZ->filter($repository, "firstName = 'Damien'"); // KO
The behavior does not seem strange to me. Depending on how you configured your mapping, Elasticsearch might not be storing the original value ("Damien") but only the analyzed one (probably "damien"). That's why the strict comparison fails but not the other.
Closing this issue as it's been inactive for months. Feel free to reopen it if needed :)
Hello, Impossible to find text in the table, but with Elastica is OK.
With Elastica :
With RulerZ :
With RulerZ, I got no result.
But, with a number is OK:
Did I miss something ?