Open rudibatt opened 3 years ago
Pinging @elastic/es-search (Team:Search)
Thanks for reporting the issue.
I can reproduce it. The problem is that the requesting documents (i.e., from
+ size
) exceed the window size. Here rescoring reduces the scores of two docs (containing quick
) in the top4. And these docs are moved to the bottom after rescored. That explains why these two docs are always returned when from
>= 2.
I think we should reject such a request. I opened https://github.com/elastic/elasticsearch/pull/75556.
I suggest to only resort the documents within the window size. Then the scores would not be continuous, but the result order would be, even for pages beyond window_size.
Pinging @elastic/es-docs (Team:Docs)
I agree with @rudibatt
Pinging @elastic/es-search-relevance (Team:Search Relevance)
Elasticsearch version: 7.13.2 Plugins installed: [elasticsearch-learning-to-rank] JVM version: AdoptOpenJDK (build 16+36) OS version: Linux 82865c3b5df8 5.8.0-59-generic #66~20.04.1-Ubuntu SMP Thu Jun 17 11:14:10 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux (actually that's the official docker image "elasticsearch:7.13.2")
Description: When a rescorer tanks the scores of the documents within the window_size, requests that fetch the results beyond the window_size will always get the same documents.
Cause: The QueryRescorer only reorders the top hits (from 0 to "from+size") see org.elasticsearch.search.rescore.QueryRescorer.combine(TopDocs, TopDocs, QueryRescoreContext) However if the rescorer causes worse scores for the first N, they only get reordered within that top-hits frame.
Steps to reproduce:
For
from >= 2
the two results are always the same!Expected Result Either the whole result is reordered or the reordering only takes place within the window_size. (Must be defined)
Related issue: https://github.com/o19s/elasticsearch-learning-to-rank/issues/369