Skip to content

Conversation

@romseygeek
Copy link
Contributor

@romseygeek romseygeek commented Nov 3, 2025

Keyword automaton queries against doc-values-only fields can use standard MultiTermQuery
implementations with DOC_VALUES_REWRITE rewrite methods. These should be
considerably faster and more efficient than the scripted query implementations.

@romseygeek romseygeek self-assigned this Nov 3, 2025
@romseygeek romseygeek added >enhancement :Search/Search Search-related issues that do not fall into other categories v9.3.0 labels Nov 3, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Search Meta label for search team label Nov 3, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine
Copy link
Collaborator

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

@felixbarny
Copy link
Member

Do you feel like the existing tests are enough to give us confidence in that there are no regressions or is there an opportunity to add more coverage?

@romseygeek
Copy link
Contributor Author

The behaviour should be exactly the same, so other than checking the type of the queries (which I'm a bit reluctant to do because that then gives us spurious failures if other ways of querying get added later) I don't think there's a meaningful test to be added. I will see if there is an existing benchmark suite that will demonstrate the performance change.

Copy link
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

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

LGTM

There is no test suite to guarantee that exact same behavior, but it should be the same.
The yaml tests that were introduced when script based lucene queries were added are still there and did pass this change.

Copy link
Member

@felixbarny felixbarny left a comment

Choose a reason for hiding this comment

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

I'm good to merge as-is. We can observe the impact on nightlies but I don't see how this could cause a regression. About the comment regarding tests, I was trying to make sure we have some coverage, I agree that we shouldn't assert on the type of the query, just that the outcome is similar. But it seems we have existing yaml tests for it 👍

Once this is merged, I'll also re-run the benchmarks for #137029.

@romseygeek romseygeek merged commit 4e68ecc into elastic:main Nov 4, 2025
34 checks passed
@romseygeek romseygeek deleted the keyword/dv-automaton-queries branch November 4, 2025 09:47
@felixbarny
Copy link
Member

Looks like this helped to avoid the regression for prefix filter queries: #137029 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>enhancement :Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants