问题
Elasticsearch documentation says "If the bool query is a filter context or has neither must or filter then at least one of the should queries must match a document for it to match the bool query."
So I can have a bool query with a should clause along with must or filter within a filter context and then still get exact match. How to do this combination?
I would also be interested in knowing how to do this with Jest client?
回答1:
In that case you need to add minimum_should_match: 1
if you want that at least one of your should clauses match.
来源:https://stackoverflow.com/questions/50998320/filter-context-for-should-in-bool-query-elasticsearch