must is and
should is or, increase score if match
must means: The clause (query) must appear in matching documents. These clauses must match, like logical AND.
should means: At least one of these clauses must match, like logical OR.
Basically they are used like logical operators AND and OR. See this.
Now in a bool query:
must means: Clauses that must match for the document to be included.
should means: If these clauses match, they increase the
_score
; otherwise, they have no effect. They are simply used to refine the relevance score for each document.
No comments:
Post a Comment