You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
long wildcard query on wildcard field causes too_many_clauses exception, the matchAllTermsQuery function in WildcardFieldMapper.java directly concat all the terms generated by NGrams. Maybe the better way is to test and restrain the total clause number to a reasonable degree, so even long search strings can proceed as expected instead of throwing an exception. The only downside is verification phase may take longer time, because the qualified document may increase.
{"error":{"root_cause":[{"type":"query_shard_exception","reason":"failed to create query: maxClauseCount is set to 1024","index":"my-index","index_uuid":"HLjKYimwRx2cVkiqzvvj5Q"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"my-index","node":"jRDKdrICRqmOdhG5fW33Pg","reason":{"type":"query_shard_exception","reason":"failed to create query: maxClauseCount is set to 1024","index":"my-index","index_uuid":"HLjKYimwRx2cVkiqzvvj5Q","caused_by":{"type":"too_many_clauses","reason":"maxClauseCount is set to 1024"}}}]},"status":400}%
Expected behavior
Return the expected search result even for long search strings
Additional Details
No response
The text was updated successfully, but these errors were encountered:
[Search Triage] This is a good catch! Thanks @HUSTERGS. Limiting the clause count is a good idea. We may want to keep clauses in a priority queue of limited size, where the comparator keeps the lowest-frequency terms.
@HUSTERGS -- are you able to take that on? Need any help with it?
Describe the bug
long wildcard query on wildcard field causes
too_many_clauses
exception, thematchAllTermsQuery
function inWildcardFieldMapper.java
directly concat all the terms generated by NGrams. Maybe the better way is to test and restrain the total clause number to a reasonable degree, so even long search strings can proceed as expected instead of throwing an exception. The only downside is verification phase may take longer time, because the qualified document may increase.Related component
Search
To Reproduce
wildcard
fieldwildcard
fieldExpected behavior
Return the expected search result even for long search strings
Additional Details
No response
The text was updated successfully, but these errors were encountered: