Skip to content

Commit

Permalink
Added code comments
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Gaievski <gaievski@amazon.com>
  • Loading branch information
martin-gaievski committed Sep 4, 2024
1 parent fcbbdc2 commit 6bfb546
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Features
### Enhancements
### Bug Fixes
- Fixed merge logic in hybrid query for multiple shards case ([#876](https://github.com/opensearch-project/neural-search/pull/876))
- Fixed merge logic in hybrid query for multiple shards case ([#877](https://github.com/opensearch-project/neural-search/pull/877))
### Infrastructure
- Update batch related tests to use batch_size in processor & refactor BWC version check ([#852](https://github.com/opensearch-project/neural-search/pull/852))
### Documentation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ class TopDocsMerger {
* @return merged TopDocsAndMaxScore object
*/
public TopDocsAndMaxScore merge(final TopDocsAndMaxScore source, final TopDocsAndMaxScore newTopDocs) {
// we need to check if any of source and destination top docs are empty. This is needed for case when concurrent segment search
// is enabled. In such case search is done by multiple workers, and results are saved in multiple doc collectors. Any on those
// results can be empty, in such case we can skip actual merge logic and just return result object.
if (isEmpty(newTopDocs)) {
return source;
}
Expand Down

0 comments on commit 6bfb546

Please sign in to comment.