How does the should part of a Bool filter influence the results
returned?
Could one say that where must creates an AND combination of filters,
should creates an OR?
I have used the Bool filter in something that I now realize, makes little
sense. However, also don't understand its behavior:
Given I have documents in my index which can have either value of /en/, /de/
or /fr/ for the field locale, the following filter returns results with
the locale being either /en/ or /fr/:
Here's the result (example data):
The same result is being returned if I set locale to be /fr/.
If I use /de/ for the locale field in should, I get
/Question is:/ Why does the filter with should -> locale -> en/fr even show
results where the should condition isn't met?
Basically, should helps to increase scoring. So if two documents match the same must clause and one of them only match the should clause, this last document will be more relevant and will get an higher score.
If you have a must query and some should clauses, should clauses does not have to match unless you set minimum_number_should_match > 0.
If you don't have any must or must_not clause, then at least one of the should clauses must be satisfied.
I don't fully follow you here. Could you illustrate and gist a full curl recreation?
How does the should part of a Bool filter influence the results
returned?
Could one say that where must creates an AND combination of filters,
should creates an OR?
I have used the Bool filter in something that I now realize, makes little
sense. However, also don't understand its behavior:
Given I have documents in my index which can have either value of /en/, /de/
or /fr/ for the field locale, the following filter returns results with
the locale being either /en/ or /fr/:
Here's the result (example data):
The same result is being returned if I set locale to be /fr/.
If I use /de/ for the locale field in should, I get
/Question is:/ Why does the filter with should -> locale -> en/fr even show
results where the should condition isn't met?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.