elasticsearch/docs/reference
Luca Cavanna 18942d5b11
Enhance nested depth tracking when parsing queries (#90425)
When parsing queries on the coordinating node, there is currently no way to share state between the different parsing methods (`fromXContent`). The only query that supports a parse context is bool query, which uses the context to track nested depth of queries, added with #66204. Such nested depth tracking mechanism is not 100% accurate as it tracks bool queries only, while there's many more query types that can hold other queries hence potentially cause stack overflow when deeply nested.

This change removes the parsing context that's specific to bool query, introduced with #66204, in favour of generalizing the nested depth tracking to all query types.

The generic tracking is introduced by wrapping the parser and overriding the method that parses named objects through the xcontent registry. Another way would have been to require a context argument when parsing queries, which would mean adding a context argument to all the QueryBuilder#fromXContent static methods. That would be a breaking change for plugins that provide custom queries, hence I went for trying out a different approach.

One aspect that this change requires and introduces is the distinction between parsing a top level query (which will wrap the parser, or it would create the context if we had one), as opposed to parsing an inner query, which goes ahead with the given parser and context. We already have this distinction as we have two different static methods in `AbstractQueryBuilder` but in practice only bool query makes the distinction being the only context-aware query.

In addition to generalizing tracking nested depth when parsing queries, we should be able to adopt this same strategy to track queries usage as part #90176 .

Given that the depth check is now more restrictive, as it counts all compound queries and not only bool, we have decided to raise the default limit to `30` to ensure that users are not going to hit the limit due to this change.
2022-10-12 15:15:06 +02:00
..
aggregations [ML] Add a regex to the output of the categorize_text aggregation (#90723) 2022-10-10 11:41:16 +01:00
analysis [DOCS] Add note for tokenizers that don't support keep types token filter (#87553) 2022-06-13 11:28:32 +02:00
autoscaling [DOCS] Document autoscaling processors (#88248) 2022-07-05 13:51:51 +02:00
cat Redefine section on sizing data nodes (#90274) 2022-09-30 12:37:21 +03:00
ccr DOC CCR Disaster recovery does not handle Security configuration (#85522) 2022-10-12 13:53:53 +03:00
cluster Deprecate state field in /_cluster/reroute response (#90399) 2022-10-05 08:18:27 +02:00
commands Deprecate state field in /_cluster/reroute response (#90399) 2022-10-05 08:18:27 +02:00
data-management [DOC] auto migrate only for default template (#82043) 2022-05-10 11:35:19 -04:00
data-streams [TSDB] Removed summary and histogram metric types (#89937) 2022-09-09 15:04:30 +03:00
docs More opinionated docs about http.max_content_length (#90500) 2022-09-29 16:07:38 +01:00
eql [DOCS] Fix link to AtomicRed JSON file (#88817) 2022-07-26 10:54:18 -07:00
features/apis Make feature reset API response more informative (#71240) 2021-04-27 13:47:10 -04:00
fleet Fix some typos in plugins & reference docs (#84667) 2022-03-07 12:29:58 -05:00
graph [DOCS] Fix typos (#83895) 2022-02-15 12:42:17 -05:00
health Rename the fields reported under details by the disk indicator (#90717) 2022-10-10 11:30:03 +01:00
high-availability Weaken language about "low-latency" networks (#89198) 2022-08-09 13:15:37 +01:00
how-to Deprecate state field in /_cluster/reroute response (#90399) 2022-10-05 08:18:27 +02:00
ilm ILM don't rollover empty indices (#89557) 2022-09-19 18:37:41 -04:00
images Re-registering corrupt repository unblocks it (#89719) 2022-09-12 20:21:35 +03:00
index-modules Introduce max headroom for disk watermark stages (#88639) 2022-09-19 14:59:18 +03:00
indices Make force merge warning more precise (#90151) 2022-09-26 12:07:13 -07:00
ingest Deprecate 'remove_binary' default of false for ingest attachment processor (#90460) 2022-10-04 01:04:40 +10:30
licensing [DOCS] Remove testenv annotations from doc snippet tests (#80023) 2021-11-05 18:38:50 -04:00
mapping Remove any mention of "mapping type" (#86242) 2022-09-27 16:47:11 +02:00
migration [DOCS] Add 8.5 release notes and fix links (#90201) 2022-09-21 16:57:18 -04:00
ml [ML] Add api to update trained model deployment number_of_allocations (#90728) 2022-10-12 10:04:23 +03:00
modules Enhance nested depth tracking when parsing queries (#90425) 2022-10-12 15:15:06 +02:00
monitoring [DOCS] Adding Getting Help section to troubleshooting docs (#87095) 2022-05-25 15:58:41 -04:00
query-dsl Avoid negative scores with cross_fields type (#89016) 2022-09-06 13:02:24 -07:00
release-notes [DOCS] Remove coming tag from 8.4.3 release notes (#90683) 2022-10-05 08:05:41 -07:00
repositories-metering-api [DOCS] Remove testenv annotations from doc snippet tests (#80023) 2021-11-05 18:38:50 -04:00
rest-api Centroid aggregation for cartesian points and shapes (#89216) 2022-09-28 17:14:30 +02:00
rollup Remove unexpected meta param in agg's response (#89467) 2022-08-26 15:57:51 -04:00
scripting [Docs] Fix runtime grok script example (#87851) 2022-07-05 10:53:24 -04:00
search Add profiling and documentation for dfs phase (#90536) 2022-10-05 09:54:36 -07:00
searchable-snapshots Update language around eliminating replicate shards (#90375) 2022-09-26 14:49:12 -04:00
settings ILM don't rollover empty indices (#89557) 2022-09-19 18:37:41 -04:00
setup [DOCS] Revert changes for ES_JAVA_OPTS (#89931) 2022-09-08 13:37:39 -04:00
shutdown/apis [doc] Explicitly mention about node shutdown remove for cluster shrink (#86173) 2022-05-09 10:24:54 +02:00
slm/apis [DOCS] Remove soft limit for snapshot repositories (#80745) 2021-11-16 12:24:18 -05:00
snapshot-restore [DOCS] Fixed footnote. Closes #89403 (#90541) 2022-09-29 16:48:02 -07:00
sql SQL: Implement DATE_FORMAT function (#88388) 2022-09-12 09:33:34 +02:00
tab-widgets Add repeated snapshot failure troubleshooting guide (#89762) 2022-09-15 17:01:32 -04:00
text-structure/apis [ML] Allow overriding timestamp field to null in file structure finder (#90764) 2022-10-12 09:08:25 +01:00
transform [DOCS] Adds missing_bucket setting to transform APIs (#90111) 2022-09-19 15:22:48 +02:00
troubleshooting Deprecate state field in /_cluster/reroute response (#90399) 2022-10-05 08:18:27 +02:00
upgrade Docs for snapshots as simple archives (#86261) 2022-05-30 13:23:53 +02:00
vectors [DOCS] Remove testenv annotations from doc snippet tests (#80023) 2021-11-05 18:38:50 -04:00
aggregations.asciidoc Convert bucket aggs docs to runtime fields (#71202) 2021-04-02 12:12:06 -04:00
alias.asciidoc [DOCS] Fix default for is_write_index (#77006) (#77362) 2021-09-07 11:34:53 -04:00
analysis.asciidoc Update Lucene analysis base url (#84094) 2022-02-17 12:44:12 +01:00
api-conventions.asciidoc Fix a typo in api-conventions example (#88056) 2022-06-27 13:58:51 -04:00
cat.asciidoc [DOCS] Remove unneeded escapes 2021-04-26 12:14:45 -04:00
cluster.asciidoc How-to docs for increasing the total number of shards per node (#86214) 2022-05-10 09:13:27 +01:00
data-management.asciidoc reorder and merge data management and ILM doc pages (#84679) 2022-03-07 18:33:28 -05:00
data-rollup-transform.asciidoc [DOCS] Remove ifdefs for rollup refactor 2021-08-05 09:08:04 -04:00
datatiers.asciidoc [DOCS] Fix duplicate anchor (#85424) 2022-03-28 15:16:08 -07:00
dependencies-versions.asciidoc [DOCS] Added appendix to show dependencies (#67962) 2021-01-26 16:16:05 -08:00
docs.asciidoc [DOCS] Update single index APIs reference (#73103) 2021-05-14 11:53:34 -04:00
gs-index.asciidoc
high-availability.asciidoc [DOCS] Overhaul snapshot and restore docs (#79081) 2021-11-15 12:45:07 -05:00
how-to.asciidoc Move fix common cluster issues to troubleshooting (#87440) 2022-06-13 17:16:17 -07:00
index-extra-title-page.html [DOCS] Add index-extra-title-page.html for direct HTML migration (#50189) 2019-12-13 12:44:12 -05:00
index-modules.asciidoc [DOCS] Revert changes for ES_JAVA_OPTS (#89931) 2022-09-08 13:37:39 -04:00
index.asciidoc [DOCS] Remove ES quickstart. (#87939) 2022-06-23 14:25:48 -07:00
index.x.asciidoc
indices.asciidoc Remove endpoint for freezing indices (#78918) 2021-10-26 06:37:56 -05:00
ingest.asciidoc docs: update fleet/agent pipeline docs (#90659) 2022-10-05 13:06:58 -07:00
intro.asciidoc [DOCS] Update ES intro for stretched clusters (#77651) 2021-09-13 16:50:08 -04:00
links.asciidoc [DOCS] Rename ES Reference to ES Guide (#71198) 2021-04-01 15:38:41 -04:00
mapping.asciidoc Minor revision missed in merge. (#67282) 2021-01-11 13:50:06 -05:00
query-dsl.asciidoc Allow doc-values only search on geo_point fields (#83395) 2022-02-02 11:56:19 +01:00
redirects.asciidoc [DOCS] Add minimal security steps back to docs (#88393) 2022-07-19 10:01:34 -04:00
release-notes.asciidoc [Doc] Release notes for v8.4.3 (#90443) (#90538) 2022-09-30 16:10:26 -04:00
scripting.asciidoc [DOCS] Add documentation for Painless field API (#83388) 2022-02-03 15:15:38 -05:00
search.asciidoc Deprecate the _knn_search endpoint (#88828) 2022-08-03 15:19:01 -04:00
setup.asciidoc [DOCS] Add simple dev setup instructions back to the README (#89714) 2022-09-01 16:49:05 -07:00
troubleshooting.asciidoc Add repeated snapshot failure troubleshooting guide (#89762) 2022-09-15 17:01:32 -04:00
upgrade.asciidoc Reinstate prerelease upgrade warning (#90093) 2022-09-16 00:06:08 +09:30