Skip to content

Fail span_multi queries that don't use top_terms_* rewriting #27432

@jimczi

Description

@jimczi

The span multi term query limits the number of expanded terms to search only if the inner multi term query uses top_terms_N rewrite. Otherwise it extracts all terms that match the inner multi term query and use them to build a giant span_or query without any limit.
We should force the inner multi term query to use a top_terms_N rewrite in order to limit the memory. Currently a prefix query like a* would extract all term that starts with a since the default rewrite of the prefix query is constant_score. This mode is optimized for prefix query and should never be used on a span_multi which needs to access all positions for the extracted terms.

Metadata

Metadata

Assignees

Labels

:Search/SearchSearch-related issues that do not fall into other categories>bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions