Guaranteed higher scores from one should query over another

I have a Elasticsearch query with three should queries of declining importance. How can I assert that documents returned from each should query has higher score than those of less importance?

Maybe this could be solved by using some scoring boundary, so that should query #1 documents are forced into the score interval 30-20, query #2 into 20-10 and query #3 into 10-0.

I know I can work with simple boosting, but I think this does not guarantee that results wouldn't "intrude" on other querys' results.

Boosting is generally the way to go. The only other way I can think of is to break the query down into 3 separate queries and send these in parallel using the multi search API, which allows you to control how results are ordered/combined within your application.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.