Skip to content

Conversation

mayya-sharipova
Copy link
Contributor

Currently multi term interval queries (prefix, wildcard, fuzzy, regexp and range) can
expand maximum to 128 terms. To reach parity with span queries that we want to deprecate,
set max expansions to indices.query.bool.max_clause_count which is used in span queries.

Relates to #110491

@mayya-sharipova mayya-sharipova added >enhancement :Search Relevance/Search Catch all for Search Relevance labels Sep 12, 2024
Copy link
Contributor

Documentation preview:

@elasticsearchmachine elasticsearchmachine added the Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch label Sep 12, 2024
@elasticsearchmachine
Copy link
Collaborator

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

@benwtrent
Copy link
Member

@mayya-sharipova I am trying to find the reason for the original limit. What was the reason for the 128? It seems very specific :/. Did we just pick the value at random?

@mayya-sharipova
Copy link
Contributor Author

@benwtrent Thanks for checking.

I am trying to find the reason for the original limit. What was the reason for the 128? It seems very specific :/. Did we just pick the value at random?

The limit came as default value from Lucene. Lucene also has warnings: " Setting.. maxExpansions ..to higher than the default value of can be both slow and memory-intensive".

But outside of intervals, for our default multi-term queries we support different rewrite params , and allow to rewrite up to indices.query.bool.max_clause_count. So my mind, this change should be fine.

@mayya-sharipova mayya-sharipova force-pushed the intervals_increase_max_expansions branch from 8535e4c to 7095cf3 Compare September 12, 2024 18:13
@benwtrent
Copy link
Member

@mayya-sharipova Ah, it was the default value, not the expressed limit in Lucene.

Currently multi term interval queries (prefix, wildcard, fuzzy, regexp and range) can
expand maximum to 128 terms. To reach parity with span queries that we want to deprecate,
set max expansions to indices.query.bool.max_clause_count which is used in span queries.

Relates to elastic#110491
@mayya-sharipova mayya-sharipova force-pushed the intervals_increase_max_expansions branch from 0beed2b to e8f8a08 Compare September 18, 2024 19:10
@mayya-sharipova mayya-sharipova removed request for a team September 18, 2024 19:10
@mayya-sharipova mayya-sharipova added the auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) label Sep 18, 2024
@mayya-sharipova
Copy link
Contributor Author

@elasticsearchmachine update branch

@mayya-sharipova
Copy link
Contributor Author

All tests pass, there is a failure in the test:
REPRODUCE WITH: ./gradlew ":rest-api-spec:yamlRestCompatTest" --tests "org.elasticsearch.test.rest.ClientYamlTestSuiteIT" -Dtests.method="test {yaml=indices.create/21_synthetic_source_stored/index param - nested array within array}" -Dtests.seed=E0452F9AAC92C531 -Dtests.locale=es-Latn-ES -Dtests.timezone=America/Boise -Druntime.java=22
but it is muted in main.

So I am going to merge in lcuene_snapshot branch this change.

@mayya-sharipova mayya-sharipova merged commit 7150729 into elastic:lucene_snapshot Sep 19, 2024
13 of 15 checks passed
@mayya-sharipova mayya-sharipova deleted the intervals_increase_max_expansions branch September 19, 2024 15:40
javanna pushed a commit that referenced this pull request Sep 21, 2024
Currently multi term interval queries (prefix, wildcard, fuzzy, regexp and range) can
expand maximum to 128 terms. To reach parity with span queries that we want to deprecate,
set max expansions to indices.query.bool.max_clause_count which is used in span queries.

Relates to #110491
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!) >enhancement :Search Relevance/Search Catch all for Search Relevance Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch v8.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants