This PR is to enable sorting in Hybrid Search.
The following key areas which are covered by this PR
Enable sorting on single field and multi-field.
Enable search_after pagination support with sorting. The reason why search_after is included in this PR because without this the whole sorting feature is half baked. This feature exclusively works with sorting.
The same methods which we have created for sorting are used by search_after. Therefore, the code can be more optimized when this feature is added with this PR.
Block track_scores when sorting is applied
Block the scenario when user tries to sort by field and _score both.
MultiLeafFieldComparator.java which is directly copy of from Lucene. The reason why we copied this class in neural search because this class is final in Lucene.
[ ] Commits are signed as per the DCO using --signoff
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.
Why are we blocking track_scores when sorting is applied. According to track_scores, users can still set track_scores to be true when sorting is applied.
Description
This PR is to enable sorting in Hybrid Search. The following key areas which are covered by this PR
search_after
pagination support with sorting. The reason whysearch_after
is included in this PR because without this the whole sorting feature is half baked. This feature exclusively works with sorting.track_scores
when sorting is appliedfield
and_score
both.Order to review the PR
HybridCollectorManager.createHybridCollectorManager
methodHybridCollectorManager.newCollector
methodHybridTopFieldDocSortCollector.java
MultiLeafFieldComparator.java
which is directly copy of from Lucene. The reason why we copied this class in neural search because this class is final in Lucene.HybridCollectorManager.reduce
methodNormarlizationProcessorWorkFlow
CompoundTopDocs
ScoreCombiner
HybridQueryResultUtil
Issues Resolved
507
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.