Skip to content

Comments

Optimize script sorts that do not require query scores#139748

Merged
jimczi merged 5 commits intoelastic:mainfrom
jimczi:script_sort_optional_scorer
Dec 19, 2025
Merged

Optimize script sorts that do not require query scores#139748
jimczi merged 5 commits intoelastic:mainfrom
jimczi:script_sort_optional_scorer

Conversation

@jimczi
Copy link
Contributor

@jimczi jimczi commented Dec 18, 2025

Only set the sort script’s scorable when the script actually needs access to the query score. Since the scorable holds a reference to the query iterator, avoiding it allows memory to be released earlier—at segment completion rather than at the end of the shard search.

Only set the sort script’s scorable when the script actually needs access to the query score.
Since the scorable holds a reference to the query iterator, avoiding it allows memory to be released earlier—at segment completion rather than at the end of the shard search.
@jimczi jimczi requested a review from romseygeek December 18, 2025 13:35
@elasticsearchmachine elasticsearchmachine added the Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch label Dec 18, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-search-foundations (Team:Search Foundations)

@elasticsearchmachine
Copy link
Collaborator

Hi @jimczi, I've created a changelog YAML for you.

Copy link
Contributor

@romseygeek romseygeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jimczi jimczi removed the v9.3.1 label Dec 19, 2025
@jimczi jimczi merged commit d6bcada into elastic:main Dec 19, 2025
35 checks passed
@jimczi jimczi deleted the script_sort_optional_scorer branch December 19, 2025 11:38
szybia added a commit to szybia/elasticsearch that referenced this pull request Dec 19, 2025
* upstream/main: (25 commits)
  Add spec for project routing CRUD REST API endpoints (elastic#139634)
  Implement AllSupportedFIeldsTestCase for TDigest (elastic#139744)
  Mute elastic#139802 (elastic#139803)
  fix(logsdb): batch bulk indexing to prevent OOM in challenge tests (elastic#139770)
  Documentation for semantic_text auto pre-filtering (elastic#139749)
  Always do bulk scoring for rescoring when possible (elastic#139777)
  Optimize script sorts that do not require query scores (elastic#139748)
  Bump versions after 9.1.9 release
  Update branches.json for 9.1.9 release
  Bump versions after 9.2.3 release
  Prune changelogs after 8.19.9 release
  Bump versions after 8.19.9 release
  Update branches.json for 8.19.9 release
  Finalize docs for v9.2.3 release (elastic#139795)
  ESQL: Added timezone support to date_format and date_parse (elastic#138517)
  Update branches.json for 9.2.3 release
  Finalize docs for v9.1.9 release (elastic#139796)
  Switch inline stats to GA in docs (elastic#139753)
  Validate license in CPS (elastic#139105)
  FIPS 140-3 support with BC FIPS 2.0.x (elastic#139319)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>enhancement :Search Foundations/Search Catch all for Search Foundations Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants