Closed davimug closed 7 months ago
Hey @davimug , seems to be getting hits on the text tokens.
Try:
Person::whereIn('jobs.keyword', ['AI', 'Loops'])->get();
Hi @pdphilip , thanks for the response! I tried that and it doesn't seem to match with any documents at all, even the correct ones.
Strange, first try update to the latest version v2.10.7
and see if it helps
Then, can you show me your mappings?
Schema::getMappings('people');
I'm in the process of rebuilding the bridge that will use DSL queries directly, the whereIn()
method will leverage Elasticsearch's terms query that will look for an exact match. This will be a major release v3.x
- weeks away.
In the meantime, an equivalent query would be:
Person::where('jobs', 'AI')->orWhere('jobs', 'Loops')->get();
Let me know where you land
Hi @davimug - this bug has been fixed in the new v3 version.
Can see in docs
To update for Laravel 10 composer require pdphilip/elasticsearch:~3.10
Hi sorry for the late reply @pdphilip, amazing work! Will take a look
Package version
ex: v2.10.3 (NB!)
Describe the bug
A clear and concise description of what the bug is.
Say we have the following document:
and we do a query
Person::whereIn('jobs', ['AI', 'Loops'])->get();
We would expect no results, however, the query IS matching with the example provided.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots: If applicable, add screenshots to help explain your problem.
Component Versions (Paste in the
require
section from your composer.json file):Additional context: Add any other context about the problem here.