Skip to content

Commit 9955c4b

Browse files
committed
Use ScoreDoc instead of FieldDoc when creating TopScoreDocCollectorManager to avoid unnecessary conversion (opensearch-project#18802)
* Use ScoreDoc instead of FieldDoc when creating TopScoreDocCollectorManager to avoid unnecessary conversion Signed-off-by: Binlong Gao <gbinlong@amazon.com> * Modify change log Signed-off-by: Binlong Gao <gbinlong@amazon.com> --------- Signed-off-by: Binlong Gao <gbinlong@amazon.com>
1 parent 17f4d4a commit 9955c4b

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
2323
- Null check field names in QueryStringQueryBuilder ([#18194](https://github.com/opensearch-project/OpenSearch/pull/18194))
2424
- Fix illegal argument exception when creating a PIT ([#16781](https://github.com/opensearch-project/OpenSearch/pull/16781))
2525
- Fix the bug of Access denied error when rolling log files ([#18597](https://github.com/opensearch-project/OpenSearch/pull/18597))
26+
- Use ScoreDoc instead of FieldDoc when creating TopScoreDocCollectorManager to avoid unnecessary conversion ([#18802](https://github.com/opensearch-project/OpenSearch/pull/18802))
2627

2728
### Security
2829

server/src/main/java/org/opensearch/search/query/TopDocsCollectorContext.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,11 +360,10 @@ private static TopDocsCollector<?> createCollector(
360360
int hitCountThreshold
361361
) {
362362
if (sortAndFormats == null) {
363-
// See please https://github.com/apache/lucene/pull/450, should be fixed in 9.x
364363
if (searchAfter != null) {
365364
return TopScoreDocCollector.createSharedManager(
366365
numHits,
367-
new FieldDoc(searchAfter.doc, searchAfter.score),
366+
searchAfter,
368367
hitCountThreshold
369368
);
370369
} else {

0 commit comments

Comments
 (0)