Skip to content

[Feature Request] Improve field collapsing performance when sorting by score #19180

@gaobinlong

Description

@gaobinlong

Is your feature request related to a problem? Please describe

When fixing a bug for field collapsing, I found that there're some points that can improve the performance for field collapsing when sorting by score descending:

  1. Omit the MaxScoreCollector when sorting by score, we can get the max score from the first document directly, no need to add extra effort to compute the max score.
  2. Based on the above optimization, when sorting by score descending, CollapsingTopDocsCollector is not wrapped with MaxScoreCollector into a MultiCollector, so we can propagate the min competitive score to the scorer when the target collapsed groups is full.

Describe the solution you'd like

Improve the field collapsing performance based on the above ideas.

Related component

Search:Performance

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions