Skip to content

Don't always rewrite the Lucene query in search phases#79367

Merged
jimczi merged 1 commit intoelastic:7.xfrom
jimczi:lucene_query_search_rewrite_7x
Oct 18, 2021
Merged

Don't always rewrite the Lucene query in search phases#79367
jimczi merged 1 commit intoelastic:7.xfrom
jimczi:lucene_query_search_rewrite_7x

Conversation

@jimczi
Copy link
Copy Markdown
Contributor

@jimczi jimczi commented Oct 18, 2021

Backport of #79358

Today the Lucene query is rewritten eagerly in the dfs, query and fetch search phases.
While this is needed in dfs and search, most of the fetch phases could avoid this cost.
This change adds an explicit accessor for SearchContext that rewrites the original query
once and returns its rewritten form. That allows to rewrite the Lucene query only when
it's required.
@jimczi jimczi merged commit a09729c into elastic:7.x Oct 18, 2021
@jimczi jimczi deleted the lucene_query_search_rewrite_7x branch October 18, 2021 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant