The index is having 20 fields. I am having one search value received as query parameter in api.
There are 3 fields in index name, city, state
In my spring boot application, I need to return response if the search value say new matches with any of the 3 fields.
Like return the response : city=="new" || state=="new" || name=="new"
What BoolQuery I should write for that ? Or any other way for it. I am using RestHighLevelClient of elastic search 7.7
I suggest using should query. Must is like more AND logic and should is like an OR.
minimum_should_match is also worth reading.
Elastic search boolean query