-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
search: enable AND operator and cross_field #916
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original example mentioned in the inline comment wasn't the complete case. I updated with the correct explanation according to my testing and observations.
Essentially, we can not use cross_fields with AND operator as the operator forces both the terms to be in the same field which means it ignores the cross_fields type.
If we remove the AND operator, it works but will increase the number of results that would loosely match due to the default OR.
The best way I was able to find was to inject "AND" keyword between each word, this seems to solve the problem completely but it is not an elegant solution.
Here some tests in devtools of opensearch (from @ntarocco ):
|
Working query
FindingsCross field queries: https://www.elastic.co/guide/en/elasticsearch/guide/current/_cross_fields_queries.html
It seems that fields |
52ca273
to
56df0af
Compare
887f039
to
7f1e695
Compare
- enable searching in multiple fields with AND operator
7f1e695
to
0df6a5a
Compare
Original issue: