-
Notifications
You must be signed in to change notification settings - Fork 24.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
min_score
not working in function_score
query
#10253
Comments
This is a bug indeed and it seems to me for two reasons:
if you really want to score all matches with 1 (which does not make much sense imo but should still work) or
in case one actually wants the score of the query to be used. |
To be clear,
|
Currently the way it works is this: If function_score encounters a query without a function, then the query is just executed as is without wrapping in a function score query (https://github.com/elastic/elasticsearch/blob/master/src/main/java/org/elasticsearch/index/query/functionscore/FunctionScoreQueryParser.java#L161) so min_score has no effect in this case. This was implemented so on purpose but it seems to me that now with the min_score there is a usecase where you would want to use function_score without a function. I'll change that. |
…ovided For optimization pruposes a function score query with an empty function will just result in the original sub query. However, sometimes one might want to use function_score query to actually filter out docs within for example bool clauses by using the min_score functionallity. Therefore the sub query should only be used without wrapping inside a function_score query if min_score was also not set. closes elastic#10253
…ovided For optimization pruposes a function score query with an empty function will just result in the original sub query. However, sometimes one might want to use function_score query to actually filter out docs within for example bool clauses by using the min_score functionallity. Therefore the sub query should only be used without wrapping inside a function_score query if min_score was also not set. closes #10253 closes #10326
…ovided For optimization pruposes a function score query with an empty function will just result in the original sub query. However, sometimes one might want to use function_score query to actually filter out docs within for example bool clauses by using the min_score functionallity. Therefore the sub query should only be used without wrapping inside a function_score query if min_score was also not set. closes #10253 closes #10326
…ovided For optimization pruposes a function score query with an empty function will just result in the original sub query. However, sometimes one might want to use function_score query to actually filter out docs within for example bool clauses by using the min_score functionallity. Therefore the sub query should only be used without wrapping inside a function_score query if min_score was also not set. closes elastic#10253 closes elastic#10326
The new
min_score
functionality in thefunction_score
query doesn't seem to to work as advertised. For instance:This query returns a score of 4 for the above document, which means that it should be filtered out by the
min_score
of10
:The text was updated successfully, but these errors were encountered: