Boost documents having a particular field with any value except a certain value


(Maryam Abdullah) #1

Hey,

Is there any way I can boost documents with a particular field having any value except a certain value (might be multiple)?

Thank you.


(Jaspreet Singh) #2

There sure is. Check this - https://www.elastic.co/guide/en/elasticsearch/guide/current/_boosting_query_clauses.html
For exclusion cases, just use must_not. If you can share specific example requirement, I can try being more specific about framing the query.