Skip to content

Conversation

@javanna
Copy link
Member

@javanna javanna commented Mar 10, 2025

Backports the following commits to 9.0:

Inter-segment concurrency is disabled whenever sort by field, included script sorting, is used in a search request.

The reason why sort by field does not use concurrency is that there are some performance implications, given that the hit queue in Lucene is build per slice and the different search threads don't share information about the documents they have already visited etc.

The reason why script sort has concurrency disabled is that the script sorting implementation is not thread safe. This commit addresses such concurrency issue and re-enables search concurrency for search requests that use script sorting. In addition, missing tests are added to cover for sort scripts that rely on _score being available and top_hits aggregation with a scripted sort clause.
@javanna javanna requested a review from a team as a code owner March 10, 2025 20:12
@javanna javanna added :Search Foundations/Search Catch all for Search Foundations >bug auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch labels Mar 10, 2025
@elasticsearchmachine elasticsearchmachine merged commit 3d11035 into elastic:9.0 Mar 10, 2025
16 checks passed
@javanna javanna deleted the backport/9.0/pr-123757 branch March 10, 2025 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport >bug :Search Foundations/Search Catch all for Search Foundations Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch v9.0.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants