Use dynamic max clause count for field expansion limit - #22573
Use dynamic max clause count for field expansion limit#22573igoralex1992 wants to merge 2 commits into
Conversation
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit 0b0de65. ⛔ Hard block: Issues at Medium severity or above will block this PR from merging.
The table above displays the top 10 most important findings. Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
|
Hi! I'm not the most experienced contributor, but it looks like the current implementation doesn't actually use Based on the code, this setting is only reflected in the error message, for example:
Please take a look at this PR. With this change, updates to Manual verification: Before the fix: After the fix: This confirms that |
|
I forgot one more file, added a commit |
Description
This change makes
QueryParserHelperuse the current value ofindices.query.bool.max_clause_countwhen validating field expansion.Previously,
checkForTooManyFields()retrieved the limit fromcontext.getIndexSettings().getSettings(). However,indices.query.bool.max_clause_countis a cluster setting and is notpart of the index settings, so this is not the correct source for the
current value.
To address this,
SearchServicenow caches the current value of thecluster setting and updates it through the existing settings update
consumer.
QueryParserHelperretrieves the limit fromSearchServiceinstead of reading it from
IndexSettings.Changes
fieldExpansionLimittoSearchService.indices.query.bool.max_clause_countchanges.QueryParserHelperwith aSearchServiceinstance.Motivation
This ensures that field expansion validation always uses the current
value of
indices.query.bool.max_clause_count, including after dynamiccluster setting updates.
Related Issues
N/A
Check List