From 94cad286bc2f18c9d830fbab89319b552a40040f Mon Sep 17 00:00:00 2001 From: Craig Taverner Date: Mon, 17 Mar 2025 17:58:58 +0100 Subject: [PATCH] Restructure query-languages docs files for clarity (#124797) In a few previous PR's we restructured the ES|QL docs to make it possible to generate them dynamically. This PR just moves a few files around to make the query languages docs easier to work with, and a little more organized like the ES|QL docs. A bit part of this was setting up redirects to the new locations, so other repo's could correctly link to the elasticsearch docs. --- docs/redirects.yml | 43 ++++ ...gregations-bucket-daterange-aggregation.md | 2 +- ...egations-bucket-geohashgrid-aggregation.md | 4 +- ...regations-bucket-geohexgrid-aggregation.md | 6 +- ...egations-bucket-geotilegrid-aggregation.md | 6 +- ...regations-bucket-rare-terms-aggregation.md | 2 +- ...h-aggregations-bucket-terms-aggregation.md | 2 +- ...gregations-metrics-top-hits-aggregation.md | 4 +- .../analysis-shingle-tokenfilter.md | 2 +- .../analysis-simplepattern-tokenizer.md | 2 +- .../analysis-simplepatternsplit-tokenizer.md | 2 +- ...alysis-word-delimiter-graph-tokenfilter.md | 8 +- .../analysis-word-delimiter-tokenfilter.md | 6 +- .../mapper-annotated-text-usage.md | 2 +- .../circuit-breaker-settings.md | 4 +- .../index-settings/index-modules.md | 12 +- .../aggregate-metric-double.md | 8 +- .../mapping-reference/dense-vector.md | 4 +- .../mapping-reference/flattened.md | 2 +- .../mapping-reference/geo-point.md | 4 +- .../mapping-reference/geo-shape.md | 6 +- .../mapping-reference/histogram.md | 2 +- .../mapping-reference/index-options.md | 2 +- .../elasticsearch/mapping-reference/ip.md | 2 +- .../mapping-reference/keyword.md | 20 +- .../mapping-field-names-field.md | 4 +- .../mapping-reference/mapping-id-field.md | 4 +- .../mapping-ignored-field.md | 2 +- .../mapping-routing-field.md | 2 +- .../elasticsearch/mapping-reference/nested.md | 4 +- .../mapping-reference/normalizer.md | 2 +- .../elasticsearch/mapping-reference/number.md | 6 +- .../mapping-reference/parent-join.md | 6 +- .../mapping-reference/percolator.md | 2 +- .../elasticsearch/mapping-reference/point.md | 2 +- .../position-increment-gap.md | 2 +- .../elasticsearch/mapping-reference/range.md | 4 +- .../mapping-reference/rank-feature.md | 6 +- .../mapping-reference/rank-features.md | 8 +- .../mapping-reference/rank-vectors.md | 2 +- .../mapping-reference/search-as-you-type.md | 6 +- .../mapping-reference/semantic-text.md | 4 +- .../elasticsearch/mapping-reference/shape.md | 2 +- .../mapping-reference/sparse-vector.md | 4 +- .../elasticsearch/mapping-reference/text.md | 6 +- .../rest-apis/api-conventions.md | 2 +- .../elasticsearch/rest-apis/common-options.md | 2 +- .../rest-apis/filter-search-results.md | 6 +- .../rest-apis/reciprocal-rank-fusion.md | 2 +- .../elasticsearch/rest-apis/retrievers.md | 16 +- .../rest-apis/search-suggesters.md | 2 +- .../rest-apis/searching-with-query-rules.md | 10 +- .../enrich-processor/enrich-processor.md | 2 +- docs/reference/query-languages/eql.md | 20 +- .../{ => eql}/eql-ex-threat-detection.md | 2 +- .../{ => eql}/eql-function-ref.md | 2 +- .../query-languages/{ => eql}/eql-pipe-ref.md | 2 +- .../query-languages/{ => eql}/eql-syntax.md | 12 +- .../_snippets/functions/description/match.md | 2 +- .../_snippets/functions/description/qstr.md | 2 +- .../_snippets/functions/examples/to_lower.md | 10 +- .../_snippets/functions/parameters/match.md | 2 +- .../_snippets/functions/parameters/qstr.md | 2 +- .../functions/parameters/to_lower.md | 2 +- .../functions/parameters/to_upper.md | 2 +- .../operators/layout/match_operator.md | 4 +- .../esql/_snippets/operators/layout/rlike.md | 2 +- .../query-languages/esql/esql-commands.md | 4 +- .../query-languages/esql/esql-enrich-data.md | 6 +- .../kibana/definition/functions/to_lower.json | 7 +- .../kibana/definition/functions/to_upper.json | 4 +- .../query-dsl-constant-score-query.md | 37 --- .../query-dsl-match-bool-prefix-query.md | 64 ------ .../{ => query-dsl}/compound-queries.md | 10 +- .../{ => query-dsl}/full-text-queries.md | 20 +- .../{ => query-dsl}/geo-queries.md | 10 +- .../{ => query-dsl}/joining-queries.md | 6 +- .../{ => query-dsl}/query-dsl-bool-query.md | 6 +- .../query-dsl-boosting-query.md | 8 +- .../query-dsl-combined-fields-query.md | 12 +- .../query-dsl-constant-score-query.md | 37 +++ .../query-dsl-dis-max-query.md | 4 +- .../query-dsl-distance-feature-query.md | 12 +- .../{ => query-dsl}/query-dsl-exists-query.md | 2 +- .../query-dsl-function-score-query.md | 30 +-- .../{ => query-dsl}/query-dsl-fuzzy-query.md | 2 +- .../query-dsl-geo-bounding-box-query.md | 0 .../query-dsl-geo-distance-query.md | 0 .../query-dsl-geo-grid-query.md | 0 .../query-dsl-geo-polygon-query.md | 2 +- .../query-dsl-geo-shape-query.md | 0 .../query-dsl-has-child-query.md | 2 +- .../query-dsl-has-parent-query.md | 2 +- .../{ => query-dsl}/query-dsl-ids-query.md | 0 .../query-dsl-intervals-query.md | 2 +- .../{ => query-dsl}/query-dsl-knn-query.md | 0 .../query-dsl-match-all-query.md | 0 .../query-dsl-match-bool-prefix-query.md | 64 ++++++ .../query-dsl-match-query-phrase-prefix.md | 6 +- .../query-dsl-match-query-phrase.md | 2 +- .../{ => query-dsl}/query-dsl-match-query.md | 14 +- .../query-dsl-minimum-should-match.md | 0 .../{ => query-dsl}/query-dsl-mlt-query.md | 4 +- .../query-dsl-multi-match-query.md | 16 +- .../query-dsl-multi-term-rewrite.md | 24 +- .../{ => query-dsl}/query-dsl-nested-query.md | 6 +- .../query-dsl-parent-id-query.md | 0 .../query-dsl-percolate-query.md | 0 .../{ => query-dsl}/query-dsl-pinned-query.md | 0 .../{ => query-dsl}/query-dsl-prefix-query.md | 2 +- .../query-dsl-query-string-query.md | 42 ++-- .../{ => query-dsl}/query-dsl-range-query.md | 2 +- .../query-dsl-rank-feature-query.md | 18 +- .../{ => query-dsl}/query-dsl-regexp-query.md | 8 +- .../{ => query-dsl}/query-dsl-rule-query.md | 2 +- .../{ => query-dsl}/query-dsl-script-query.md | 4 +- .../query-dsl-script-score-query.md | 8 +- .../query-dsl-semantic-query.md | 0 .../{ => query-dsl}/query-dsl-shape-query.md | 0 .../query-dsl-simple-query-string-query.md | 10 +- .../query-dsl-span-containing-query.md | 0 .../query-dsl-span-field-masking-query.md | 0 .../query-dsl-span-first-query.md | 0 .../query-dsl-span-multi-term-query.md | 2 +- .../query-dsl-span-near-query.md | 0 .../query-dsl-span-not-query.md | 0 .../{ => query-dsl}/query-dsl-span-query.md | 0 .../query-dsl-span-term-query.md | 0 .../query-dsl-span-within-query.md | 0 .../query-dsl-sparse-vector-query.md | 4 +- .../{ => query-dsl}/query-dsl-term-query.md | 4 +- .../{ => query-dsl}/query-dsl-terms-query.md | 4 +- .../query-dsl-terms-set-query.md | 4 +- .../query-dsl-text-expansion-query.md | 4 +- .../query-dsl-weighted-tokens-query.md | 2 +- .../query-dsl-wildcard-query.md | 6 +- .../query-dsl-wrapper-query.md | 0 .../{ => query-dsl}/query-filter-context.md | 4 +- .../{ => query-dsl}/regexp-syntax.md | 4 +- .../{ => query-dsl}/shape-queries.md | 2 +- .../{ => query-dsl}/span-queries.md | 22 +- .../{ => query-dsl}/specialized-queries.md | 20 +- .../{ => query-dsl}/term-level-queries.md | 22 +- .../{ => query-dsl}/vector-queries.md | 12 +- docs/reference/query-languages/querydsl.md | 24 +- .../reference/query-languages/sql-commands.md | 27 --- .../query-languages/sql-functions.md | 205 ----------------- docs/reference/query-languages/sql.md | 8 +- .../query-languages/sql/sql-commands.md | 27 +++ .../{ => sql}/sql-data-types.md | 2 +- .../{ => sql}/sql-functions-aggs.md | 2 +- .../{ => sql}/sql-functions-conditional.md | 0 .../{ => sql}/sql-functions-datetime.md | 0 .../{ => sql}/sql-functions-geo.md | 0 .../{ => sql}/sql-functions-grouping.md | 4 +- .../{ => sql}/sql-functions-math.md | 0 .../{ => sql}/sql-functions-search.md | 8 +- .../{ => sql}/sql-functions-string.md | 0 .../{ => sql}/sql-functions-system.md | 0 .../sql-functions-type-conversion.md | 4 +- .../query-languages/sql/sql-functions.md | 205 +++++++++++++++++ .../{ => sql}/sql-index-frozen.md | 0 .../{ => sql}/sql-index-patterns.md | 0 .../{ => sql}/sql-lexical-structure.md | 4 +- .../{ => sql}/sql-like-rlike-operators.md | 8 +- .../{ => sql}/sql-limitations.md | 10 +- .../{ => sql}/sql-operators-cast.md | 2 +- .../{ => sql}/sql-operators-logical.md | 0 .../{ => sql}/sql-operators-math.md | 0 .../{ => sql}/sql-operators.md | 0 .../query-languages/{ => sql}/sql-spec.md | 8 +- .../{ => sql}/sql-syntax-describe-table.md | 2 +- .../{ => sql}/sql-syntax-reserved.md | 0 .../{ => sql}/sql-syntax-select.md | 8 +- .../{ => sql}/sql-syntax-show-catalogs.md | 0 .../{ => sql}/sql-syntax-show-columns.md | 2 +- .../{ => sql}/sql-syntax-show-functions.md | 0 .../{ => sql}/sql-syntax-show-tables.md | 2 +- docs/reference/query-languages/toc.yml | 214 +++++++++--------- .../painless/brief-painless-walkthrough.md | 2 +- .../painless/painless-api-examples.md | 2 +- .../painless/painless-contexts.md | 6 +- .../painless/painless-debugging.md | 2 +- .../painless/painless-filter-context.md | 2 +- .../painless-min-should-match-context.md | 2 +- .../painless/painless-score-context.md | 2 +- docs/reference/toc.yml | 210 ++++++++--------- .../expression/function/DocsV3Support.java | 6 +- 188 files changed, 1021 insertions(+), 969 deletions(-) create mode 100644 docs/redirects.yml rename docs/reference/query-languages/{ => eql}/eql-ex-threat-detection.md (99%) rename docs/reference/query-languages/{ => eql}/eql-function-ref.md (99%) rename docs/reference/query-languages/{ => eql}/eql-pipe-ref.md (97%) rename docs/reference/query-languages/{ => eql}/eql-syntax.md (98%) delete mode 100644 docs/reference/query-languages/query-dsl-constant-score-query.md delete mode 100644 docs/reference/query-languages/query-dsl-match-bool-prefix-query.md rename docs/reference/query-languages/{ => query-dsl}/compound-queries.md (75%) rename docs/reference/query-languages/{ => query-dsl}/full-text-queries.md (62%) rename docs/reference/query-languages/{ => query-dsl}/geo-queries.md (71%) rename docs/reference/query-languages/{ => query-dsl}/joining-queries.md (74%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-bool-query.md (90%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-boosting-query.md (74%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-combined-fields-query.md (89%) create mode 100644 docs/reference/query-languages/query-dsl/query-dsl-constant-score-query.md rename docs/reference/query-languages/{ => query-dsl}/query-dsl-dis-max-query.md (90%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-distance-feature-query.md (84%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-exists-query.md (96%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-function-score-query.md (95%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-fuzzy-query.md (97%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-geo-bounding-box-query.md (100%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-geo-distance-query.md (100%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-geo-grid-query.md (100%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-geo-polygon-query.md (93%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-geo-shape-query.md (100%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-has-child-query.md (97%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-has-parent-query.md (95%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-ids-query.md (100%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-intervals-query.md (99%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-knn-query.md (100%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-match-all-query.md (100%) create mode 100644 docs/reference/query-languages/query-dsl/query-dsl-match-bool-prefix-query.md rename docs/reference/query-languages/{ => query-dsl}/query-dsl-match-query-phrase-prefix.md (92%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-match-query-phrase.md (96%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-match-query.md (91%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-minimum-should-match.md (100%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-mlt-query.md (98%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-multi-match-query.md (90%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-multi-term-rewrite.md (71%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-nested-query.md (96%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-parent-id-query.md (100%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-percolate-query.md (100%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-pinned-query.md (100%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-prefix-query.md (97%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-query-string-query.md (91%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-range-query.md (98%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-rank-feature-query.md (81%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-regexp-query.md (91%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-rule-query.md (83%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-script-query.md (90%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-script-score-query.md (98%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-semantic-query.md (100%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-shape-query.md (100%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-simple-query-string-query.md (89%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-span-containing-query.md (100%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-span-field-masking-query.md (100%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-span-first-query.md (100%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-span-multi-term-query.md (73%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-span-near-query.md (100%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-span-not-query.md (100%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-span-query.md (100%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-span-term-query.md (100%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-span-within-query.md (100%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-sparse-vector-query.md (97%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-term-query.md (97%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-terms-query.md (93%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-terms-set-query.md (96%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-text-expansion-query.md (98%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-weighted-tokens-query.md (98%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-wildcard-query.md (91%) rename docs/reference/query-languages/{ => query-dsl}/query-dsl-wrapper-query.md (100%) rename docs/reference/query-languages/{ => query-dsl}/query-filter-context.md (97%) rename docs/reference/query-languages/{ => query-dsl}/regexp-syntax.md (97%) rename docs/reference/query-languages/{ => query-dsl}/shape-queries.md (92%) rename docs/reference/query-languages/{ => query-dsl}/span-queries.md (57%) rename docs/reference/query-languages/{ => query-dsl}/specialized-queries.md (59%) rename docs/reference/query-languages/{ => query-dsl}/term-level-queries.md (62%) rename docs/reference/query-languages/{ => query-dsl}/vector-queries.md (71%) delete mode 100644 docs/reference/query-languages/sql-commands.md delete mode 100644 docs/reference/query-languages/sql-functions.md create mode 100644 docs/reference/query-languages/sql/sql-commands.md rename docs/reference/query-languages/{ => sql}/sql-data-types.md (94%) rename docs/reference/query-languages/{ => sql}/sql-functions-aggs.md (99%) rename docs/reference/query-languages/{ => sql}/sql-functions-conditional.md (100%) rename docs/reference/query-languages/{ => sql}/sql-functions-datetime.md (100%) rename docs/reference/query-languages/{ => sql}/sql-functions-geo.md (100%) rename docs/reference/query-languages/{ => sql}/sql-functions-grouping.md (96%) rename docs/reference/query-languages/{ => sql}/sql-functions-math.md (100%) rename docs/reference/query-languages/{ => sql}/sql-functions-search.md (92%) rename docs/reference/query-languages/{ => sql}/sql-functions-string.md (100%) rename docs/reference/query-languages/{ => sql}/sql-functions-system.md (100%) rename docs/reference/query-languages/{ => sql}/sql-functions-type-conversion.md (77%) create mode 100644 docs/reference/query-languages/sql/sql-functions.md rename docs/reference/query-languages/{ => sql}/sql-index-frozen.md (100%) rename docs/reference/query-languages/{ => sql}/sql-index-patterns.md (100%) rename docs/reference/query-languages/{ => sql}/sql-lexical-structure.md (96%) rename docs/reference/query-languages/{ => sql}/sql-like-rlike-operators.md (77%) rename docs/reference/query-languages/{ => sql}/sql-limitations.md (88%) rename docs/reference/query-languages/{ => sql}/sql-operators-cast.md (77%) rename docs/reference/query-languages/{ => sql}/sql-operators-logical.md (100%) rename docs/reference/query-languages/{ => sql}/sql-operators-math.md (100%) rename docs/reference/query-languages/{ => sql}/sql-operators.md (100%) rename docs/reference/query-languages/{ => sql}/sql-spec.md (51%) rename docs/reference/query-languages/{ => sql}/sql-syntax-describe-table.md (95%) rename docs/reference/query-languages/{ => sql}/sql-syntax-reserved.md (100%) rename docs/reference/query-languages/{ => sql}/sql-syntax-select.md (97%) rename docs/reference/query-languages/{ => sql}/sql-syntax-show-catalogs.md (100%) rename docs/reference/query-languages/{ => sql}/sql-syntax-show-columns.md (93%) rename docs/reference/query-languages/{ => sql}/sql-syntax-show-functions.md (100%) rename docs/reference/query-languages/{ => sql}/sql-syntax-show-tables.md (96%) diff --git a/docs/redirects.yml b/docs/redirects.yml new file mode 100644 index 000000000000..c81bb746b5bb --- /dev/null +++ b/docs/redirects.yml @@ -0,0 +1,43 @@ +redirects: + 'reference/query-languages/query-dsl-intervals-query.md': 'reference/query-languages/query-dsl/query-dsl-intervals-query.md' + 'reference/query-languages/query-dsl-script-score-query.md': 'reference/query-languages/query-dsl/query-dsl-script-score-query.md' + 'reference/query-languages/query-dsl-range-query.md': 'reference/query-languages/query-dsl/query-dsl-range-query.md' + 'reference/query-languages/term-level-queries.md': 'reference/query-languages/query-dsl/term-level-queries.md' + 'reference/query-languages/query-dsl-term-query.md': 'reference/query-languages/query-dsl/query-dsl-term-query.md' + 'reference/query-languages/query-dsl-multi-match-query.md': 'reference/query-languages/query-dsl/query-dsl-multi-match-query.md' + 'reference/query-languages/query-dsl-query-string-query.md': + to: 'reference/query-languages/query-dsl/query-dsl-query-string-query.md' + anchors: + '_boosting': 'boosting' + 'boosting': 'boosting' + 'query-string-syntax': 'query-string-syntax' + 'reference/query-languages/shape-queries.md': 'reference/query-languages/query-dsl/shape-queries.md' + 'reference/query-languages/geo-queries.md': 'reference/query-languages/query-dsl/geo-queries.md' + 'reference/query-languages/full-text-queries.md': 'reference/query-languages/query-dsl/full-text-queries.md' + 'reference/query-languages/compound-queries.md': 'reference/query-languages/query-dsl/compound-queries.md' + 'reference/query-languages/query-dsl-bool-query.md': 'reference/query-languages/query-dsl/query-dsl-bool-query.md' + 'reference/query-languages/query-dsl-match-query.md': 'reference/query-languages/query-dsl/query-dsl-match-query.md' + 'reference/query-languages/query-dsl-sparse-vector-query.md': 'reference/query-languages/query-dsl/query-dsl-sparse-vector-query.md' + 'reference/query-languages/regexp-syntax.md': 'reference/query-languages/query-dsl/regexp-syntax.md' + 'reference/query-languages/query-dsl-script-query.md': 'reference/query-languages/query-dsl/query-dsl-script-query.md' + 'reference/query-languages/eql-syntax.md': 'reference/query-languages/eql/eql-syntax.md' + 'reference/query-languages/query-dsl-terms-query.md': 'reference/query-languages/query-dsl/query-dsl-terms-query.md' + 'reference/query-languages/query-dsl-shape-query.md': 'reference/query-languages/query-dsl/query-dsl-shape-query.md' + 'reference/query-languages/query-dsl-geo-shape-query.md': 'reference/query-languages/query-dsl/query-dsl-geo-shape-query.md' + 'reference/query-languages/query-dsl-match-all-query.md': 'reference/query-languages/query-dsl/query-dsl-match-all-query.md' + 'reference/query-languages/query-dsl-exists-query.md': 'reference/query-languages/query-dsl/query-dsl-exists-query.md' + 'reference/query-languages/query-dsl-minimum-should-match.md': 'reference/query-languages/query-dsl/query-dsl-minimum-should-match.md' + 'reference/query-languages/query-dsl-rank-feature-query.md': 'reference/query-languages/query-dsl/query-dsl-rank-feature-query.md' + 'reference/query-languages/query-dsl-match-query-phrase.md': 'reference/query-languages/query-dsl/query-dsl-match-query-phrase.md' + 'reference/query-languages/query-dsl-constant-score-query.md': 'reference/query-languages/query-dsl/query-dsl-constant-score-query.md' + 'reference/query-languages/query-dsl-percolate-query.md': 'reference/query-languages/query-dsl/query-dsl-percolate-query.md' + 'reference/query-languages/joining-queries.md': 'reference/query-languages/query-dsl/joining-queries.md' + 'reference/query-languages/query-dsl-wildcard-query.md': 'reference/query-languages/query-dsl/query-dsl-wildcard-query.md' + 'reference/query-languages/query-dsl-prefix-query.md': 'reference/query-languages/query-dsl/query-dsl-prefix-query.md' + 'reference/query-languages/query-dsl-regexp-query.md': 'reference/query-languages/query-dsl/query-dsl-regexp-query.md' + 'reference/query-languages/query-dsl-fuzzy-query.md': 'reference/query-languages/query-dsl/query-dsl-fuzzy-query.md' + 'reference/query-languages/query-dsl-dis-max-query.md': 'reference/query-languages/query-dsl/query-dsl-dis-max-query.md' + 'reference/query-languages/query-dsl-geo-distance-query.md': 'reference/query-languages/query-dsl/query-dsl-geo-distance-query.md' + 'reference/query-languages/query-dsl-function-score-query.md': 'reference/query-languages/query-dsl/query-dsl-function-score-query.md' + 'reference/query-languages/query-dsl-knn-query.md': 'reference/query-languages/query-dsl/query-dsl-knn-query.md' + 'reference/query-languages/query-dsl-text-expansion-query.md': 'reference/query-languages/query-dsl/query-dsl-text-expansion-query.md' diff --git a/docs/reference/data-analysis/aggregations/search-aggregations-bucket-daterange-aggregation.md b/docs/reference/data-analysis/aggregations/search-aggregations-bucket-daterange-aggregation.md index 5cb2485903f4..82f15d7f455e 100644 --- a/docs/reference/data-analysis/aggregations/search-aggregations-bucket-daterange-aggregation.md +++ b/docs/reference/data-analysis/aggregations/search-aggregations-bucket-daterange-aggregation.md @@ -64,7 +64,7 @@ Response: ``` ::::{warning} -If a format or date value is incomplete, the date range aggregation replaces any missing components with default values. See [Missing date components](/reference/query-languages/query-dsl-range-query.md#missing-date-components). +If a format or date value is incomplete, the date range aggregation replaces any missing components with default values. See [Missing date components](/reference/query-languages/query-dsl/query-dsl-range-query.md#missing-date-components). :::: diff --git a/docs/reference/data-analysis/aggregations/search-aggregations-bucket-geohashgrid-aggregation.md b/docs/reference/data-analysis/aggregations/search-aggregations-bucket-geohashgrid-aggregation.md index 10b3f689e6a6..2c7466fd04be 100644 --- a/docs/reference/data-analysis/aggregations/search-aggregations-bucket-geohashgrid-aggregation.md +++ b/docs/reference/data-analysis/aggregations/search-aggregations-bucket-geohashgrid-aggregation.md @@ -93,7 +93,7 @@ Response: ## High-precision requests [_high_precision_requests] -When requesting detailed buckets (typically for displaying a "zoomed in" map) a filter like [geo_bounding_box](/reference/query-languages/query-dsl-geo-bounding-box-query.md) should be applied to narrow the subject area otherwise potentially millions of buckets will be created and returned. +When requesting detailed buckets (typically for displaying a "zoomed in" map) a filter like [geo_bounding_box](/reference/query-languages/query-dsl/query-dsl-geo-bounding-box-query.md) should be applied to narrow the subject area otherwise potentially millions of buckets will be created and returned. $$$geohashgrid-aggregation-high-precision-example$$$ @@ -191,7 +191,7 @@ var bbox = geohash.decode_bbox('u17'); ## Requests with additional bounding box filtering [_requests_with_additional_bounding_box_filtering] -The `geohash_grid` aggregation supports an optional `bounds` parameter that restricts the cells considered to those that intersects the bounds provided. The `bounds` parameter accepts the bounding box in all the same [accepted formats](/reference/query-languages/query-dsl-geo-bounding-box-query.md#query-dsl-geo-bounding-box-query-accepted-formats) of the bounds specified in the Geo Bounding Box Query. This bounding box can be used with or without an additional `geo_bounding_box` query filtering the points prior to aggregating. It is an independent bounding box that can intersect with, be equal to, or be disjoint to any additional `geo_bounding_box` queries defined in the context of the aggregation. +The `geohash_grid` aggregation supports an optional `bounds` parameter that restricts the cells considered to those that intersects the bounds provided. The `bounds` parameter accepts the bounding box in all the same [accepted formats](/reference/query-languages/query-dsl/query-dsl-geo-bounding-box-query.md#query-dsl-geo-bounding-box-query-accepted-formats) of the bounds specified in the Geo Bounding Box Query. This bounding box can be used with or without an additional `geo_bounding_box` query filtering the points prior to aggregating. It is an independent bounding box that can intersect with, be equal to, or be disjoint to any additional `geo_bounding_box` queries defined in the context of the aggregation. $$$geohashgrid-aggregation-with-bounds$$$ diff --git a/docs/reference/data-analysis/aggregations/search-aggregations-bucket-geohexgrid-aggregation.md b/docs/reference/data-analysis/aggregations/search-aggregations-bucket-geohexgrid-aggregation.md index 1e53ffc901ec..70d41496c3b9 100644 --- a/docs/reference/data-analysis/aggregations/search-aggregations-bucket-geohexgrid-aggregation.md +++ b/docs/reference/data-analysis/aggregations/search-aggregations-bucket-geohexgrid-aggregation.md @@ -88,7 +88,7 @@ Response: ## High-precision requests [geohexgrid-high-precision] -When requesting detailed buckets (typically for displaying a "zoomed in" map), a filter like [geo_bounding_box](/reference/query-languages/query-dsl-geo-bounding-box-query.md) should be applied to narrow the subject area. Otherwise, potentially millions of buckets will be created and returned. +When requesting detailed buckets (typically for displaying a "zoomed in" map), a filter like [geo_bounding_box](/reference/query-languages/query-dsl/query-dsl-geo-bounding-box-query.md) should be applied to narrow the subject area. Otherwise, potentially millions of buckets will be created and returned. $$$geohexgrid-high-precision-ex$$$ @@ -150,7 +150,7 @@ Response: ## Requests with additional bounding box filtering [geohexgrid-addtl-bounding-box-filtering] -The `geohex_grid` aggregation supports an optional `bounds` parameter that restricts the cells considered to those that intersect the provided bounds. The `bounds` parameter accepts the same [bounding box formats](/reference/query-languages/query-dsl-geo-bounding-box-query.md#query-dsl-geo-bounding-box-query-accepted-formats) as the geo-bounding box query. This bounding box can be used with or without an additional `geo_bounding_box` query for filtering the points prior to aggregating. It is an independent bounding box that can intersect with, be equal to, or be disjoint to any additional `geo_bounding_box` queries defined in the context of the aggregation. +The `geohex_grid` aggregation supports an optional `bounds` parameter that restricts the cells considered to those that intersect the provided bounds. The `bounds` parameter accepts the same [bounding box formats](/reference/query-languages/query-dsl/query-dsl-geo-bounding-box-query.md#query-dsl-geo-bounding-box-query-accepted-formats) as the geo-bounding box query. This bounding box can be used with or without an additional `geo_bounding_box` query for filtering the points prior to aggregating. It is an independent bounding box that can intersect with, be equal to, or be disjoint to any additional `geo_bounding_box` queries defined in the context of the aggregation. $$$geohexgrid-aggregation-with-bounds$$$ @@ -218,7 +218,7 @@ precision : (Optional, integer) Integer zoom of the key used to define cells/buckets in the results. Defaults to `6`. Values outside of [`0`,`15`] will be rejected. bounds -: (Optional, object) Bounding box used to filter the geo-points or geo-shapes in each bucket. Accepts the same bounding box formats as the [geo-bounding box query](/reference/query-languages/query-dsl-geo-bounding-box-query.md#query-dsl-geo-bounding-box-query-accepted-formats). +: (Optional, object) Bounding box used to filter the geo-points or geo-shapes in each bucket. Accepts the same bounding box formats as the [geo-bounding box query](/reference/query-languages/query-dsl/query-dsl-geo-bounding-box-query.md#query-dsl-geo-bounding-box-query-accepted-formats). size : (Optional, integer) Maximum number of buckets to return. Defaults to 10,000. When results are trimmed, buckets are prioritized based on the volume of documents they contain. diff --git a/docs/reference/data-analysis/aggregations/search-aggregations-bucket-geotilegrid-aggregation.md b/docs/reference/data-analysis/aggregations/search-aggregations-bucket-geotilegrid-aggregation.md index 944f4ab40ef5..f539d79dfe1e 100644 --- a/docs/reference/data-analysis/aggregations/search-aggregations-bucket-geotilegrid-aggregation.md +++ b/docs/reference/data-analysis/aggregations/search-aggregations-bucket-geotilegrid-aggregation.md @@ -93,7 +93,7 @@ Response: ## High-precision requests [geotilegrid-high-precision] -When requesting detailed buckets (typically for displaying a "zoomed in" map), a filter like [geo_bounding_box](/reference/query-languages/query-dsl-geo-bounding-box-query.md) should be applied to narrow the subject area. Otherwise, potentially millions of buckets will be created and returned. +When requesting detailed buckets (typically for displaying a "zoomed in" map), a filter like [geo_bounding_box](/reference/query-languages/query-dsl/query-dsl-geo-bounding-box-query.md) should be applied to narrow the subject area. Otherwise, potentially millions of buckets will be created and returned. $$$geotilegrid-high-precision-ex$$$ @@ -155,7 +155,7 @@ Response: ## Requests with additional bounding box filtering [geotilegrid-addtl-bounding-box-filtering] -The `geotile_grid` aggregation supports an optional `bounds` parameter that restricts the cells considered to those that intersect the provided bounds. The `bounds` parameter accepts the same [bounding box formats](/reference/query-languages/query-dsl-geo-bounding-box-query.md#query-dsl-geo-bounding-box-query-accepted-formats) as the geo-bounding box query. This bounding box can be used with or without an additional `geo_bounding_box` query for filtering the points prior to aggregating. It is an independent bounding box that can intersect with, be equal to, or be disjoint to any additional `geo_bounding_box` queries defined in the context of the aggregation. +The `geotile_grid` aggregation supports an optional `bounds` parameter that restricts the cells considered to those that intersect the provided bounds. The `bounds` parameter accepts the same [bounding box formats](/reference/query-languages/query-dsl/query-dsl-geo-bounding-box-query.md#query-dsl-geo-bounding-box-query-accepted-formats) as the geo-bounding box query. This bounding box can be used with or without an additional `geo_bounding_box` query for filtering the points prior to aggregating. It is an independent bounding box that can intersect with, be equal to, or be disjoint to any additional `geo_bounding_box` queries defined in the context of the aggregation. $$$geotilegrid-aggregation-with-bounds$$$ @@ -220,7 +220,7 @@ precision : (Optional, integer) Integer zoom of the key used to define cells/buckets in the results. Defaults to `7`. Values outside of [`0`,`29`] will be rejected. bounds -: (Optional, object) Bounding box used to filter the geo-points or geo-shapes in each bucket. Accepts the same bounding box formats as the [geo-bounding box query](/reference/query-languages/query-dsl-geo-bounding-box-query.md#query-dsl-geo-bounding-box-query-accepted-formats). +: (Optional, object) Bounding box used to filter the geo-points or geo-shapes in each bucket. Accepts the same bounding box formats as the [geo-bounding box query](/reference/query-languages/query-dsl/query-dsl-geo-bounding-box-query.md#query-dsl-geo-bounding-box-query-accepted-formats). size : (Optional, integer) Maximum number of buckets to return. Defaults to 10,000. When results are trimmed, buckets are prioritized based on the volume of documents they contain. diff --git a/docs/reference/data-analysis/aggregations/search-aggregations-bucket-rare-terms-aggregation.md b/docs/reference/data-analysis/aggregations/search-aggregations-bucket-rare-terms-aggregation.md index 480747123dcc..d001c0078394 100644 --- a/docs/reference/data-analysis/aggregations/search-aggregations-bucket-rare-terms-aggregation.md +++ b/docs/reference/data-analysis/aggregations/search-aggregations-bucket-rare-terms-aggregation.md @@ -196,7 +196,7 @@ GET /_search In the above example, buckets will be created for all the tags that starts with `swi`, except those starting with `electro` (so the tag `swing` will be aggregated but not `electro_swing`). The `include` regular expression will determine what values are "allowed" to be aggregated, while the `exclude` determines the values that should not be aggregated. When both are defined, the `exclude` has precedence, meaning, the `include` is evaluated first and only then the `exclude`. -The syntax is the same as [regexp queries](/reference/query-languages/regexp-syntax.md). +The syntax is the same as [regexp queries](/reference/query-languages/query-dsl/regexp-syntax.md). ### Filtering Values with exact values [_filtering_values_with_exact_values] diff --git a/docs/reference/data-analysis/aggregations/search-aggregations-bucket-terms-aggregation.md b/docs/reference/data-analysis/aggregations/search-aggregations-bucket-terms-aggregation.md index c2112aafca0c..3bb76d937005 100644 --- a/docs/reference/data-analysis/aggregations/search-aggregations-bucket-terms-aggregation.md +++ b/docs/reference/data-analysis/aggregations/search-aggregations-bucket-terms-aggregation.md @@ -448,7 +448,7 @@ GET /_search In the above example, buckets will be created for all the tags that has the word `sport` in them, except those starting with `water_` (so the tag `water_sports` will not be aggregated). The `include` regular expression will determine what values are "allowed" to be aggregated, while the `exclude` determines the values that should not be aggregated. When both are defined, the `exclude` has precedence, meaning, the `include` is evaluated first and only then the `exclude`. -The syntax is the same as [regexp queries](/reference/query-languages/regexp-syntax.md). +The syntax is the same as [regexp queries](/reference/query-languages/query-dsl/regexp-syntax.md). ### Filtering Values with exact values [_filtering_values_with_exact_values_2] diff --git a/docs/reference/data-analysis/aggregations/search-aggregations-metrics-top-hits-aggregation.md b/docs/reference/data-analysis/aggregations/search-aggregations-metrics-top-hits-aggregation.md index 57ed6f15bb52..0350eb9d8761 100644 --- a/docs/reference/data-analysis/aggregations/search-aggregations-metrics-top-hits-aggregation.md +++ b/docs/reference/data-analysis/aggregations/search-aggregations-metrics-top-hits-aggregation.md @@ -29,7 +29,7 @@ The top_hits aggregation returns regular search hits, because of this many per h * [Highlighting](/reference/elasticsearch/rest-apis/highlighting.md) * [Explain](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search) -* [Named queries](/reference/query-languages/query-dsl-bool-query.md#named-queries) +* [Named queries](/reference/query-languages/query-dsl/query-dsl-bool-query.md#named-queries) * [Search fields](/reference/elasticsearch/rest-apis/retrieve-selected-fields.md#search-fields-param) * [Source filtering](/reference/elasticsearch/rest-apis/retrieve-selected-fields.md#source-filtering) * [Stored fields](/reference/elasticsearch/rest-apis/retrieve-selected-fields.md#stored-fields) @@ -43,7 +43,7 @@ If you **only** need `docvalue_fields`, `size`, and `sort` then [Top metrics](/r :::: -`top_hits` does not support the [`rescore`](/reference/elasticsearch/rest-apis/filter-search-results.md#rescore) parameter. Query rescoring applies only to search hits, not aggregation results. To change the scores used by aggregations, use a [`function_score`](/reference/query-languages/query-dsl-function-score-query.md) or [`script_score`](/reference/query-languages/query-dsl-script-score-query.md) query. +`top_hits` does not support the [`rescore`](/reference/elasticsearch/rest-apis/filter-search-results.md#rescore) parameter. Query rescoring applies only to search hits, not aggregation results. To change the scores used by aggregations, use a [`function_score`](/reference/query-languages/query-dsl/query-dsl-function-score-query.md) or [`script_score`](/reference/query-languages/query-dsl/query-dsl-script-score-query.md) query. ## Example [_example_6] diff --git a/docs/reference/data-analysis/text-analysis/analysis-shingle-tokenfilter.md b/docs/reference/data-analysis/text-analysis/analysis-shingle-tokenfilter.md index 702d4be220dc..0b03673404e3 100644 --- a/docs/reference/data-analysis/text-analysis/analysis-shingle-tokenfilter.md +++ b/docs/reference/data-analysis/text-analysis/analysis-shingle-tokenfilter.md @@ -12,7 +12,7 @@ Add shingles, or word [n-grams](https://en.wikipedia.org/wiki/N-gram), to a toke For example, many tokenizers convert `the lazy dog` to `[ the, lazy, dog ]`. You can use the `shingle` filter to add two-word shingles to this stream: `[ the, the lazy, lazy, lazy dog, dog ]`. ::::{tip} -Shingles are often used to help speed up phrase queries, such as [`match_phrase`](/reference/query-languages/query-dsl-match-query-phrase.md). Rather than creating shingles using the `shingles` filter, we recommend you use the [`index-phrases`](/reference/elasticsearch/mapping-reference/index-phrases.md) mapping parameter on the appropriate [text](/reference/elasticsearch/mapping-reference/text.md) field instead. +Shingles are often used to help speed up phrase queries, such as [`match_phrase`](/reference/query-languages/query-dsl/query-dsl-match-query-phrase.md). Rather than creating shingles using the `shingles` filter, we recommend you use the [`index-phrases`](/reference/elasticsearch/mapping-reference/index-phrases.md) mapping parameter on the appropriate [text](/reference/elasticsearch/mapping-reference/text.md) field instead. :::: diff --git a/docs/reference/data-analysis/text-analysis/analysis-simplepattern-tokenizer.md b/docs/reference/data-analysis/text-analysis/analysis-simplepattern-tokenizer.md index c8c7aa2d7495..d68cb4772447 100644 --- a/docs/reference/data-analysis/text-analysis/analysis-simplepattern-tokenizer.md +++ b/docs/reference/data-analysis/text-analysis/analysis-simplepattern-tokenizer.md @@ -11,7 +11,7 @@ The `simple_pattern` tokenizer uses a regular expression to capture matching tex This tokenizer does not support splitting the input on a pattern match, unlike the [`pattern`](/reference/data-analysis/text-analysis/analysis-pattern-tokenizer.md) tokenizer. To split on pattern matches using the same restricted regular expression subset, see the [`simple_pattern_split`](/reference/data-analysis/text-analysis/analysis-simplepatternsplit-tokenizer.md) tokenizer. -This tokenizer uses [Lucene regular expressions](https://lucene.apache.org/core/10_0_0/core/org/apache/lucene/util/automaton/RegExp.html). For an explanation of the supported features and syntax, see [Regular Expression Syntax](/reference/query-languages/regexp-syntax.md). +This tokenizer uses [Lucene regular expressions](https://lucene.apache.org/core/10_0_0/core/org/apache/lucene/util/automaton/RegExp.html). For an explanation of the supported features and syntax, see [Regular Expression Syntax](/reference/query-languages/query-dsl/regexp-syntax.md). The default pattern is the empty string, which produces no terms. This tokenizer should always be configured with a non-default pattern. diff --git a/docs/reference/data-analysis/text-analysis/analysis-simplepatternsplit-tokenizer.md b/docs/reference/data-analysis/text-analysis/analysis-simplepatternsplit-tokenizer.md index 7ab61ee48d08..a95fd92ceb51 100644 --- a/docs/reference/data-analysis/text-analysis/analysis-simplepatternsplit-tokenizer.md +++ b/docs/reference/data-analysis/text-analysis/analysis-simplepatternsplit-tokenizer.md @@ -11,7 +11,7 @@ The `simple_pattern_split` tokenizer uses a regular expression to split the inpu This tokenizer does not produce terms from the matches themselves. To produce terms from matches using patterns in the same restricted regular expression subset, see the [`simple_pattern`](/reference/data-analysis/text-analysis/analysis-simplepattern-tokenizer.md) tokenizer. -This tokenizer uses [Lucene regular expressions](https://lucene.apache.org/core/10_0_0/core/org/apache/lucene/util/automaton/RegExp.html). For an explanation of the supported features and syntax, see [Regular Expression Syntax](/reference/query-languages/regexp-syntax.md). +This tokenizer uses [Lucene regular expressions](https://lucene.apache.org/core/10_0_0/core/org/apache/lucene/util/automaton/RegExp.html). For an explanation of the supported features and syntax, see [Regular Expression Syntax](/reference/query-languages/query-dsl/regexp-syntax.md). The default pattern is the empty string, which produces one term containing the full input. This tokenizer should always be configured with a non-default pattern. diff --git a/docs/reference/data-analysis/text-analysis/analysis-word-delimiter-graph-tokenfilter.md b/docs/reference/data-analysis/text-analysis/analysis-word-delimiter-graph-tokenfilter.md index d6065203f237..a338c486a6f4 100644 --- a/docs/reference/data-analysis/text-analysis/analysis-word-delimiter-graph-tokenfilter.md +++ b/docs/reference/data-analysis/text-analysis/analysis-word-delimiter-graph-tokenfilter.md @@ -96,7 +96,7 @@ Setting this parameter to `true` produces multi-position tokens, which are not s If this parameter is `true`, avoid using this filter in an index analyzer or use the [`flatten_graph`](/reference/data-analysis/text-analysis/analysis-flatten-graph-tokenfilter.md) filter after this filter to make the token stream suitable for indexing. -When used for search analysis, catenated tokens can cause problems for the [`match_phrase`](/reference/query-languages/query-dsl-match-query-phrase.md) query and other queries that rely on token position for matching. Avoid setting this parameter to `true` if you plan to use these queries. +When used for search analysis, catenated tokens can cause problems for the [`match_phrase`](/reference/query-languages/query-dsl/query-dsl-match-query-phrase.md) query and other queries that rely on token position for matching. Avoid setting this parameter to `true` if you plan to use these queries. :::: @@ -112,7 +112,7 @@ Setting this parameter to `true` produces multi-position tokens, which are not s If this parameter is `true`, avoid using this filter in an index analyzer or use the [`flatten_graph`](/reference/data-analysis/text-analysis/analysis-flatten-graph-tokenfilter.md) filter after this filter to make the token stream suitable for indexing. -When used for search analysis, catenated tokens can cause problems for the [`match_phrase`](/reference/query-languages/query-dsl-match-query-phrase.md) query and other queries that rely on token position for matching. Avoid setting this parameter to `true` if you plan to use these queries. +When used for search analysis, catenated tokens can cause problems for the [`match_phrase`](/reference/query-languages/query-dsl/query-dsl-match-query-phrase.md) query and other queries that rely on token position for matching. Avoid setting this parameter to `true` if you plan to use these queries. :::: @@ -128,7 +128,7 @@ Setting this parameter to `true` produces multi-position tokens, which are not s If this parameter is `true`, avoid using this filter in an index analyzer or use the [`flatten_graph`](/reference/data-analysis/text-analysis/analysis-flatten-graph-tokenfilter.md) filter after this filter to make the token stream suitable for indexing. -When used for search analysis, catenated tokens can cause problems for the [`match_phrase`](/reference/query-languages/query-dsl-match-query-phrase.md) query and other queries that rely on token position for matching. Avoid setting this parameter to `true` if you plan to use these queries. +When used for search analysis, catenated tokens can cause problems for the [`match_phrase`](/reference/query-languages/query-dsl/query-dsl-match-query-phrase.md) query and other queries that rely on token position for matching. Avoid setting this parameter to `true` if you plan to use these queries. :::: @@ -275,7 +275,7 @@ However, only the `word_delimiter_graph` filter assigns multi-position tokens a The `word_delimiter` filter does not assign multi-position tokens a `positionLength` attribute. This means it produces invalid graphs for streams including these tokens. -While indexing does not support token graphs containing multi-position tokens, queries, such as the [`match_phrase`](/reference/query-languages/query-dsl-match-query-phrase.md) query, can use these graphs to generate multiple sub-queries from a single query string. +While indexing does not support token graphs containing multi-position tokens, queries, such as the [`match_phrase`](/reference/query-languages/query-dsl/query-dsl-match-query-phrase.md) query, can use these graphs to generate multiple sub-queries from a single query string. To see how token graphs produced by the `word_delimiter` and `word_delimiter_graph` filters differ, check out the following example. diff --git a/docs/reference/data-analysis/text-analysis/analysis-word-delimiter-tokenfilter.md b/docs/reference/data-analysis/text-analysis/analysis-word-delimiter-tokenfilter.md index 847d92b73d42..a0dde21422f8 100644 --- a/docs/reference/data-analysis/text-analysis/analysis-word-delimiter-tokenfilter.md +++ b/docs/reference/data-analysis/text-analysis/analysis-word-delimiter-tokenfilter.md @@ -86,7 +86,7 @@ Avoid using the `word_delimiter` filter with tokenizers that remove punctuation, : (Optional, Boolean) If `true`, the filter produces catenated tokens for chains of alphanumeric characters separated by non-alphabetic delimiters. For example: `super-duper-xl-500` → [ `super`, **`superduperxl500`**, `duper`, `xl`, `500` ]. Defaults to `false`. ::::{warning} -When used for search analysis, catenated tokens can cause problems for the [`match_phrase`](/reference/query-languages/query-dsl-match-query-phrase.md) query and other queries that rely on token position for matching. Avoid setting this parameter to `true` if you plan to use these queries. +When used for search analysis, catenated tokens can cause problems for the [`match_phrase`](/reference/query-languages/query-dsl/query-dsl-match-query-phrase.md) query and other queries that rely on token position for matching. Avoid setting this parameter to `true` if you plan to use these queries. :::: @@ -96,7 +96,7 @@ When used for search analysis, catenated tokens can cause problems for the [`mat : (Optional, Boolean) If `true`, the filter produces catenated tokens for chains of numeric characters separated by non-alphabetic delimiters. For example: `01-02-03` → [ `01`, **`010203`**, `02`, `03` ]. Defaults to `false`. ::::{warning} -When used for search analysis, catenated tokens can cause problems for the [`match_phrase`](/reference/query-languages/query-dsl-match-query-phrase.md) query and other queries that rely on token position for matching. Avoid setting this parameter to `true` if you plan to use these queries. +When used for search analysis, catenated tokens can cause problems for the [`match_phrase`](/reference/query-languages/query-dsl/query-dsl-match-query-phrase.md) query and other queries that rely on token position for matching. Avoid setting this parameter to `true` if you plan to use these queries. :::: @@ -106,7 +106,7 @@ When used for search analysis, catenated tokens can cause problems for the [`mat : (Optional, Boolean) If `true`, the filter produces catenated tokens for chains of alphabetical characters separated by non-alphabetic delimiters. For example: `super-duper-xl` → [ `super`, **`superduperxl`**, `duper`, `xl` ]. Defaults to `false`. ::::{warning} -When used for search analysis, catenated tokens can cause problems for the [`match_phrase`](/reference/query-languages/query-dsl-match-query-phrase.md) query and other queries that rely on token position for matching. Avoid setting this parameter to `true` if you plan to use these queries. +When used for search analysis, catenated tokens can cause problems for the [`match_phrase`](/reference/query-languages/query-dsl/query-dsl-match-query-phrase.md) query and other queries that rely on token position for matching. Avoid setting this parameter to `true` if you plan to use these queries. :::: diff --git a/docs/reference/elasticsearch-plugins/mapper-annotated-text-usage.md b/docs/reference/elasticsearch-plugins/mapper-annotated-text-usage.md index c67f5dd5280c..0170998d9a3c 100644 --- a/docs/reference/elasticsearch-plugins/mapper-annotated-text-usage.md +++ b/docs/reference/elasticsearch-plugins/mapper-annotated-text-usage.md @@ -172,7 +172,7 @@ Will become: ``` ::::{note} -Reordering text fields can have an effect on [phrase](/reference/query-languages/query-dsl-match-query-phrase.md) and [span](/reference/query-languages/span-queries.md) queries. See the discussion about [`position_increment_gap`](/reference/elasticsearch/mapping-reference/position-increment-gap.md) for more detail. You can avoid this by making sure the `slop` parameter on the phrase queries is lower than the `position_increment_gap`. This is the default. +Reordering text fields can have an effect on [phrase](/reference/query-languages/query-dsl/query-dsl-match-query-phrase.md) and [span](/reference/query-languages/query-dsl/span-queries.md) queries. See the discussion about [`position_increment_gap`](/reference/elasticsearch/mapping-reference/position-increment-gap.md) for more detail. You can avoid this by making sure the `slop` parameter on the phrase queries is lower than the `position_increment_gap`. This is the default. :::: diff --git a/docs/reference/elasticsearch/configuration-reference/circuit-breaker-settings.md b/docs/reference/elasticsearch/configuration-reference/circuit-breaker-settings.md index 7c5a593d178d..6c7c7b5f8ce7 100644 --- a/docs/reference/elasticsearch/configuration-reference/circuit-breaker-settings.md +++ b/docs/reference/elasticsearch/configuration-reference/circuit-breaker-settings.md @@ -115,9 +115,9 @@ $$$script-painless-regex-limit-factor$$$ ## EQL circuit breaker [circuit-breakers-page-eql] -When a [sequence](/reference/query-languages/eql-syntax.md#eql-sequences) query is executed, the node handling the query needs to keep some structures in memory, which are needed by the algorithm implementing the sequence matching. When large amounts of data need to be processed, and/or a large amount of matched sequences is requested by the user (by setting the [size](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-eql-search) query param), the memory occupied by those structures could potentially exceed the available memory of the JVM. This would cause an `OutOfMemory` exception which would bring down the node. +When a [sequence](/reference/query-languages/eql/eql-syntax.md#eql-sequences) query is executed, the node handling the query needs to keep some structures in memory, which are needed by the algorithm implementing the sequence matching. When large amounts of data need to be processed, and/or a large amount of matched sequences is requested by the user (by setting the [size](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-eql-search) query param), the memory occupied by those structures could potentially exceed the available memory of the JVM. This would cause an `OutOfMemory` exception which would bring down the node. -To prevent this from happening, a special circuit breaker is used, which limits the memory allocation during the execution of a [sequence](/reference/query-languages/eql-syntax.md#eql-sequences) query. When the breaker is triggered, an `org.elasticsearch.common.breaker.CircuitBreakingException` is thrown and a descriptive error message including `circuit_breaking_exception` is returned to the user. +To prevent this from happening, a special circuit breaker is used, which limits the memory allocation during the execution of a [sequence](/reference/query-languages/eql/eql-syntax.md#eql-sequences) query. When the breaker is triggered, an `org.elasticsearch.common.breaker.CircuitBreakingException` is thrown and a descriptive error message including `circuit_breaking_exception` is returned to the user. This circuit breaker can be configured using the following settings: diff --git a/docs/reference/elasticsearch/index-settings/index-modules.md b/docs/reference/elasticsearch/index-settings/index-modules.md index b09931395367..b0e92eb15388 100644 --- a/docs/reference/elasticsearch/index-settings/index-modules.md +++ b/docs/reference/elasticsearch/index-settings/index-modules.md @@ -97,7 +97,7 @@ $$$ccr-index-soft-deletes-retention-period$$$ : The maximum period to retain a shard history retention lease before it is considered expired. Shard history retention leases ensure that soft deletes are retained during merges on the Lucene index. If a soft delete is merged away before it can be replicated to a follower the following process will fail due to incomplete history on the leader. Defaults to `12h`. $$$load-fixed-bitset-filters-eagerly$$$ `index.load_fixed_bitset_filters_eagerly` -: Indicates whether [cached filters](/reference/query-languages/query-filter-context.md) are pre-loaded for nested queries. Possible values are `true` (default) and `false`. +: Indicates whether [cached filters](/reference/query-languages/query-dsl/query-filter-context.md) are pre-loaded for nested queries. Possible values are `true` (default) and `false`. $$$index-shard-check-on-startup$$$ `index.shard.check_on_startup` : :::::{admonition} @@ -210,12 +210,12 @@ $$$index-query-default-field$$$ `index.query.default_field` : (string or array of strings) Wildcard (`*`) patterns matching one or more fields. The following query types search these matching fields by default: -* [More like this](/reference/query-languages/query-dsl-mlt-query.md) -* [Multi-match](/reference/query-languages/query-dsl-multi-match-query.md) -* [Query string](/reference/query-languages/query-dsl-query-string-query.md) -* [Simple query string](/reference/query-languages/query-dsl-simple-query-string-query.md) +* [More like this](/reference/query-languages/query-dsl/query-dsl-mlt-query.md) +* [Multi-match](/reference/query-languages/query-dsl/query-dsl-multi-match-query.md) +* [Query string](/reference/query-languages/query-dsl/query-dsl-query-string-query.md) +* [Simple query string](/reference/query-languages/query-dsl/query-dsl-simple-query-string-query.md) -Defaults to `*`, which matches all fields eligible for [term-level queries](/reference/query-languages/term-level-queries.md), excluding metadata fields. +Defaults to `*`, which matches all fields eligible for [term-level queries](/reference/query-languages/query-dsl/term-level-queries.md), excluding metadata fields. $$$index-routing-allocation-enable-setting$$$ diff --git a/docs/reference/elasticsearch/mapping-reference/aggregate-metric-double.md b/docs/reference/elasticsearch/mapping-reference/aggregate-metric-double.md index 643f6d0b44f2..53dbbaf4bfdf 100644 --- a/docs/reference/elasticsearch/mapping-reference/aggregate-metric-double.md +++ b/docs/reference/elasticsearch/mapping-reference/aggregate-metric-double.md @@ -67,10 +67,10 @@ Running any other aggregation on an `aggregate_metric_double` field will fail wi Finally, an `aggregate_metric_double` field supports the following queries for which it behaves as a `double` by delegating its behavior to its `default_metric` sub-field: -* [`exists`](/reference/query-languages/query-dsl-exists-query.md) -* [`range`](/reference/query-languages/query-dsl-range-query.md) -* [`term`](/reference/query-languages/query-dsl-term-query.md) -* [`terms`](/reference/query-languages/query-dsl-terms-query.md) +* [`exists`](/reference/query-languages/query-dsl/query-dsl-exists-query.md) +* [`range`](/reference/query-languages/query-dsl/query-dsl-range-query.md) +* [`term`](/reference/query-languages/query-dsl/query-dsl-term-query.md) +* [`terms`](/reference/query-languages/query-dsl/query-dsl-terms-query.md) ## Examples [aggregate-metric-double-example] diff --git a/docs/reference/elasticsearch/mapping-reference/dense-vector.md b/docs/reference/elasticsearch/mapping-reference/dense-vector.md index ca7124679927..346355802562 100644 --- a/docs/reference/elasticsearch/mapping-reference/dense-vector.md +++ b/docs/reference/elasticsearch/mapping-reference/dense-vector.md @@ -51,7 +51,7 @@ Unlike most other data types, dense vectors are always single-valued. It is not A *k-nearest neighbor* (kNN) search finds the *k* nearest vectors to a query vector, as measured by a similarity metric. -Dense vector fields can be used to rank documents in [`script_score` queries](/reference/query-languages/query-dsl-script-score-query.md). This lets you perform a brute-force kNN search by scanning all documents and ranking them by similarity. +Dense vector fields can be used to rank documents in [`script_score` queries](/reference/query-languages/query-dsl/query-dsl-script-score-query.md). This lets you perform a brute-force kNN search by scanning all documents and ranking them by similarity. In many cases, a brute-force kNN search is not efficient enough. For this reason, the `dense_vector` type supports indexing vectors into a specialized data structure to support fast kNN retrieval through the [`knn` option](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search) in the search API @@ -215,7 +215,7 @@ $$$dense-vector-element-type$$$ : (Optional, integer) Number of vector dimensions. Can’t exceed `4096`. If `dims` is not specified, it will be set to the length of the first vector added to the field. `index` -: (Optional, Boolean) If `true`, you can search this field using the [knn query](/reference/query-languages/query-dsl-knn-query.md) or [knn in _search](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search) . Defaults to `true`. +: (Optional, Boolean) If `true`, you can search this field using the [knn query](/reference/query-languages/query-dsl/query-dsl-knn-query.md) or [knn in _search](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search) . Defaults to `true`. $$$dense-vector-similarity$$$ diff --git a/docs/reference/elasticsearch/mapping-reference/flattened.md b/docs/reference/elasticsearch/mapping-reference/flattened.md index 9c0002d23601..f9866ac3c348 100644 --- a/docs/reference/elasticsearch/mapping-reference/flattened.md +++ b/docs/reference/elasticsearch/mapping-reference/flattened.md @@ -228,7 +228,7 @@ The following mapping parameters are accepted: : Which scoring algorithm or *similarity* should be used. Defaults to `BM25`. `split_queries_on_whitespace` -: Whether [full text queries](/reference/query-languages/full-text-queries.md) should split the input on whitespace when building a query for this field. Accepts `true` or `false` (default). +: Whether [full text queries](/reference/query-languages/query-dsl/full-text-queries.md) should split the input on whitespace when building a query for this field. Accepts `true` or `false` (default). `time_series_dimensions` : (Optional, array of strings) A list of fields inside the flattened object, where each field is a dimension of the time series. Each field is specified using the relative path from the root field and does not include the root field name. diff --git a/docs/reference/elasticsearch/mapping-reference/geo-point.md b/docs/reference/elasticsearch/mapping-reference/geo-point.md index f683eb55d98a..0408eaea628a 100644 --- a/docs/reference/elasticsearch/mapping-reference/geo-point.md +++ b/docs/reference/elasticsearch/mapping-reference/geo-point.md @@ -9,11 +9,11 @@ mapped_pages: Fields of type `geo_point` accept latitude-longitude pairs, which can be used: -* to find geopoints within a [bounding box](/reference/query-languages/query-dsl-geo-bounding-box-query.md), within a certain [distance](/reference/query-languages/query-dsl-geo-distance-query.md) of a central point, or within a [`geo_shape` query](/reference/query-languages/query-dsl-geo-shape-query.md) (for example, points in a polygon). +* to find geopoints within a [bounding box](/reference/query-languages/query-dsl/query-dsl-geo-bounding-box-query.md), within a certain [distance](/reference/query-languages/query-dsl/query-dsl-geo-distance-query.md) of a central point, or within a [`geo_shape` query](/reference/query-languages/query-dsl/query-dsl-geo-shape-query.md) (for example, points in a polygon). * to aggregate documents by [distance](/reference/data-analysis/aggregations/search-aggregations-bucket-geodistance-aggregation.md) from a central point. * to aggregate documents by geographic grids: either [`geo_hash`](/reference/data-analysis/aggregations/search-aggregations-bucket-geohashgrid-aggregation.md), [`geo_tile`](/reference/data-analysis/aggregations/search-aggregations-bucket-geotilegrid-aggregation.md) or [`geo_hex`](/reference/data-analysis/aggregations/search-aggregations-bucket-geohexgrid-aggregation.md). * to aggregate geopoints into a track using the metrics aggregation [`geo_line`](/reference/data-analysis/aggregations/search-aggregations-metrics-geo-line.md). -* to integrate distance into a document’s [relevance score](/reference/query-languages/query-dsl-function-score-query.md). +* to integrate distance into a document’s [relevance score](/reference/query-languages/query-dsl/query-dsl-function-score-query.md). * to [sort](/reference/elasticsearch/rest-apis/sort-search-results.md#geo-sorting) documents by distance. As with [geo_shape](/reference/elasticsearch/mapping-reference/geo-shape.md) and [point](/reference/elasticsearch/mapping-reference/point.md), `geo_point` can be specified in [GeoJSON](http://geojson.org) and [Well-Known Text](https://docs.opengeospatial.org/is/12-063r5/12-063r5.html) formats. However, there are a number of additional formats that are supported for convenience and historical reasons. In total there are six ways that a geopoint may be specified, as demonstrated below: diff --git a/docs/reference/elasticsearch/mapping-reference/geo-shape.md b/docs/reference/elasticsearch/mapping-reference/geo-shape.md index 11301d518f18..20c55892333f 100644 --- a/docs/reference/elasticsearch/mapping-reference/geo-shape.md +++ b/docs/reference/elasticsearch/mapping-reference/geo-shape.md @@ -13,9 +13,9 @@ Documents using this type can be used: * to find geoshapes within: - * a [bounding box](/reference/query-languages/query-dsl-geo-bounding-box-query.md) - * a certain [distance](/reference/query-languages/query-dsl-geo-distance-query.md) of a central point - * a [`geo_shape` query](/reference/query-languages/query-dsl-geo-shape-query.md) (for example, intersecting polygons). + * a [bounding box](/reference/query-languages/query-dsl/query-dsl-geo-bounding-box-query.md) + * a certain [distance](/reference/query-languages/query-dsl/query-dsl-geo-distance-query.md) of a central point + * a [`geo_shape` query](/reference/query-languages/query-dsl/query-dsl-geo-shape-query.md) (for example, intersecting polygons). * to aggregate documents by geographic grids: diff --git a/docs/reference/elasticsearch/mapping-reference/histogram.md b/docs/reference/elasticsearch/mapping-reference/histogram.md index aa8ef606dd84..73b30b6deac0 100644 --- a/docs/reference/elasticsearch/mapping-reference/histogram.md +++ b/docs/reference/elasticsearch/mapping-reference/histogram.md @@ -37,7 +37,7 @@ Because the data is not indexed, you only can use `histogram` fields for the fol * [boxplot](/reference/data-analysis/aggregations/search-aggregations-metrics-boxplot-aggregation.md) aggregation * [histogram](/reference/data-analysis/aggregations/search-aggregations-bucket-histogram-aggregation.md#search-aggregations-bucket-histogram-aggregation-histogram-fields) aggregation * [range](/reference/data-analysis/aggregations/search-aggregations-bucket-range-aggregation.md#search-aggregations-bucket-range-aggregation-histogram-fields) aggregation -* [exists](/reference/query-languages/query-dsl-exists-query.md) query +* [exists](/reference/query-languages/query-dsl/query-dsl-exists-query.md) query ## Building a histogram [mapping-types-histogram-building-histogram] diff --git a/docs/reference/elasticsearch/mapping-reference/index-options.md b/docs/reference/elasticsearch/mapping-reference/index-options.md index 6ed04dd3c1d4..680955ff9831 100644 --- a/docs/reference/elasticsearch/mapping-reference/index-options.md +++ b/docs/reference/elasticsearch/mapping-reference/index-options.md @@ -16,7 +16,7 @@ The parameter accepts one of the following values. Each value retrieves informat : Doc number and term frequencies are indexed. Term frequencies are used to score repeated terms higher than single terms. `positions` (default) -: Doc number, term frequencies, and term positions (or order) are indexed. Positions can be used for [proximity or phrase queries](/reference/query-languages/query-dsl-match-query-phrase.md). +: Doc number, term frequencies, and term positions (or order) are indexed. Positions can be used for [proximity or phrase queries](/reference/query-languages/query-dsl/query-dsl-match-query-phrase.md). `offsets` : Doc number, term frequencies, positions, and start and end character offsets (which map the term back to the original string) are indexed. Offsets are used by the [unified highlighter](/reference/elasticsearch/rest-apis/highlighting.md#unified-highlighter) to speed up highlighting. diff --git a/docs/reference/elasticsearch/mapping-reference/ip.md b/docs/reference/elasticsearch/mapping-reference/ip.md index 68c5e57e1ef2..18d9c1b2ef2c 100644 --- a/docs/reference/elasticsearch/mapping-reference/ip.md +++ b/docs/reference/elasticsearch/mapping-reference/ip.md @@ -107,7 +107,7 @@ GET my-index-000001/_search } ``` -Also beware that colons are special characters to the [`query_string`](/reference/query-languages/query-dsl-query-string-query.md) query, so ipv6 addresses will need to be escaped. The easiest way to do so is to put quotes around the searched value: +Also beware that colons are special characters to the [`query_string`](/reference/query-languages/query-dsl/query-dsl-query-string-query.md) query, so ipv6 addresses will need to be escaped. The easiest way to do so is to put quotes around the searched value: ```console GET my-index-000001/_search diff --git a/docs/reference/elasticsearch/mapping-reference/keyword.md b/docs/reference/elasticsearch/mapping-reference/keyword.md index 7003c0fd784e..a45b93386156 100644 --- a/docs/reference/elasticsearch/mapping-reference/keyword.md +++ b/docs/reference/elasticsearch/mapping-reference/keyword.md @@ -13,7 +13,7 @@ The keyword family includes the following field types: * [`constant_keyword`](#constant-keyword-field-type) for keyword fields that always contain the same value. * [`wildcard`](#wildcard-field-type) for unstructured machine-generated content. The `wildcard` type is optimized for fields with large values or high cardinality. -Keyword fields are often used in [sorting](/reference/elasticsearch/rest-apis/sort-search-results.md), [aggregations](/reference/data-analysis/aggregations/index.md), and [term-level queries](/reference/query-languages/term-level-queries.md), such as [`term`](/reference/query-languages/query-dsl-term-query.md). +Keyword fields are often used in [sorting](/reference/elasticsearch/rest-apis/sort-search-results.md), [aggregations](/reference/data-analysis/aggregations/index.md), and [term-level queries](/reference/query-languages/query-dsl/term-level-queries.md), such as [`term`](/reference/query-languages/query-dsl/query-dsl-term-query.md). ::::{tip} Avoid using keyword fields for full-text search. Use the [`text`](/reference/elasticsearch/mapping-reference/text.md) field type instead. @@ -41,13 +41,13 @@ PUT my-index-000001 ::::{admonition} Mapping numeric identifiers :class: tip -Not all numeric data should be mapped as a [numeric](/reference/elasticsearch/mapping-reference/number.md) field data type. {{es}} optimizes numeric fields, such as `integer` or `long`, for [`range`](/reference/query-languages/query-dsl-range-query.md) queries. However, `keyword` fields are better for [`term`](/reference/query-languages/query-dsl-term-query.md) and other [term-level](/reference/query-languages/term-level-queries.md) queries. +Not all numeric data should be mapped as a [numeric](/reference/elasticsearch/mapping-reference/number.md) field data type. {{es}} optimizes numeric fields, such as `integer` or `long`, for [`range`](/reference/query-languages/query-dsl/query-dsl-range-query.md) queries. However, `keyword` fields are better for [`term`](/reference/query-languages/query-dsl/query-dsl-term-query.md) and other [term-level](/reference/query-languages/query-dsl/term-level-queries.md) queries. Identifiers, such as an ISBN or a product ID, are rarely used in `range` queries. However, they are often retrieved using term-level queries. Consider mapping a numeric identifier as a `keyword` if: -* You don’t plan to search for the identifier data using [`range`](/reference/query-languages/query-dsl-range-query.md) queries. +* You don’t plan to search for the identifier data using [`range`](/reference/query-languages/query-dsl/query-dsl-range-query.md) queries. * Fast retrieval is important. `term` query searches on `keyword` fields are often faster than `term` searches on numeric fields. If you’re unsure which to use, you can use a [multi-field](/reference/elasticsearch/mapping-reference/multi-fields.md) to map the data as both a `keyword` *and* a numeric data type. @@ -103,7 +103,7 @@ The following parameters are accepted by `keyword` fields: : How to pre-process the keyword prior to indexing. Defaults to `null`, meaning the keyword is kept as-is. `split_queries_on_whitespace` -: Whether [full text queries](/reference/query-languages/full-text-queries.md) should split the input on whitespace when building a query for this field. Accepts `true` or `false` (default). +: Whether [full text queries](/reference/query-languages/query-dsl/full-text-queries.md) should split the input on whitespace when building a query for this field. Accepts `true` or `false` (default). `time_series_dimension` : (Optional, Boolean) @@ -283,7 +283,7 @@ However providing a value that is different from the one configured in the mappi In case no `value` is provided in the mappings, the field will automatically configure itself based on the value contained in the first indexed document. While this behavior can be convenient, note that it means that a single poisonous document can cause all other documents to be rejected if it had a wrong value. -Before a value has been provided (either through the mappings or from a document), queries on the field will not match any documents. This includes [`exists`](/reference/query-languages/query-dsl-exists-query.md) queries. +Before a value has been provided (either through the mappings or from a document), queries on the field will not match any documents. This includes [`exists`](/reference/query-languages/query-dsl/query-dsl-exists-query.md) queries. The `value` of the field cannot be changed after it has been set. @@ -301,7 +301,7 @@ The following mapping parameters are accepted: ## Wildcard field type [wildcard-field-type] -The `wildcard` field type is a specialized keyword field for unstructured machine-generated content you plan to search using grep-like [`wildcard`](/reference/query-languages/query-dsl-wildcard-query.md) and [`regexp`](/reference/query-languages/query-dsl-regexp-query.md) queries. The `wildcard` type is optimized for fields with large values or high cardinality. +The `wildcard` field type is a specialized keyword field for unstructured machine-generated content you plan to search using grep-like [`wildcard`](/reference/query-languages/query-dsl/query-dsl-wildcard-query.md) and [`regexp`](/reference/query-languages/query-dsl/query-dsl-regexp-query.md) queries. The `wildcard` type is optimized for fields with large values or high cardinality. ::::{admonition} Mapping unstructured content :name: mapping-unstructured-content @@ -311,16 +311,16 @@ You can map a field containing unstructured content to either a `text` or keywor Use the `text` field type if: * The content is human-readable, such as an email body or product description. -* You plan to search the field for individual words or phrases, such as `the brown fox jumped`, using [full text queries](/reference/query-languages/full-text-queries.md). {{es}} [analyzes](docs-content://manage-data/data-store/text-analysis.md) `text` fields to return the most relevant results for these queries. +* You plan to search the field for individual words or phrases, such as `the brown fox jumped`, using [full text queries](/reference/query-languages/query-dsl/full-text-queries.md). {{es}} [analyzes](docs-content://manage-data/data-store/text-analysis.md) `text` fields to return the most relevant results for these queries. Use a keyword family field type if: * The content is machine-generated, such as a log message or HTTP request information. -* You plan to search the field for exact full values, such as `org.foo.bar`, or partial character sequences, such as `org.foo.*`, using [term-level queries](/reference/query-languages/term-level-queries.md). +* You plan to search the field for exact full values, such as `org.foo.bar`, or partial character sequences, such as `org.foo.*`, using [term-level queries](/reference/query-languages/query-dsl/term-level-queries.md). **Choosing a keyword family field type** -If you choose a keyword family field type, you can map the field as a `keyword` or `wildcard` field depending on the cardinality and size of the field’s values. Use the `wildcard` type if you plan to regularly search the field using a [`wildcard`](/reference/query-languages/query-dsl-wildcard-query.md) or [`regexp`](/reference/query-languages/query-dsl-regexp-query.md) query and meet one of the following criteria: +If you choose a keyword family field type, you can map the field as a `keyword` or `wildcard` field depending on the cardinality and size of the field’s values. Use the `wildcard` type if you plan to regularly search the field using a [`wildcard`](/reference/query-languages/query-dsl/query-dsl-wildcard-query.md) or [`regexp`](/reference/query-languages/query-dsl/query-dsl-regexp-query.md) query and meet one of the following criteria: * The field contains more than a million unique values.
AND
You plan to regularly search the field using a pattern with leading wildcards, such as `*foo` or `*baz`. * The field contains values larger than 32KB.
AND
You plan to regularly search the field using any wildcard pattern. @@ -329,7 +329,7 @@ Otherwise, use the `keyword` field type for faster searches, faster indexing, an **Switching from a `text` field to a keyword field** -If you previously used a `text` field to index unstructured machine-generated content, you can [reindex to update the mapping](docs-content://manage-data/data-store/mapping/explicit-mapping.md#update-mapping) to a `keyword` or `wildcard` field. We also recommend you update your application or workflow to replace any word-based [full text queries](/reference/query-languages/full-text-queries.md) on the field to equivalent [term-level queries](/reference/query-languages/term-level-queries.md). +If you previously used a `text` field to index unstructured machine-generated content, you can [reindex to update the mapping](docs-content://manage-data/data-store/mapping/explicit-mapping.md#update-mapping) to a `keyword` or `wildcard` field. We also recommend you update your application or workflow to replace any word-based [full text queries](/reference/query-languages/query-dsl/full-text-queries.md) on the field to equivalent [term-level queries](/reference/query-languages/query-dsl/term-level-queries.md). :::: diff --git a/docs/reference/elasticsearch/mapping-reference/mapping-field-names-field.md b/docs/reference/elasticsearch/mapping-reference/mapping-field-names-field.md index 915dbda92c3d..60a74e6d873b 100644 --- a/docs/reference/elasticsearch/mapping-reference/mapping-field-names-field.md +++ b/docs/reference/elasticsearch/mapping-reference/mapping-field-names-field.md @@ -5,9 +5,9 @@ mapped_pages: # _field_names field [mapping-field-names-field] -The `_field_names` field used to index the names of every field in a document that contains any value other than `null`. This field was used by the [`exists`](/reference/query-languages/query-dsl-exists-query.md) query to find documents that either have or don’t have any non-`null` value for a particular field. +The `_field_names` field used to index the names of every field in a document that contains any value other than `null`. This field was used by the [`exists`](/reference/query-languages/query-dsl/query-dsl-exists-query.md) query to find documents that either have or don’t have any non-`null` value for a particular field. -Now the `_field_names` field only indexes the names of fields that have `doc_values` and `norms` disabled. For fields which have either `doc_values` or `norm` enabled the [`exists`](/reference/query-languages/query-dsl-exists-query.md) query will still be available but will not use the `_field_names` field. +Now the `_field_names` field only indexes the names of fields that have `doc_values` and `norms` disabled. For fields which have either `doc_values` or `norm` enabled the [`exists`](/reference/query-languages/query-dsl/query-dsl-exists-query.md) query will still be available but will not use the `_field_names` field. ## Disabling `_field_names` [disable-field-names] diff --git a/docs/reference/elasticsearch/mapping-reference/mapping-id-field.md b/docs/reference/elasticsearch/mapping-reference/mapping-id-field.md index 3522bdc1682b..c8dbbb6a1d76 100644 --- a/docs/reference/elasticsearch/mapping-reference/mapping-id-field.md +++ b/docs/reference/elasticsearch/mapping-reference/mapping-id-field.md @@ -5,7 +5,7 @@ mapped_pages: # _id field [mapping-id-field] -Each document has an `_id` that uniquely identifies it, which is indexed so that documents can be looked up either with the [GET API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-get) or the [`ids` query](/reference/query-languages/query-dsl-ids-query.md). The `_id` can either be assigned at indexing time, or a unique `_id` can be generated by {{es}}. This field is not configurable in the mappings. +Each document has an `_id` that uniquely identifies it, which is indexed so that documents can be looked up either with the [GET API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-get) or the [`ids` query](/reference/query-languages/query-dsl/query-dsl-ids-query.md). The `_id` can either be assigned at indexing time, or a unique `_id` can be generated by {{es}}. This field is not configurable in the mappings. The value of the `_id` field is accessible in queries such as `term`, `terms`, `match`, and `query_string`. @@ -31,7 +31,7 @@ GET my-index-000001/_search } ``` -1. Querying on the `_id` field (also see the [`ids` query](/reference/query-languages/query-dsl-ids-query.md)) +1. Querying on the `_id` field (also see the [`ids` query](/reference/query-languages/query-dsl/query-dsl-ids-query.md)) The `_id` field is restricted from use in aggregations, sorting, and scripting. In case sorting or aggregating on the `_id` field is required, it is advised to duplicate the content of the `_id` field into another field that has `doc_values` enabled. diff --git a/docs/reference/elasticsearch/mapping-reference/mapping-ignored-field.md b/docs/reference/elasticsearch/mapping-reference/mapping-ignored-field.md index 5bdfe1533e1c..17411a2863e8 100644 --- a/docs/reference/elasticsearch/mapping-reference/mapping-ignored-field.md +++ b/docs/reference/elasticsearch/mapping-reference/mapping-ignored-field.md @@ -7,7 +7,7 @@ mapped_pages: The `_ignored` field indexes and stores the names of every field in a document that has been ignored when the document was indexed. This can, for example, be the case when the field was malformed and [`ignore_malformed`](/reference/elasticsearch/mapping-reference/ignore-malformed.md) was turned on, when a `keyword` field’s value exceeds its optional [`ignore_above`](/reference/elasticsearch/mapping-reference/ignore-above.md) setting, or when `index.mapping.total_fields.limit` has been reached and `index.mapping.total_fields.ignore_dynamic_beyond_limit` is set to `true`. For more index setting details, refer to [](/reference/elasticsearch/index-settings/mapping-limit.md). -This field is searchable with [`term`](/reference/query-languages/query-dsl-term-query.md), [`terms`](/reference/query-languages/query-dsl-terms-query.md) and [`exists`](/reference/query-languages/query-dsl-exists-query.md) queries, and is returned as part of the search hits. +This field is searchable with [`term`](/reference/query-languages/query-dsl/query-dsl-term-query.md), [`terms`](/reference/query-languages/query-dsl/query-dsl-terms-query.md) and [`exists`](/reference/query-languages/query-dsl/query-dsl-exists-query.md) queries, and is returned as part of the search hits. For instance the below query matches all documents that have one or more fields that got ignored: diff --git a/docs/reference/elasticsearch/mapping-reference/mapping-routing-field.md b/docs/reference/elasticsearch/mapping-reference/mapping-routing-field.md index 0f44ef5a279b..2c5dfc6c707d 100644 --- a/docs/reference/elasticsearch/mapping-reference/mapping-routing-field.md +++ b/docs/reference/elasticsearch/mapping-reference/mapping-routing-field.md @@ -41,7 +41,7 @@ GET my-index-000001/_search } ``` -1. Querying on the `_routing` field (also see the [`ids` query](/reference/query-languages/query-dsl-ids-query.md)) +1. Querying on the `_routing` field (also see the [`ids` query](/reference/query-languages/query-dsl/query-dsl-ids-query.md)) ::::{note} diff --git a/docs/reference/elasticsearch/mapping-reference/nested.md b/docs/reference/elasticsearch/mapping-reference/nested.md index 1d68765b7ebe..eb9cf59e9568 100644 --- a/docs/reference/elasticsearch/mapping-reference/nested.md +++ b/docs/reference/elasticsearch/mapping-reference/nested.md @@ -74,7 +74,7 @@ GET my-index-000001/_search If you need to index arrays of objects and to maintain the independence of each object in the array, use the `nested` data type instead of the [`object`](/reference/elasticsearch/mapping-reference/object.md) data type. -Internally, nested objects index each object in the array as a separate hidden document, meaning that each nested object can be queried independently of the others with the [`nested` query](/reference/query-languages/query-dsl-nested-query.md): +Internally, nested objects index each object in the array as a separate hidden document, meaning that each nested object can be queried independently of the others with the [`nested` query](/reference/query-languages/query-dsl/query-dsl-nested-query.md): ```console PUT my-index-000001 @@ -156,7 +156,7 @@ GET my-index-000001/_search Nested documents can be: -* queried with the [`nested`](/reference/query-languages/query-dsl-nested-query.md) query. +* queried with the [`nested`](/reference/query-languages/query-dsl/query-dsl-nested-query.md) query. * analyzed with the [`nested`](/reference/data-analysis/aggregations/search-aggregations-bucket-nested-aggregation.md) and [`reverse_nested`](/reference/data-analysis/aggregations/search-aggregations-bucket-reverse-nested-aggregation.md) aggregations. * sorted with [nested sorting](/reference/elasticsearch/rest-apis/sort-search-results.md#nested-sorting). * retrieved and highlighted with [nested inner hits](/reference/elasticsearch/rest-apis/retrieve-inner-hits.md#nested-inner-hits). diff --git a/docs/reference/elasticsearch/mapping-reference/normalizer.md b/docs/reference/elasticsearch/mapping-reference/normalizer.md index c231ea31ac6e..aa219956e9c5 100644 --- a/docs/reference/elasticsearch/mapping-reference/normalizer.md +++ b/docs/reference/elasticsearch/mapping-reference/normalizer.md @@ -7,7 +7,7 @@ mapped_pages: The `normalizer` property of [`keyword`](/reference/elasticsearch/mapping-reference/keyword.md) fields is similar to [`analyzer`](/reference/elasticsearch/mapping-reference/analyzer.md) except that it guarantees that the analysis chain produces a single token. -The `normalizer` is applied prior to indexing the keyword, as well as at search-time when the `keyword` field is searched via a query parser such as the [`match`](/reference/query-languages/query-dsl-match-query.md) query or via a term-level query such as the [`term`](/reference/query-languages/query-dsl-term-query.md) query. +The `normalizer` is applied prior to indexing the keyword, as well as at search-time when the `keyword` field is searched via a query parser such as the [`match`](/reference/query-languages/query-dsl/query-dsl-match-query.md) query or via a term-level query such as the [`term`](/reference/query-languages/query-dsl/query-dsl-term-query.md) query. A simple normalizer called `lowercase` ships with elasticsearch and can be used. Custom normalizers can be defined as part of analysis settings as follows. diff --git a/docs/reference/elasticsearch/mapping-reference/number.md b/docs/reference/elasticsearch/mapping-reference/number.md index d9ef86af21a8..79e8d9afed0a 100644 --- a/docs/reference/elasticsearch/mapping-reference/number.md +++ b/docs/reference/elasticsearch/mapping-reference/number.md @@ -82,13 +82,13 @@ $$$floating_point$$$ ::::{admonition} Mapping numeric identifiers :class: tip -Not all numeric data should be mapped as a `numeric` field data type. {{es}} optimizes numeric fields, such as `integer` or `long`, for [`range`](/reference/query-languages/query-dsl-range-query.md) queries. However, [`keyword`](/reference/elasticsearch/mapping-reference/keyword.md) fields are better for [`term`](/reference/query-languages/query-dsl-term-query.md) and other [term-level](/reference/query-languages/term-level-queries.md) queries. +Not all numeric data should be mapped as a `numeric` field data type. {{es}} optimizes numeric fields, such as `integer` or `long`, for [`range`](/reference/query-languages/query-dsl/query-dsl-range-query.md) queries. However, [`keyword`](/reference/elasticsearch/mapping-reference/keyword.md) fields are better for [`term`](/reference/query-languages/query-dsl/query-dsl-term-query.md) and other [term-level](/reference/query-languages/query-dsl/term-level-queries.md) queries. Identifiers, such as an ISBN or a product ID, are rarely used in `range` queries. However, they are often retrieved using term-level queries. Consider mapping a numeric identifier as a `keyword` if: -* You don’t plan to search for the identifier data using [`range`](/reference/query-languages/query-dsl-range-query.md) queries. +* You don’t plan to search for the identifier data using [`range`](/reference/query-languages/query-dsl/query-dsl-range-query.md) queries. * Fast retrieval is important. `term` query searches on `keyword` fields are often faster than `term` searches on numeric fields. If you’re unsure which to use, you can use a [multi-field](/reference/elasticsearch/mapping-reference/multi-fields.md) to map the data as both a `keyword` *and* a numeric data type. @@ -176,7 +176,7 @@ The following parameters are accepted by numeric types: `scaled_float` is stored as a single `long` value, which is the product of multiplying the original value by the scaling factor. If the multiplication results in a value that is outside the range of a `long`, the value is saturated to the minimum or maximum value of a `long`. For example, if the scaling factor is `100` and the value is `92233720368547758.08`, the expected value is `9223372036854775808`. However, the value that is stored is `9223372036854775807`, the maximum value for a `long`. -This can lead to unexpected results with [range queries](/reference/query-languages/query-dsl-range-query.md) when the scaling factor or provided `float` value are exceptionally large. +This can lead to unexpected results with [range queries](/reference/query-languages/query-dsl/query-dsl-range-query.md) when the scaling factor or provided `float` value are exceptionally large. ## Synthetic `_source` [numeric-synthetic-source] diff --git a/docs/reference/elasticsearch/mapping-reference/parent-join.md b/docs/reference/elasticsearch/mapping-reference/parent-join.md index 11f71147eeb2..4a555ca8b05b 100644 --- a/docs/reference/elasticsearch/mapping-reference/parent-join.md +++ b/docs/reference/elasticsearch/mapping-reference/parent-join.md @@ -243,9 +243,9 @@ Will return: ## Parent-join queries and aggregations [_parent_join_queries_and_aggregations] -See the [`has_child`](/reference/query-languages/query-dsl-has-child-query.md) and [`has_parent`](/reference/query-languages/query-dsl-has-parent-query.md) queries, the [`children`](/reference/data-analysis/aggregations/search-aggregations-bucket-children-aggregation.md) aggregation, and [inner hits](/reference/elasticsearch/rest-apis/retrieve-inner-hits.md#parent-child-inner-hits) for more information. +See the [`has_child`](/reference/query-languages/query-dsl/query-dsl-has-child-query.md) and [`has_parent`](/reference/query-languages/query-dsl/query-dsl-has-parent-query.md) queries, the [`children`](/reference/data-analysis/aggregations/search-aggregations-bucket-children-aggregation.md) aggregation, and [inner hits](/reference/elasticsearch/rest-apis/retrieve-inner-hits.md#parent-child-inner-hits) for more information. -The value of the `join` field is accessible in aggregations and scripts, and may be queried with the [`parent_id` query](/reference/query-languages/query-dsl-parent-id-query.md): +The value of the `join` field is accessible in aggregations and scripts, and may be queried with the [`parent_id` query](/reference/query-languages/query-dsl/query-dsl-parent-id-query.md): ```console GET my-index-000001/_search @@ -278,7 +278,7 @@ GET my-index-000001/_search } ``` -1. Querying the `parent id` field (also see the [`has_parent` query](/reference/query-languages/query-dsl-has-parent-query.md) and the [`has_child` query](/reference/query-languages/query-dsl-has-child-query.md)) +1. Querying the `parent id` field (also see the [`has_parent` query](/reference/query-languages/query-dsl/query-dsl-has-parent-query.md) and the [`has_child` query](/reference/query-languages/query-dsl/query-dsl-has-child-query.md)) 2. Aggregating on the `parent id` field (also see the [`children`](/reference/data-analysis/aggregations/search-aggregations-bucket-children-aggregation.md) aggregation) 3. Accessing the `parent id` field in scripts. diff --git a/docs/reference/elasticsearch/mapping-reference/percolator.md b/docs/reference/elasticsearch/mapping-reference/percolator.md index 0756c9b999cb..d2ccc61e690d 100644 --- a/docs/reference/elasticsearch/mapping-reference/percolator.md +++ b/docs/reference/elasticsearch/mapping-reference/percolator.md @@ -7,7 +7,7 @@ mapped_pages: # Percolator field type [percolator] -The `percolator` field type parses a json structure into a native query and stores that query, so that the [percolate query](/reference/query-languages/query-dsl-percolate-query.md) can use it to match provided documents. +The `percolator` field type parses a json structure into a native query and stores that query, so that the [percolate query](/reference/query-languages/query-dsl/query-dsl-percolate-query.md) can use it to match provided documents. Any field that contains a json object can be configured to be a percolator field. The percolator field type has no settings. Just configuring the `percolator` field type is sufficient to instruct Elasticsearch to treat a field as a query. diff --git a/docs/reference/elasticsearch/mapping-reference/point.md b/docs/reference/elasticsearch/mapping-reference/point.md index f8eba8738d6c..b5a6bfce8079 100644 --- a/docs/reference/elasticsearch/mapping-reference/point.md +++ b/docs/reference/elasticsearch/mapping-reference/point.md @@ -9,7 +9,7 @@ mapped_pages: The `point` data type facilitates the indexing of and searching arbitrary `x, y` pairs that fall in a 2-dimensional planar coordinate system. -You can query documents using this type using [shape Query](/reference/query-languages/query-dsl-shape-query.md). +You can query documents using this type using [shape Query](/reference/query-languages/query-dsl/query-dsl-shape-query.md). As with [geo_shape](/reference/elasticsearch/mapping-reference/geo-shape.md) and [geo_point](/reference/elasticsearch/mapping-reference/geo-point.md), `point` can be specified in [GeoJSON](http://geojson.org) and [Well-Known Text](https://docs.opengeospatial.org/is/12-063r5/12-063r5.html) formats. However, there are a number of additional formats that are supported for convenience and historical reasons. In total there are five ways that a cartesian point may be specified, as demonstrated below: diff --git a/docs/reference/elasticsearch/mapping-reference/position-increment-gap.md b/docs/reference/elasticsearch/mapping-reference/position-increment-gap.md index b76494d0289b..bbc828992b27 100644 --- a/docs/reference/elasticsearch/mapping-reference/position-increment-gap.md +++ b/docs/reference/elasticsearch/mapping-reference/position-increment-gap.md @@ -5,7 +5,7 @@ mapped_pages: # position_increment_gap [position-increment-gap] -[Analyzed](/reference/elasticsearch/mapping-reference/mapping-index.md) text fields take term [positions](/reference/elasticsearch/mapping-reference/index-options.md) into account, in order to be able to support [proximity or phrase queries](/reference/query-languages/query-dsl-match-query-phrase.md). When indexing text fields with multiple values a "fake" gap is added between the values to prevent most phrase queries from matching across the values. The size of this gap is configured using `position_increment_gap` and defaults to `100`. +[Analyzed](/reference/elasticsearch/mapping-reference/mapping-index.md) text fields take term [positions](/reference/elasticsearch/mapping-reference/index-options.md) into account, in order to be able to support [proximity or phrase queries](/reference/query-languages/query-dsl/query-dsl-match-query-phrase.md). When indexing text fields with multiple values a "fake" gap is added between the values to prevent most phrase queries from matching across the values. The size of this gap is configured using `position_increment_gap` and defaults to `100`. For example: diff --git a/docs/reference/elasticsearch/mapping-reference/range.md b/docs/reference/elasticsearch/mapping-reference/range.md index 7fbda52ea3ed..9dae0f5a4c16 100644 --- a/docs/reference/elasticsearch/mapping-reference/range.md +++ b/docs/reference/elasticsearch/mapping-reference/range.md @@ -68,7 +68,7 @@ PUT range_index/_doc/1?refresh 3. Example date range using date time stamp. -The following is an example of a [term query](/reference/query-languages/query-dsl-term-query.md) on the `integer_range` field named "expected_attendees". 12 is a value inside the range, so it will match. +The following is an example of a [term query](/reference/query-languages/query-dsl/query-dsl-term-query.md) on the `integer_range` field named "expected_attendees". 12 is a value inside the range, so it will match. ```console GET range_index/_search @@ -137,7 +137,7 @@ GET range_index/_search } ``` -1. Range queries work the same as described in [range query](/reference/query-languages/query-dsl-range-query.md). +1. Range queries work the same as described in [range query](/reference/query-languages/query-dsl/query-dsl-range-query.md). 2. Range queries over range [fields](/reference/elasticsearch/mapping-reference/field-data-types.md) support a `relation` parameter which can be one of `WITHIN`, `CONTAINS`, `INTERSECTS` (default). diff --git a/docs/reference/elasticsearch/mapping-reference/rank-feature.md b/docs/reference/elasticsearch/mapping-reference/rank-feature.md index 371dc3852b3e..7dd82bb31386 100644 --- a/docs/reference/elasticsearch/mapping-reference/rank-feature.md +++ b/docs/reference/elasticsearch/mapping-reference/rank-feature.md @@ -7,7 +7,7 @@ mapped_pages: # Rank feature field type [rank-feature] -A `rank_feature` field can index numbers so that they can later be used to boost documents in queries with a [`rank_feature`](/reference/query-languages/query-dsl-rank-feature-query.md) query. +A `rank_feature` field can index numbers so that they can later be used to boost documents in queries with a [`rank_feature`](/reference/query-languages/query-dsl/query-dsl-rank-feature-query.md) query. ```console PUT my-index-000001 @@ -51,7 +51,7 @@ GET my-index-000001/_search ::::{note} -`rank_feature` fields do not support querying, sorting or aggregating. They may only be used within [`rank_feature`](/reference/query-languages/query-dsl-rank-feature-query.md) queries. +`rank_feature` fields do not support querying, sorting or aggregating. They may only be used within [`rank_feature`](/reference/query-languages/query-dsl/query-dsl-rank-feature-query.md) queries. :::: @@ -60,5 +60,5 @@ GET my-index-000001/_search :::: -Rank features that correlate negatively with the score should set `positive_score_impact` to `false` (defaults to `true`). This will be used by the [`rank_feature`](/reference/query-languages/query-dsl-rank-feature-query.md) query to modify the scoring formula in such a way that the score decreases with the value of the feature instead of increasing. For instance in web search, the url length is a commonly used feature which correlates negatively with scores. +Rank features that correlate negatively with the score should set `positive_score_impact` to `false` (defaults to `true`). This will be used by the [`rank_feature`](/reference/query-languages/query-dsl/query-dsl-rank-feature-query.md) query to modify the scoring formula in such a way that the score decreases with the value of the feature instead of increasing. For instance in web search, the url length is a commonly used feature which correlates negatively with scores. diff --git a/docs/reference/elasticsearch/mapping-reference/rank-features.md b/docs/reference/elasticsearch/mapping-reference/rank-features.md index 3110a0337fca..fec8b3788902 100644 --- a/docs/reference/elasticsearch/mapping-reference/rank-features.md +++ b/docs/reference/elasticsearch/mapping-reference/rank-features.md @@ -7,7 +7,7 @@ mapped_pages: # Rank features field type [rank-features] -A `rank_features` field can index numeric feature vectors, so that they can later be used to boost documents in queries with a [`rank_feature`](/reference/query-languages/query-dsl-rank-feature-query.md) query. +A `rank_features` field can index numeric feature vectors, so that they can later be used to boost documents in queries with a [`rank_feature`](/reference/query-languages/query-dsl/query-dsl-rank-feature-query.md) query. It is analogous to the [`rank_feature`](/reference/elasticsearch/mapping-reference/rank-feature.md) data type but is better suited when the list of features is sparse so that it wouldn’t be reasonable to add one field to the mappings for each of them. @@ -93,12 +93,12 @@ GET my-index-000001/_search ::::{note} -`rank_features` fields do not support sorting or aggregating and may only be queried using [`rank_feature`](/reference/query-languages/query-dsl-rank-feature-query.md) or [`term`](/reference/query-languages/query-dsl-term-query.md) queries. +`rank_features` fields do not support sorting or aggregating and may only be queried using [`rank_feature`](/reference/query-languages/query-dsl/query-dsl-rank-feature-query.md) or [`term`](/reference/query-languages/query-dsl/query-dsl-term-query.md) queries. :::: ::::{note} -[`term`](/reference/query-languages/query-dsl-term-query.md) queries on `rank_features` fields are scored by multiplying the matched stored feature value by the provided `boost`. +[`term`](/reference/query-languages/query-dsl/query-dsl-term-query.md) queries on `rank_features` fields are scored by multiplying the matched stored feature value by the provided `boost`. :::: @@ -107,5 +107,5 @@ GET my-index-000001/_search :::: -Rank features that correlate negatively with the score should set `positive_score_impact` to `false` (defaults to `true`). This will be used by the [`rank_feature`](/reference/query-languages/query-dsl-rank-feature-query.md) query to modify the scoring formula in such a way that the score decreases with the value of the feature instead of increasing. +Rank features that correlate negatively with the score should set `positive_score_impact` to `false` (defaults to `true`). This will be used by the [`rank_feature`](/reference/query-languages/query-dsl/query-dsl-rank-feature-query.md) query to modify the scoring formula in such a way that the score decreases with the value of the feature instead of increasing. diff --git a/docs/reference/elasticsearch/mapping-reference/rank-vectors.md b/docs/reference/elasticsearch/mapping-reference/rank-vectors.md index 86e760d859db..f1db2e4d91b7 100644 --- a/docs/reference/elasticsearch/mapping-reference/rank-vectors.md +++ b/docs/reference/elasticsearch/mapping-reference/rank-vectors.md @@ -119,7 +119,7 @@ Synthetic `_source` is Generally Available only for TSDB indices (indices that h ## Scoring with rank vectors [rank-vectors-scoring] -Rank vectors can be accessed and used in [`script_score` queries](/reference/query-languages/query-dsl-script-score-query.md). +Rank vectors can be accessed and used in [`script_score` queries](/reference/query-languages/query-dsl/query-dsl-script-score-query.md). For example, the following query scores documents based on the maxSim similarity between the query vector and the vectors stored in the `my_vector` field: diff --git a/docs/reference/elasticsearch/mapping-reference/search-as-you-type.md b/docs/reference/elasticsearch/mapping-reference/search-as-you-type.md index 0a6e5efadb66..f389e3f8afb6 100644 --- a/docs/reference/elasticsearch/mapping-reference/search-as-you-type.md +++ b/docs/reference/elasticsearch/mapping-reference/search-as-you-type.md @@ -51,7 +51,7 @@ PUT my-index-000001/_doc/1?refresh } ``` -The most efficient way of querying to serve a search-as-you-type use case is usually a [`multi_match`](/reference/query-languages/query-dsl-multi-match-query.md) query of type [`bool_prefix`](/reference/query-languages/query-dsl-match-bool-prefix-query.md) that targets the root `search_as_you_type` field and its shingle subfields. This can match the query terms in any order, but will score documents higher if they contain the terms in order in a shingle subfield. +The most efficient way of querying to serve a search-as-you-type use case is usually a [`multi_match`](/reference/query-languages/query-dsl/query-dsl-multi-match-query.md) query of type [`bool_prefix`](/reference/query-languages/query-dsl/query-dsl-match-bool-prefix-query.md) that targets the root `search_as_you_type` field and its shingle subfields. This can match the query terms in any order, but will score documents higher if they contain the terms in order in a shingle subfield. ```console GET my-index-000001/_search @@ -115,7 +115,7 @@ GET my-index-000001/_search } ``` -To search for documents that strictly match the query terms in order, or to search using other properties of phrase queries, use a [`match_phrase_prefix` query](/reference/query-languages/query-dsl-match-query-phrase-prefix.md) on the root field. A [`match_phrase` query](/reference/query-languages/query-dsl-match-query-phrase.md) can also be used if the last term should be matched exactly, and not as a prefix. Using phrase queries may be less efficient than using the `match_bool_prefix` query. +To search for documents that strictly match the query terms in order, or to search using other properties of phrase queries, use a [`match_phrase_prefix` query](/reference/query-languages/query-dsl/query-dsl-match-query-phrase-prefix.md) on the root field. A [`match_phrase` query](/reference/query-languages/query-dsl/query-dsl-match-query-phrase.md) can also be used if the last term should be matched exactly, and not as a prefix. Using phrase queries may be less efficient than using the `match_bool_prefix` query. ```console GET my-index-000001/_search @@ -175,7 +175,7 @@ The following parameters are accepted in a mapping for the `search_as_you_type` ## Optimization of prefix queries [prefix-queries] -When making a [`prefix`](/reference/query-languages/query-dsl-prefix-query.md) query to the root field or any of its subfields, the query will be rewritten to a [`term`](/reference/query-languages/query-dsl-term-query.md) query on the `._index_prefix` subfield. This matches more efficiently than is typical of `prefix` queries on text fields, as prefixes up to a certain length of each shingle are indexed directly as terms in the `._index_prefix` subfield. +When making a [`prefix`](/reference/query-languages/query-dsl/query-dsl-prefix-query.md) query to the root field or any of its subfields, the query will be rewritten to a [`term`](/reference/query-languages/query-dsl/query-dsl-term-query.md) query on the `._index_prefix` subfield. This matches more efficiently than is typical of `prefix` queries on text fields, as prefixes up to a certain length of each shingle are indexed directly as terms in the `._index_prefix` subfield. The analyzer of the `._index_prefix` subfield slightly modifies the shingle-building behavior to also index prefixes of the terms at the end of the field’s value that normally would not be produced as shingles. For example, if the value `quick brown fox` is indexed into a `search_as_you_type` field with `max_shingle_size` of 3, prefixes for `brown fox` and `fox` are also indexed into the `._index_prefix` subfield even though they do not appear as terms in the `._3gram` subfield. This allows for completion of all the terms in the field’s input. diff --git a/docs/reference/elasticsearch/mapping-reference/semantic-text.md b/docs/reference/elasticsearch/mapping-reference/semantic-text.md index 5e38f2602935..8ca6a19c0d6a 100644 --- a/docs/reference/elasticsearch/mapping-reference/semantic-text.md +++ b/docs/reference/elasticsearch/mapping-reference/semantic-text.md @@ -14,7 +14,7 @@ This functionality is in beta and is subject to change. The design and code is l The `semantic_text` field type automatically generates embeddings for text content using an inference endpoint. Long passages are [automatically chunked](#auto-text-chunking) to smaller sections to enable the processing of larger corpuses of text. -The `semantic_text` field type specifies an inference endpoint identifier that will be used to generate embeddings. You can create the inference endpoint by using the [Create {{infer}} API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put). This field type and the [`semantic` query](/reference/query-languages/query-dsl-semantic-query.md) type make it simpler to perform semantic search on your data. The `semantic_text` field type may also be queried with [match](/reference/query-languages/query-dsl-match-query.md), [sparse_vector](/reference/query-languages/query-dsl-sparse-vector-query.md) or [knn](/reference/query-languages/query-dsl-knn-query.md) queries. +The `semantic_text` field type specifies an inference endpoint identifier that will be used to generate embeddings. You can create the inference endpoint by using the [Create {{infer}} API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put). This field type and the [`semantic` query](/reference/query-languages/query-dsl/query-dsl-semantic-query.md) type make it simpler to perform semantic search on your data. The `semantic_text` field type may also be queried with [match](/reference/query-languages/query-dsl/query-dsl-match-query.md), [sparse_vector](/reference/query-languages/query-dsl/query-dsl-sparse-vector-query.md) or [knn](/reference/query-languages/query-dsl/query-dsl-knn-query.md) queries. If you don’t specify an inference endpoint, the `inference_id` field defaults to `.elser-2-elasticsearch`, a preconfigured endpoint for the elasticsearch service. @@ -159,7 +159,7 @@ PUT test-index `semantic_text` uses defaults for indexing data based on the {{infer}} endpoint specified. It enables you to quickstart your semantic search by providing automatic {{infer}} and a dedicated query so you don’t need to provide further details. -In case you want to customize data indexing, use the [`sparse_vector`](/reference/elasticsearch/mapping-reference/sparse-vector.md) or [`dense_vector`](/reference/elasticsearch/mapping-reference/dense-vector.md) field types and create an ingest pipeline with an [{{infer}} processor](/reference/ingestion-tools/enrich-processor/inference-processor.md) to generate the embeddings. [This tutorial](docs-content://solutions/search/semantic-search/semantic-search-inference.md) walks you through the process. In these cases - when you use `sparse_vector` or `dense_vector` field types instead of the `semantic_text` field type to customize indexing - using the [`semantic_query`](/reference/query-languages/query-dsl-semantic-query.md) is not supported for querying the field data. +In case you want to customize data indexing, use the [`sparse_vector`](/reference/elasticsearch/mapping-reference/sparse-vector.md) or [`dense_vector`](/reference/elasticsearch/mapping-reference/dense-vector.md) field types and create an ingest pipeline with an [{{infer}} processor](/reference/ingestion-tools/enrich-processor/inference-processor.md) to generate the embeddings. [This tutorial](docs-content://solutions/search/semantic-search/semantic-search-inference.md) walks you through the process. In these cases - when you use `sparse_vector` or `dense_vector` field types instead of the `semantic_text` field type to customize indexing - using the [`semantic_query`](/reference/query-languages/query-dsl/query-dsl-semantic-query.md) is not supported for querying the field data. ## Updates to `semantic_text` fields [update-script] diff --git a/docs/reference/elasticsearch/mapping-reference/shape.md b/docs/reference/elasticsearch/mapping-reference/shape.md index 3f209ac8c085..e42e7b2966f6 100644 --- a/docs/reference/elasticsearch/mapping-reference/shape.md +++ b/docs/reference/elasticsearch/mapping-reference/shape.md @@ -9,7 +9,7 @@ mapped_pages: The `shape` data type facilitates the indexing of and searching with arbitrary `x, y` cartesian shapes such as rectangles and polygons. It can be used to index and query geometries whose coordinates fall in a 2-dimensional planar coordinate system. -You can query documents using this type using [shape Query](/reference/query-languages/query-dsl-shape-query.md). +You can query documents using this type using [shape Query](/reference/query-languages/query-dsl/query-dsl-shape-query.md). ## Mapping Options [shape-mapping-options] diff --git a/docs/reference/elasticsearch/mapping-reference/sparse-vector.md b/docs/reference/elasticsearch/mapping-reference/sparse-vector.md index ab8df53fce89..f8bfe6931060 100644 --- a/docs/reference/elasticsearch/mapping-reference/sparse-vector.md +++ b/docs/reference/elasticsearch/mapping-reference/sparse-vector.md @@ -7,7 +7,7 @@ mapped_pages: # Sparse vector field type [sparse-vector] -A `sparse_vector` field can index features and weights so that they can later be used to query documents in queries with a [`sparse_vector`](/reference/query-languages/query-dsl-sparse-vector-query.md). This field can also be used with a legacy [`text_expansion`](/reference/query-languages/query-dsl-text-expansion-query.md) query. +A `sparse_vector` field can index features and weights so that they can later be used to query documents in queries with a [`sparse_vector`](/reference/query-languages/query-dsl/query-dsl-sparse-vector-query.md). This field can also be used with a legacy [`text_expansion`](/reference/query-languages/query-dsl/query-dsl-text-expansion-query.md) query. `sparse_vector` is the field type that should be used with [ELSER mappings](docs-content://solutions/search/semantic-search/semantic-search-elser-ingest-pipelines.md#elser-mappings). @@ -102,7 +102,7 @@ GET my-index-000001/_search ::::{note} -`sparse_vector` fields do not support [analyzers](docs-content://manage-data/data-store/text-analysis.md), querying, sorting or aggregating. They may only be used within specialized queries. The recommended query to use on these fields are [`sparse_vector`](/reference/query-languages/query-dsl-sparse-vector-query.md) queries. They may also be used within legacy [`text_expansion`](/reference/query-languages/query-dsl-text-expansion-query.md) queries. +`sparse_vector` fields do not support [analyzers](docs-content://manage-data/data-store/text-analysis.md), querying, sorting or aggregating. They may only be used within specialized queries. The recommended query to use on these fields are [`sparse_vector`](/reference/query-languages/query-dsl/query-dsl-sparse-vector-query.md) queries. They may also be used within legacy [`text_expansion`](/reference/query-languages/query-dsl/query-dsl-text-expansion-query.md) queries. :::: diff --git a/docs/reference/elasticsearch/mapping-reference/text.md b/docs/reference/elasticsearch/mapping-reference/text.md index d396c6c26af4..f2cbca678c86 100644 --- a/docs/reference/elasticsearch/mapping-reference/text.md +++ b/docs/reference/elasticsearch/mapping-reference/text.md @@ -157,7 +157,7 @@ Will become: ``` ::::{note} -Reordering text fields can have an effect on [phrase](/reference/query-languages/query-dsl-match-query-phrase.md) and [span](/reference/query-languages/span-queries.md) queries. See the discussion about [`position_increment_gap`](/reference/elasticsearch/mapping-reference/position-increment-gap.md) for more detail. You can avoid this by making sure the `slop` parameter on the phrase queries is lower than the `position_increment_gap`. This is the default. +Reordering text fields can have an effect on [phrase](/reference/query-languages/query-dsl/query-dsl-match-query-phrase.md) and [span](/reference/query-languages/query-dsl/span-queries.md) queries. See the discussion about [`position_increment_gap`](/reference/elasticsearch/mapping-reference/position-increment-gap.md) for more detail. You can avoid this by making sure the `slop` parameter on the phrase queries is lower than the `position_increment_gap`. This is the default. :::: @@ -297,11 +297,11 @@ PUT my-index-000001 ## Match-only text field type [match-only-text-field-type] -A variant of [`text`](#text-field-type) that trades scoring and efficiency of positional queries for space efficiency. This field effectively stores data the same way as a `text` field that only indexes documents (`index_options: docs`) and disables norms (`norms: false`). Term queries perform as fast if not faster as on `text` fields, however queries that need positions such as the [`match_phrase` query](/reference/query-languages/query-dsl-match-query-phrase.md) perform slower as they need to look at the `_source` document to verify whether a phrase matches. All queries return constant scores that are equal to 1.0. +A variant of [`text`](#text-field-type) that trades scoring and efficiency of positional queries for space efficiency. This field effectively stores data the same way as a `text` field that only indexes documents (`index_options: docs`) and disables norms (`norms: false`). Term queries perform as fast if not faster as on `text` fields, however queries that need positions such as the [`match_phrase` query](/reference/query-languages/query-dsl/query-dsl-match-query-phrase.md) perform slower as they need to look at the `_source` document to verify whether a phrase matches. All queries return constant scores that are equal to 1.0. Analysis is not configurable: text is always analyzed with the [default analyzer](docs-content://manage-data/data-store/text-analysis/specify-an-analyzer.md#specify-index-time-default-analyzer) ([`standard`](/reference/data-analysis/text-analysis/analysis-standard-analyzer.md) by default). -[span queries](/reference/query-languages/span-queries.md) are not supported with this field, use [interval queries](/reference/query-languages/query-dsl-intervals-query.md) instead, or the [`text`](#text-field-type) field type if you absolutely need span queries. +[span queries](/reference/query-languages/query-dsl/span-queries.md) are not supported with this field, use [interval queries](/reference/query-languages/query-dsl/query-dsl-intervals-query.md) instead, or the [`text`](#text-field-type) field type if you absolutely need span queries. Other than that, `match_only_text` supports the same queries as `text`. And like `text`, it does not support sorting and has only limited support for aggregations. diff --git a/docs/reference/elasticsearch/rest-apis/api-conventions.md b/docs/reference/elasticsearch/rest-apis/api-conventions.md index df8a58b84509..df262a5a7e90 100644 --- a/docs/reference/elasticsearch/rest-apis/api-conventions.md +++ b/docs/reference/elasticsearch/rest-apis/api-conventions.md @@ -466,7 +466,7 @@ Whenever the byte size of data needs to be specified, e.g. when setting a buffer ## Distance Units [distance-units] -Wherever distances need to be specified, such as the `distance` parameter in the [Geo-distance](/reference/query-languages/query-dsl-geo-distance-query.md)), the default unit is meters if none is specified. Distances can be specified in other units, such as `"1km"` or `"2mi"` (2 miles). +Wherever distances need to be specified, such as the `distance` parameter in the [Geo-distance](/reference/query-languages/query-dsl/query-dsl-geo-distance-query.md)), the default unit is meters if none is specified. Distances can be specified in other units, such as `"1km"` or `"2mi"` (2 miles). The full list of units is listed below: diff --git a/docs/reference/elasticsearch/rest-apis/common-options.md b/docs/reference/elasticsearch/rest-apis/common-options.md index 2781cd202a70..10bf42291ea7 100644 --- a/docs/reference/elasticsearch/rest-apis/common-options.md +++ b/docs/reference/elasticsearch/rest-apis/common-options.md @@ -23,7 +23,7 @@ Statistics are returned in a format suitable for humans (e.g. `"exists_time": "1 ## Date Math [date-math] -Most parameters which accept a formatted date value — such as `gt` and `lt` in [`range` queries](/reference/query-languages/query-dsl-range-query.md), or `from` and `to` in [`daterange` aggregations](/reference/data-analysis/aggregations/search-aggregations-bucket-daterange-aggregation.md) — understand date maths. +Most parameters which accept a formatted date value — such as `gt` and `lt` in [`range` queries](/reference/query-languages/query-dsl/query-dsl-range-query.md), or `from` and `to` in [`daterange` aggregations](/reference/data-analysis/aggregations/search-aggregations-bucket-daterange-aggregation.md) — understand date maths. The expression starts with an anchor date, which can either be `now`, or a date string ending with `||`. This anchor date can optionally be followed by one or more maths expressions: diff --git a/docs/reference/elasticsearch/rest-apis/filter-search-results.md b/docs/reference/elasticsearch/rest-apis/filter-search-results.md index da71e9942f10..2d5adeb87696 100644 --- a/docs/reference/elasticsearch/rest-apis/filter-search-results.md +++ b/docs/reference/elasticsearch/rest-apis/filter-search-results.md @@ -9,7 +9,7 @@ applies_to: You can use two methods to filter search results: -* Use a boolean query with a `filter` clause. Search requests apply [boolean filters](/reference/query-languages/query-dsl-bool-query.md) to both search hits and [aggregations](/reference/data-analysis/aggregations/index.md). +* Use a boolean query with a `filter` clause. Search requests apply [boolean filters](/reference/query-languages/query-dsl/query-dsl-bool-query.md) to both search hits and [aggregations](/reference/data-analysis/aggregations/index.md). * Use the search API’s `post_filter` parameter. Search requests apply [post filters](#post-filter) only to search hits, not aggregations. You can use a post filter to calculate aggregations based on a broader result set, and then further narrow the results. You can also [rescore](#rescore) hits after the post filter to improve relevance and reorder results. @@ -44,7 +44,7 @@ PUT /shirts/_doc/1?refresh Imagine a user has specified two filters: -`color:red` and `brand:gucci`. You only want to show them red shirts made by Gucci in the search results. Normally you would do this with a [`bool` query](/reference/query-languages/query-dsl-bool-query.md): +`color:red` and `brand:gucci`. You only want to show them red shirts made by Gucci in the search results. Normally you would do this with a [`bool` query](/reference/query-languages/query-dsl/query-dsl-bool-query.md): ```console GET /shirts/_search @@ -189,7 +189,7 @@ The way the scores are combined can be controlled with the `score_mode`: | Score Mode | Description | | --- | --- | | `total` | Add the original score and the rescore query score. The default. | -| `multiply` | Multiply the original score by the rescore query score. Usefulfor [`function query`](/reference/query-languages/query-dsl-function-score-query.md) rescores. | +| `multiply` | Multiply the original score by the rescore query score. Usefulfor [`function query`](/reference/query-languages/query-dsl/query-dsl-function-score-query.md) rescores. | | `avg` | Average the original score and the rescore query score. | | `max` | Take the max of original score and the rescore query score. | | `min` | Take the min of the original score and the rescore query score. | diff --git a/docs/reference/elasticsearch/rest-apis/reciprocal-rank-fusion.md b/docs/reference/elasticsearch/rest-apis/reciprocal-rank-fusion.md index 492317090e41..034dc76616ee 100644 --- a/docs/reference/elasticsearch/rest-apis/reciprocal-rank-fusion.md +++ b/docs/reference/elasticsearch/rest-apis/reciprocal-rank-fusion.md @@ -539,7 +539,7 @@ In addition to individual query scoring details, we can make use of the `explain 6. the `value` heres specifies the `rank` of this document for the second (`knn`) query -In addition to the above, explain in RRF also supports [named queries](/reference/query-languages/query-dsl-bool-query.md#named-queries) using the `_name` parameter. Using named queries allows for easier and more intuitive understanding of the RRF score computation, especially when dealing with multiple queries. So, we would now have: +In addition to the above, explain in RRF also supports [named queries](/reference/query-languages/query-dsl/query-dsl-bool-query.md#named-queries) using the `_name` parameter. Using named queries allows for easier and more intuitive understanding of the RRF score computation, especially when dealing with multiple queries. So, we would now have: ```js GET example-index/_search diff --git a/docs/reference/elasticsearch/rest-apis/retrievers.md b/docs/reference/elasticsearch/rest-apis/retrievers.md index 14c413a7832e..c65420a17956 100644 --- a/docs/reference/elasticsearch/rest-apis/retrievers.md +++ b/docs/reference/elasticsearch/rest-apis/retrievers.md @@ -60,7 +60,7 @@ A standard retriever returns top documents from a traditional [query](/reference `filter` : (Optional, [query object or list of query objects](/reference/query-languages/querydsl.md)) - Applies a [boolean query filter](/reference/query-languages/query-dsl-bool-query.md) to this retriever, where all documents must match this query but do not contribute to the score. + Applies a [boolean query filter](/reference/query-languages/query-dsl/query-dsl-bool-query.md) to this retriever, where all documents must match this query but do not contribute to the score. `search_after` @@ -84,7 +84,7 @@ A standard retriever returns top documents from a traditional [query](/reference `min_score` : (Optional, `float`) - Minimum [`_score`](/reference/query-languages/query-filter-context.md#relevance-scores) for matching documents. Documents with a lower `_score` are not included in the top documents. + Minimum [`_score`](/reference/query-languages/query-dsl/query-filter-context.md#relevance-scores) for matching documents. Documents with a lower `_score` are not included in the top documents. `collapse` @@ -294,7 +294,7 @@ See also [this hybrid search example](docs-content://solutions/search/retrievers `filter` : (Optional, [query object or list of query objects](/reference/query-languages/querydsl.md)) - Applies the specified [boolean query filter](/reference/query-languages/query-dsl-bool-query.md) to all of the specified sub-retrievers, according to each retriever’s specifications. + Applies the specified [boolean query filter](/reference/query-languages/query-dsl/query-dsl-bool-query.md) to all of the specified sub-retrievers, according to each retriever’s specifications. @@ -326,7 +326,7 @@ An [RRF](/reference/elasticsearch/rest-apis/reciprocal-rank-fusion.md) retriever `filter` : (Optional, [query object or list of query objects](/reference/query-languages/querydsl.md)) - Applies the specified [boolean query filter](/reference/query-languages/query-dsl-bool-query.md) to all of the specified sub-retrievers, according to each retriever’s specifications. + Applies the specified [boolean query filter](/reference/query-languages/query-dsl/query-dsl-bool-query.md) to all of the specified sub-retrievers, according to each retriever’s specifications. @@ -463,7 +463,7 @@ When using the `rescorer`, an error is returned if the following conditions are `filter` : (Optional. [query object or list of query objects](/reference/query-languages/querydsl.md)) - Applies a [boolean query filter](/reference/query-languages/query-dsl-bool-query.md) to the retriever, ensuring that all documents match the filter criteria without affecting their scores. + Applies a [boolean query filter](/reference/query-languages/query-dsl/query-dsl-bool-query.md) to the retriever, ensuring that all documents match the filter criteria without affecting their scores. @@ -632,7 +632,7 @@ score = ln(score), if score < 0 `filter` : (Optional, [query object or list of query objects](/reference/query-languages/querydsl.md)) - Applies the specified [boolean query filter](/reference/query-languages/query-dsl-bool-query.md) to the child `retriever`. If the child retriever already specifies any filters, then this top-level filter is applied in conjuction with the filter defined in the child retriever. + Applies the specified [boolean query filter](/reference/query-languages/query-dsl/query-dsl-bool-query.md) to the child `retriever`. If the child retriever already specifies any filters, then this top-level filter is applied in conjuction with the filter defined in the child retriever. @@ -800,7 +800,7 @@ Follow these steps to load the model and create a semantic re-ranker. ## Query Rules Retriever [rule-retriever] -The `rule` retriever enables fine-grained control over search results by applying contextual [query rules](/reference/elasticsearch/rest-apis/searching-with-query-rules.md#query-rules) to pin or exclude documents for specific queries. This retriever has similar functionality to the [rule query](/reference/query-languages/query-dsl-rule-query.md), but works out of the box with other retrievers. +The `rule` retriever enables fine-grained control over search results by applying contextual [query rules](/reference/elasticsearch/rest-apis/searching-with-query-rules.md#query-rules) to pin or exclude documents for specific queries. This retriever has similar functionality to the [rule query](/reference/query-languages/query-dsl/query-dsl-rule-query.md), but works out of the box with other retrievers. ### Prerequisites [_prerequisites_16] @@ -929,7 +929,7 @@ The [`from`](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operati ### Using aggregations with a retriever tree [retriever-aggregations] -[Aggregations](/reference/data-analysis/aggregations/index.md) are globally specified as part of a search request. The query used for an aggregation is the combination of all leaf retrievers as `should` clauses in a [boolean query](/reference/query-languages/query-dsl-bool-query.md). +[Aggregations](/reference/data-analysis/aggregations/index.md) are globally specified as part of a search request. The query used for an aggregation is the combination of all leaf retrievers as `should` clauses in a [boolean query](/reference/query-languages/query-dsl/query-dsl-bool-query.md). ### Restrictions on search parameters when specifying a retriever [retriever-restrictions] diff --git a/docs/reference/elasticsearch/rest-apis/search-suggesters.md b/docs/reference/elasticsearch/rest-apis/search-suggesters.md index e3dd525443fb..1a39320b573b 100644 --- a/docs/reference/elasticsearch/rest-apis/search-suggesters.md +++ b/docs/reference/elasticsearch/rest-apis/search-suggesters.md @@ -782,7 +782,7 @@ POST music/_search?pretty The regex query can take specific regex parameters. For example: `flags` -: Possible flags are `ALL` (default), `ANYSTRING`, `COMPLEMENT`, `EMPTY`, `INTERSECTION`, `INTERVAL`, or `NONE`. See [regexp-syntax](/reference/query-languages/query-dsl-regexp-query.md) for their meaning +: Possible flags are `ALL` (default), `ANYSTRING`, `COMPLEMENT`, `EMPTY`, `INTERSECTION`, `INTERVAL`, or `NONE`. See [regexp-syntax](/reference/query-languages/query-dsl/query-dsl-regexp-query.md) for their meaning `max_determinized_states` : Regular expressions are dangerous because it's easy to accidentally create an innocuous looking one that requires an exponential number of internal determinized automaton states (and corresponding RAM and CPU) for Lucene to execute. Lucene prevents these using the `max_determinized_states` setting (defaults to 10000). You can raise this limit to allow more complex regular expressions to execute. diff --git a/docs/reference/elasticsearch/rest-apis/searching-with-query-rules.md b/docs/reference/elasticsearch/rest-apis/searching-with-query-rules.md index 47fb38c513c4..37a97495d5c9 100644 --- a/docs/reference/elasticsearch/rest-apis/searching-with-query-rules.md +++ b/docs/reference/elasticsearch/rest-apis/searching-with-query-rules.md @@ -24,7 +24,7 @@ When a query rule matches the rule metadata according to its defined criteria, t For example, a query rule could be defined to match a user-entered query string of `pugs` and a country `us` and promote adoptable shelter dogs if the rule query met both criteria. -Rules are defined using the [query rules API](https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-query_rules) and searched using the [rule retriever](/reference/elasticsearch/rest-apis/retrievers.md#rule-retriever) or the [rule query](/reference/query-languages/query-dsl-rule-query.md). +Rules are defined using the [query rules API](https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-query_rules) and searched using the [rule retriever](/reference/elasticsearch/rest-apis/retrievers.md#rule-retriever) or the [rule query](/reference/query-languages/query-dsl/query-dsl-rule-query.md). ## Rule definition [query-rule-definition] @@ -36,7 +36,7 @@ When defining a rule, consider the following: The type of rule we want to apply. We support the following rule types: -* `pinned` will re-write the query into a [pinned query](/reference/query-languages/query-dsl-pinned-query.md), pinning specified results matching the query rule at the top of the returned result set. +* `pinned` will re-write the query into a [pinned query](/reference/query-languages/query-dsl/query-dsl-pinned-query.md), pinning specified results matching the query rule at the top of the returned result set. * `exclude` will exclude specified results from the returned result set. @@ -74,7 +74,7 @@ You can add query rules using the [Create or update query ruleset](https://www.e The following command will create a query ruleset called `my-ruleset` with two query rules: -* The first rule will generate a [Pinned Query](/reference/query-languages/query-dsl-pinned-query.md) pinning the [`_id`](/reference/elasticsearch/mapping-reference/mapping-id-field.md)s `id1` and `id2` when the `query_string` metadata value is a fuzzy match to either `puggles` or `pugs` *and* the user’s location is in the US. +* The first rule will generate a [Pinned Query](/reference/query-languages/query-dsl/query-dsl-pinned-query.md) pinning the [`_id`](/reference/elasticsearch/mapping-reference/mapping-id-field.md)s `id1` and `id2` when the `query_string` metadata value is a fuzzy match to either `puggles` or `pugs` *and* the user’s location is in the US. * The second rule will generate a query that excludes the [`_id`](/reference/elasticsearch/mapping-reference/mapping-id-field.md) `id3` specifically from the `my-index-000001` index and `id4` from the `my-index-000002` index when the `query_string` metadata value contains `beagles`. ```console @@ -148,7 +148,7 @@ You can use the [Get query ruleset](https://www.elastic.co/docs/api/doc/elastics ## Search using query rules [rule-query-search] -Once you have defined one or more query rulesets, you can search using these rulesets using the [rule retriever](/reference/elasticsearch/rest-apis/retrievers.md#rule-retriever) or the [rule query](/reference/query-languages/query-dsl-rule-query.md). Retrievers are the recommended way to use rule queries, as they will work out of the box with other reranking retrievers such as [Reciprocal rank fusion](/reference/elasticsearch/rest-apis/reciprocal-rank-fusion.md). +Once you have defined one or more query rulesets, you can search using these rulesets using the [rule retriever](/reference/elasticsearch/rest-apis/retrievers.md#rule-retriever) or the [rule query](/reference/query-languages/query-dsl/query-dsl-rule-query.md). Retrievers are the recommended way to use rule queries, as they will work out of the box with other reranking retrievers such as [Reciprocal rank fusion](/reference/elasticsearch/rest-apis/reciprocal-rank-fusion.md). Rulesets are evaluated in order, so rules in the first ruleset you specify will be applied before any subsequent rulesets. @@ -180,7 +180,7 @@ GET /my-index-000001/_search This rule query will match against `rule1` in the defined query ruleset, and will convert the organic query into a pinned query with `id1` and `id2` pinned as the top hits. Any other matches from the organic query will be returned below the pinned results. -It’s possible to have multiple rules in a ruleset match a single [rule query](/reference/query-languages/query-dsl-rule-query.md). In this case, the rules are applied in the following order: +It’s possible to have multiple rules in a ruleset match a single [rule query](/reference/query-languages/query-dsl/query-dsl-rule-query.md). In this case, the rules are applied in the following order: * Where the matching rule appears in the ruleset * If multiple documents are specified in a single rule, in the order they are specified diff --git a/docs/reference/ingestion-tools/enrich-processor/enrich-processor.md b/docs/reference/ingestion-tools/enrich-processor/enrich-processor.md index f9289a01d66f..cbe00881691b 100644 --- a/docs/reference/ingestion-tools/enrich-processor/enrich-processor.md +++ b/docs/reference/ingestion-tools/enrich-processor/enrich-processor.md @@ -19,7 +19,7 @@ $$$enrich-options$$$ | `ignore_missing` | no | false | If `true` and `field` does not exist, the processor quietly exits without modifying the document | | `override` | no | true | If processor will update fields with pre-existing non-null-valued field. When set to `false`, such fields will not be touched. | | `max_matches` | no | 1 | The maximum number of matched documents to include under the configured target field. The `target_field` will be turned into a json array if `max_matches` is higher than 1, otherwise `target_field` will become a json object. In order to avoid documents getting too large, the maximum allowed value is 128. | -| `shape_relation` | no | `INTERSECTS` | A spatial relation operator used to match the [geoshape](/reference/elasticsearch/mapping-reference/geo-shape.md) of incoming documents to documents in the enrich index. This option is only used for `geo_match` enrich policy types. See [Spatial Relations](/reference/query-languages/query-dsl-shape-query.md#_spatial_relations) for operators and more information. | +| `shape_relation` | no | `INTERSECTS` | A spatial relation operator used to match the [geoshape](/reference/elasticsearch/mapping-reference/geo-shape.md) of incoming documents to documents in the enrich index. This option is only used for `geo_match` enrich policy types. See [Spatial Relations](/reference/query-languages/query-dsl/query-dsl-shape-query.md#_spatial_relations) for operators and more information. | | `description` | no | - | Description of the processor. Useful for describing the purpose of the processor or its configuration. | | `if` | no | - | Conditionally execute the processor. See [Conditionally run a processor](docs-content://manage-data/ingest/transform-enrich/ingest-pipelines.md#conditionally-run-processor). | | `ignore_failure` | no | `false` | Ignore failures for the processor. See [Handling pipeline failures](docs-content://manage-data/ingest/transform-enrich/ingest-pipelines.md#handling-pipeline-failures). | diff --git a/docs/reference/query-languages/eql.md b/docs/reference/query-languages/eql.md index 1e80e0ad4814..f45ff727d1bd 100644 --- a/docs/reference/query-languages/eql.md +++ b/docs/reference/query-languages/eql.md @@ -19,7 +19,7 @@ Event Query Language (EQL) is a query language for event-based time series data, ## Advantages of EQL [eql-advantages] * **EQL lets you express relationships between events.**
Many query languages allow you to match single events. EQL lets you match a sequence of events across different event categories and time spans. -* **EQL has a low learning curve.**
[EQL syntax](/reference/query-languages/eql-syntax.md) looks like other common query languages, such as SQL. EQL lets you write and read queries intuitively, which makes for quick, iterative searching. +* **EQL has a low learning curve.**
[EQL syntax](/reference/query-languages/eql/eql-syntax.md) looks like other common query languages, such as SQL. EQL lets you write and read queries intuitively, which makes for quick, iterative searching. * **EQL is designed for security use cases.**
While you can use it for any event-based data, we created EQL for threat hunting. EQL not only supports indicator of compromise (IOC) searches but can describe activity that goes beyond IOCs. @@ -27,7 +27,7 @@ Event Query Language (EQL) is a query language for event-based time series data, With the exception of sample queries, EQL searches require that the searched data stream or index contains a *timestamp* field. By default, EQL uses the `@timestamp` field from the [Elastic Common Schema (ECS)][Elastic Common Schema (ECS)](ecs://reference/index.md)). -EQL searches also require an *event category* field, unless you use the [`any` keyword](/reference/query-languages/eql-syntax.md#eql-syntax-match-any-event-category) to search for documents without an event category field. By default, EQL uses the ECS `event.category` field. +EQL searches also require an *event category* field, unless you use the [`any` keyword](/reference/query-languages/eql/eql-syntax.md#eql-syntax-match-any-event-category) to search for documents without an event category field. By default, EQL uses the ECS `event.category` field. To use a different timestamp or event category field, see [Specify a timestamp or event category field](#specify-a-timestamp-or-event-category-field). @@ -39,7 +39,7 @@ While no schema is required to use EQL, we recommend using the [ECS](ecs://refer ## Run an EQL search [run-an-eql-search] -Use the [EQL search API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-eql-search) to run a [basic EQL query](/reference/query-languages/eql-syntax.md#eql-basic-syntax). +Use the [EQL search API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-eql-search) to run a [basic EQL query](/reference/query-languages/eql/eql-syntax.md#eql-basic-syntax). ```console GET /my-data-stream/_eql/search @@ -120,7 +120,7 @@ GET /my-data-stream/_eql/search ## Search for a sequence of events [eql-search-sequence] -Use EQL’s [sequence syntax](/reference/query-languages/eql-syntax.md#eql-sequences) to search for a series of ordered events. List the event items in ascending chronological order, with the most recent event listed last: +Use EQL’s [sequence syntax](/reference/query-languages/eql/eql-syntax.md#eql-sequences) to search for a series of ordered events. List the event items in ascending chronological order, with the most recent event listed last: ```console GET /my-data-stream/_eql/search @@ -189,7 +189,7 @@ The response’s `hits.sequences` property contains the 10 most recent matching } ``` -Use [`with maxspan`](/reference/query-languages/eql-syntax.md#eql-with-maxspan-keywords) to constrain matching sequences to a timespan: +Use [`with maxspan`](/reference/query-languages/eql/eql-syntax.md#eql-with-maxspan-keywords) to constrain matching sequences to a timespan: ```console GET /my-data-stream/_eql/search @@ -202,7 +202,7 @@ GET /my-data-stream/_eql/search } ``` -Use `!` to match [missing events](/reference/query-languages/eql-syntax.md#eql-missing-events): events in a sequence that do not meet a condition within a given timespan: +Use `!` to match [missing events](/reference/query-languages/eql/eql-syntax.md#eql-missing-events): events in a sequence that do not meet a condition within a given timespan: ```console GET /my-data-stream/_eql/search @@ -277,7 +277,7 @@ Missing events are indicated in the response as `missing": true`: } ``` -Use the [`by` keyword](/reference/query-languages/eql-syntax.md#eql-by-keyword) to match events that share the same field values: +Use the [`by` keyword](/reference/query-languages/eql/eql-syntax.md#eql-by-keyword) to match events that share the same field values: ```console GET /my-data-stream/_eql/search @@ -321,7 +321,7 @@ The `hits.sequences.join_keys` property contains the shared field values. } ``` -Use the [`until` keyword](/reference/query-languages/eql-syntax.md#eql-until-keyword) to specify an expiration event for sequences. Matching sequences must end before this event. +Use the [`until` keyword](/reference/query-languages/eql/eql-syntax.md#eql-until-keyword) to specify an expiration event for sequences. Matching sequences must end before this event. ```console GET /my-data-stream/_eql/search @@ -338,7 +338,7 @@ GET /my-data-stream/_eql/search ## Sample chronologically unordered events [eql-search-sample] -Use EQL’s [sample syntax](/reference/query-languages/eql-syntax.md#eql-samples) to search for events that match one or more join keys and a set of filters. Samples are similar to sequences, but do not return events in chronological order. In fact, sample queries can run on data without a timestamp. Sample queries can be useful to find correlations in events that don’t always occur in the same sequence, or that occur across long time spans. +Use EQL’s [sample syntax](/reference/query-languages/eql/eql-syntax.md#eql-samples) to search for events that match one or more join keys and a set of filters. Samples are similar to sequences, but do not return events in chronological order. In fact, sample queries can run on data without a timestamp. Sample queries can be useful to find correlations in events that don’t always occur in the same sequence, or that occur across long time spans. ::::{dropdown} Click to show the sample data used in the examples below ```console @@ -554,7 +554,7 @@ POST /my-index-000003/_bulk?refresh :::: -A sample query specifies at least one join key, using the [`by` keyword](/reference/query-languages/eql-syntax.md#eql-by-keyword), and up to five filters: +A sample query specifies at least one join key, using the [`by` keyword](/reference/query-languages/eql/eql-syntax.md#eql-by-keyword), and up to five filters: ```console GET /my-index*/_eql/search diff --git a/docs/reference/query-languages/eql-ex-threat-detection.md b/docs/reference/query-languages/eql/eql-ex-threat-detection.md similarity index 99% rename from docs/reference/query-languages/eql-ex-threat-detection.md rename to docs/reference/query-languages/eql/eql-ex-threat-detection.md index c28a50df4bdf..92df0aef6466 100644 --- a/docs/reference/query-languages/eql-ex-threat-detection.md +++ b/docs/reference/query-languages/eql/eql-ex-threat-detection.md @@ -204,7 +204,7 @@ The query matches an event, confirming `scrobj.dll` was loaded. ## Determine the likelihood of success [eql-ex-detemine-likelihood-of-success] -In many cases, attackers use malicious scripts to connect to remote servers or download other files. Use an [EQL sequence query](/reference/query-languages/eql-syntax.md#eql-sequences) to check for the following series of events: +In many cases, attackers use malicious scripts to connect to remote servers or download other files. Use an [EQL sequence query](/reference/query-languages/eql/eql-syntax.md#eql-sequences) to check for the following series of events: 1. A `regsvr32.exe` process 2. A load of the `scrobj.dll` library by the same process diff --git a/docs/reference/query-languages/eql-function-ref.md b/docs/reference/query-languages/eql/eql-function-ref.md similarity index 99% rename from docs/reference/query-languages/eql-function-ref.md rename to docs/reference/query-languages/eql/eql-function-ref.md index 2de56641c635..1bdb557e00af 100644 --- a/docs/reference/query-languages/eql-function-ref.md +++ b/docs/reference/query-languages/eql/eql-function-ref.md @@ -7,7 +7,7 @@ mapped_pages: # EQL function reference [eql-function-ref] -{{es}} supports the following [EQL functions](/reference/query-languages/eql-syntax.md#eql-functions). +{{es}} supports the following [EQL functions](/reference/query-languages/eql/eql-syntax.md#eql-functions). ## `add` [eql-fn-add] diff --git a/docs/reference/query-languages/eql-pipe-ref.md b/docs/reference/query-languages/eql/eql-pipe-ref.md similarity index 97% rename from docs/reference/query-languages/eql-pipe-ref.md rename to docs/reference/query-languages/eql/eql-pipe-ref.md index 672a3735f8ac..0973feb03064 100644 --- a/docs/reference/query-languages/eql-pipe-ref.md +++ b/docs/reference/query-languages/eql/eql-pipe-ref.md @@ -7,7 +7,7 @@ mapped_pages: # EQL pipe reference [eql-pipe-ref] -{{es}} supports the following [EQL pipes](/reference/query-languages/eql-syntax.md#eql-pipes). +{{es}} supports the following [EQL pipes](/reference/query-languages/eql/eql-syntax.md#eql-pipes). ## `head` [eql-pipe-head] diff --git a/docs/reference/query-languages/eql-syntax.md b/docs/reference/query-languages/eql/eql-syntax.md similarity index 98% rename from docs/reference/query-languages/eql-syntax.md rename to docs/reference/query-languages/eql/eql-syntax.md index 87fd794a2c01..bf3d2bd6f9cf 100644 --- a/docs/reference/query-languages/eql-syntax.md +++ b/docs/reference/query-languages/eql/eql-syntax.md @@ -130,7 +130,7 @@ my_field regex~ "value[^z].?" // case-insensitive regex matching : Returns `true` if the string to the left of the keyword matches a [wildcard pattern](#eql-syntax-wildcards) to the right. Supports [list lookups](#eql-syntax-lookup-operators). Can only be used to compare strings. For case-insensitive matching, use `like~`. `regex` (case-sensitive) -: Returns `true` if the string to the left of the keyword matches a regular expression to the right. For supported regular expression syntax, see [*Regular expression syntax*](/reference/query-languages/regexp-syntax.md). Supports [list lookups](#eql-syntax-lookup-operators). Can only be used to compare strings. For case-insensitive matching, use `regex~`. +: Returns `true` if the string to the left of the keyword matches a regular expression to the right. For supported regular expression syntax, see [*Regular expression syntax*](/reference/query-languages/query-dsl/regexp-syntax.md). Supports [list lookups](#eql-syntax-lookup-operators). Can only be used to compare strings. For case-insensitive matching, use `regex~`. #### Limitations for comparisons [limitations-for-comparisons] @@ -201,7 +201,7 @@ my_field regex~ ("value-[0-9]", "value[^2].?", "val3") // case-insensitive : Returns `true` if the string matches a [wildcard pattern](#eql-syntax-wildcards) in the provided list. Can only be used to compare strings. For case-insensitive matching, use `like~`. `regex` (case-sensitive) -: Returns `true` if the string matches a regular expression pattern in the provided list. For supported regular expression syntax, see [*Regular expression syntax*](/reference/query-languages/regexp-syntax.md). Can only be used to compare strings. For case-insensitive matching, use `regex~`. +: Returns `true` if the string matches a regular expression pattern in the provided list. For supported regular expression syntax, see [*Regular expression syntax*](/reference/query-languages/query-dsl/regexp-syntax.md). Can only be used to compare strings. For case-insensitive matching, use `regex~`. ### Math operators [eql-syntax-math-operators] @@ -653,7 +653,7 @@ Sample queries do not take into account the chronological ordering of events. Th ## Functions [eql-functions] -You can use EQL functions to convert data types, perform math, manipulate strings, and more. For a list of supported functions, see [Function reference](/reference/query-languages/eql-function-ref.md). +You can use EQL functions to convert data types, perform math, manipulate strings, and more. For a list of supported functions, see [Function reference](/reference/query-languages/eql/eql-function-ref.md). ### Case-insensitive functions [eql-case-insensitive-functions] @@ -712,7 +712,7 @@ authentication where agent.id == 4624 You can pass the output of a pipe to another pipe. This lets you use multiple pipes with a single query. -For a list of supported pipes, see [Pipe reference](/reference/query-languages/eql-pipe-ref.md). +For a list of supported pipes, see [Pipe reference](/reference/query-languages/eql/eql-pipe-ref.md). ## Limitations [eql-syntax-limitations] @@ -831,13 +831,13 @@ The query’s event items correspond to the following states: * State B: `[process where process.name == "bash"]` * Complete: `[process where process.name == "cat"]` -:::{image} ../../images/sequence-state-machine.svg +:::{image} /images/sequence-state-machine.svg :alt: sequence state machine ::: To find matching sequences, the query uses separate state machines for each unique `user.name` value. Based on the data set, you can expect two state machines: one for the `root` user and one for `elkbee`. -:::{image} ../../images/separate-state-machines.svg +:::{image} /images/separate-state-machines.svg :alt: separate state machines ::: diff --git a/docs/reference/query-languages/esql/_snippets/functions/description/match.md b/docs/reference/query-languages/esql/_snippets/functions/description/match.md index 3264a5696ba2..f24f66197d73 100644 --- a/docs/reference/query-languages/esql/_snippets/functions/description/match.md +++ b/docs/reference/query-languages/esql/_snippets/functions/description/match.md @@ -2,5 +2,5 @@ **Description** -Use `MATCH` to perform a [match query](/reference/query-languages/query-dsl-match-query.md) on the specified field. Using `MATCH` is equivalent to using the `match` query in the Elasticsearch Query DSL. Match can be used on fields from the text family like [text](/reference/elasticsearch/mapping-reference/text.md) and [semantic_text](/reference/elasticsearch/mapping-reference/semantic-text.md), as well as other field types like keyword, boolean, dates, and numeric types. Match can use [function named parameters](/reference/query-languages/esql/esql-syntax.md#esql-function-named-params) to specify additional options for the match query. All [match query parameters](/reference/query-languages/query-dsl-match-query.md#match-field-params) are supported. For a simplified syntax, you can use the [match operator](/reference/query-languages/esql/esql-functions-operators.md#esql-search-operators) `:` operator instead of `MATCH`. `MATCH` returns true if the provided query matches the row. +Use `MATCH` to perform a [match query](/reference/query-languages/query-dsl/query-dsl-match-query.md) on the specified field. Using `MATCH` is equivalent to using the `match` query in the Elasticsearch Query DSL. Match can be used on fields from the text family like [text](/reference/elasticsearch/mapping-reference/text.md) and [semantic_text](/reference/elasticsearch/mapping-reference/semantic-text.md), as well as other field types like keyword, boolean, dates, and numeric types. Match can use [function named parameters](/reference/query-languages/esql/esql-syntax.md#esql-function-named-params) to specify additional options for the match query. All [match query parameters](/reference/query-languages/query-dsl/query-dsl-match-query.md#match-field-params) are supported. For a simplified syntax, you can use the [match operator](/reference/query-languages/esql/esql-functions-operators.md#esql-search-operators) `:` operator instead of `MATCH`. `MATCH` returns true if the provided query matches the row. diff --git a/docs/reference/query-languages/esql/_snippets/functions/description/qstr.md b/docs/reference/query-languages/esql/_snippets/functions/description/qstr.md index af187af589dd..0d6b50f9193e 100644 --- a/docs/reference/query-languages/esql/_snippets/functions/description/qstr.md +++ b/docs/reference/query-languages/esql/_snippets/functions/description/qstr.md @@ -2,5 +2,5 @@ **Description** -Performs a [query string query](/reference/query-languages/query-dsl-query-string-query.md). Returns true if the provided query string matches the row. +Performs a [query string query](/reference/query-languages/query-dsl/query-dsl-query-string-query.md). Returns true if the provided query string matches the row. diff --git a/docs/reference/query-languages/esql/_snippets/functions/examples/to_lower.md b/docs/reference/query-languages/esql/_snippets/functions/examples/to_lower.md index cbab7915f6bf..f8ed6a707243 100644 --- a/docs/reference/query-languages/esql/_snippets/functions/examples/to_lower.md +++ b/docs/reference/query-languages/esql/_snippets/functions/examples/to_lower.md @@ -1,6 +1,6 @@ % This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it. -**Example** +**Examples** ```esql ROW message = "Some Text" @@ -11,4 +11,12 @@ ROW message = "Some Text" | --- | --- | | Some Text | some text | +```esql +ROW v = TO_LOWER(["Some", "Text"]) +``` + +| v:keyword | +| --- | +| ["some", "text"] | + diff --git a/docs/reference/query-languages/esql/_snippets/functions/parameters/match.md b/docs/reference/query-languages/esql/_snippets/functions/parameters/match.md index 63c09dddfac0..ed5fa4ddb9f9 100644 --- a/docs/reference/query-languages/esql/_snippets/functions/parameters/match.md +++ b/docs/reference/query-languages/esql/_snippets/functions/parameters/match.md @@ -9,5 +9,5 @@ : Value to find in the provided field. `options` -: (Optional) Match additional options as [function named parameters](/reference/query-languages/esql/esql-syntax.md#esql-function-named-params). See [match query](/reference/query-languages/query-dsl-match-query.md) for more information. +: (Optional) Match additional options as [function named parameters](/reference/query-languages/esql/esql-syntax.md#esql-function-named-params). See [match query](/reference/query-languages/query-dsl/query-dsl-match-query.md) for more information. diff --git a/docs/reference/query-languages/esql/_snippets/functions/parameters/qstr.md b/docs/reference/query-languages/esql/_snippets/functions/parameters/qstr.md index 6bbad475bf07..e80ced496626 100644 --- a/docs/reference/query-languages/esql/_snippets/functions/parameters/qstr.md +++ b/docs/reference/query-languages/esql/_snippets/functions/parameters/qstr.md @@ -6,5 +6,5 @@ : Query string in Lucene query string format. `options` -: (Optional) Additional options for Query String as [function named parameters](/reference/query-languages/esql/esql-syntax.md#esql-function-named-params). See [query string query](/reference/query-languages/query-dsl-query-string-query.md) for more information. +: (Optional) Additional options for Query String as [function named parameters](/reference/query-languages/esql/esql-syntax.md#esql-function-named-params). See [query string query](/reference/query-languages/query-dsl/query-dsl-query-string-query.md) for more information. diff --git a/docs/reference/query-languages/esql/_snippets/functions/parameters/to_lower.md b/docs/reference/query-languages/esql/_snippets/functions/parameters/to_lower.md index 122e76c5af87..29bfbc291af5 100644 --- a/docs/reference/query-languages/esql/_snippets/functions/parameters/to_lower.md +++ b/docs/reference/query-languages/esql/_snippets/functions/parameters/to_lower.md @@ -3,5 +3,5 @@ **Parameters** `str` -: String expression. If `null`, the function returns `null`. +: String expression. If `null`, the function returns `null`. The input can be a single- or multi-valued column or an expression. diff --git a/docs/reference/query-languages/esql/_snippets/functions/parameters/to_upper.md b/docs/reference/query-languages/esql/_snippets/functions/parameters/to_upper.md index 122e76c5af87..29bfbc291af5 100644 --- a/docs/reference/query-languages/esql/_snippets/functions/parameters/to_upper.md +++ b/docs/reference/query-languages/esql/_snippets/functions/parameters/to_upper.md @@ -3,5 +3,5 @@ **Parameters** `str` -: String expression. If `null`, the function returns `null`. +: String expression. If `null`, the function returns `null`. The input can be a single- or multi-valued column or an expression. diff --git a/docs/reference/query-languages/esql/_snippets/operators/layout/match_operator.md b/docs/reference/query-languages/esql/_snippets/operators/layout/match_operator.md index 1980f5937889..3eb1d2b72304 100644 --- a/docs/reference/query-languages/esql/_snippets/operators/layout/match_operator.md +++ b/docs/reference/query-languages/esql/_snippets/operators/layout/match_operator.md @@ -15,11 +15,11 @@ Do not use on production environments. This functionality is in technical previe :::: -The match operator performs a [match query](/reference/query-languages/query-dsl-match-query.md) on the specified field. Returns true if the provided query matches the row. +The match operator performs a [match query](/reference/query-languages/query-dsl/query-dsl-match-query.md) on the specified field. Returns true if the provided query matches the row. The match operator is equivalent to the [match function](../../../esql-functions-operators.md#esql-match). -For using the function syntax, or adding [match query parameters](/reference/query-languages/query-dsl-match-query.md#match-field-params), you can use the [match function](../../../esql-functions-operators.md#esql-match). +For using the function syntax, or adding [match query parameters](/reference/query-languages/query-dsl/query-dsl-match-query.md#match-field-params), you can use the [match function](../../../esql-functions-operators.md#esql-match). :::{include} ../types/match_operator.md diff --git a/docs/reference/query-languages/esql/_snippets/operators/layout/rlike.md b/docs/reference/query-languages/esql/_snippets/operators/layout/rlike.md index e38b437da99c..dd022f0c6104 100644 --- a/docs/reference/query-languages/esql/_snippets/operators/layout/rlike.md +++ b/docs/reference/query-languages/esql/_snippets/operators/layout/rlike.md @@ -2,7 +2,7 @@ ## `RLIKE` [esql-rlike] -Use `RLIKE` to filter data based on string patterns using using [regular expressions](/reference/query-languages/regexp-syntax.md). `RLIKE` usually acts on a field placed on the left-hand side of the operator, but it can also act on a constant (literal) expression. The right-hand side of the operator represents the pattern. +Use `RLIKE` to filter data based on string patterns using using [regular expressions](/reference/query-languages/query-dsl/regexp-syntax.md). `RLIKE` usually acts on a field placed on the left-hand side of the operator, but it can also act on a constant (literal) expression. The right-hand side of the operator represents the pattern. :::{include} ../types/rlike.md diff --git a/docs/reference/query-languages/esql/esql-commands.md b/docs/reference/query-languages/esql/esql-commands.md index 0d1a1477ec6b..6689f820fe04 100644 --- a/docs/reference/query-languages/esql/esql-commands.md +++ b/docs/reference/query-languages/esql/esql-commands.md @@ -1200,7 +1200,7 @@ FROM employees For matching text, you can use [full text search functions](/reference/query-languages/esql/esql-functions-operators.md#esql-search-functions) like `MATCH`. -Use [`MATCH`](/reference/query-languages/esql/esql-functions-operators.md#esql-match) to perform a [match query](/reference/query-languages/query-dsl-match-query.md) on a specified field. +Use [`MATCH`](/reference/query-languages/esql/esql-functions-operators.md#esql-match) to perform a [match query](/reference/query-languages/query-dsl/query-dsl-match-query.md) on a specified field. Match can be used on text fields, as well as other field types like boolean, dates, and numeric types. @@ -1265,7 +1265,7 @@ ROW message = "foo * bar" | WHERE message LIKE """foo \* bar""" ``` -Use `RLIKE` to filter data based on string patterns using using [regular expressions](/reference/query-languages/regexp-syntax.md). `RLIKE` usually acts on a field placed on the left-hand side of the operator, but it can also act on a constant (literal) expression. The right-hand side of the operator represents the pattern. +Use `RLIKE` to filter data based on string patterns using using [regular expressions](/reference/query-languages/query-dsl/regexp-syntax.md). `RLIKE` usually acts on a field placed on the left-hand side of the operator, but it can also act on a constant (literal) expression. The right-hand side of the operator represents the pattern. **Supported types** diff --git a/docs/reference/query-languages/esql/esql-enrich-data.md b/docs/reference/query-languages/esql/esql-enrich-data.md index f087164b0c96..acc9556a0e4d 100644 --- a/docs/reference/query-languages/esql/esql-enrich-data.md +++ b/docs/reference/query-languages/esql/esql-enrich-data.md @@ -205,13 +205,13 @@ Once created, you can’t update or change an enrich policy. Instead, you can: The {{esql}} `ENRICH` command supports all three enrich policy types: `geo_match` -: Matches enrich data to incoming documents based on a [`geo_shape` query](/reference/query-languages/query-dsl-geo-shape-query.md). For an example, see [Example: Enrich your data based on geolocation](docs-content://manage-data/ingest/transform-enrich/example-enrich-data-based-on-geolocation.md). +: Matches enrich data to incoming documents based on a [`geo_shape` query](/reference/query-languages/query-dsl/query-dsl-geo-shape-query.md). For an example, see [Example: Enrich your data based on geolocation](docs-content://manage-data/ingest/transform-enrich/example-enrich-data-based-on-geolocation.md). `match` -: Matches enrich data to incoming documents based on a [`term` query](/reference/query-languages/query-dsl-term-query.md). For an example, see [Example: Enrich your data based on exact values](docs-content://manage-data/ingest/transform-enrich/example-enrich-data-based-on-exact-values.md). +: Matches enrich data to incoming documents based on a [`term` query](/reference/query-languages/query-dsl/query-dsl-term-query.md). For an example, see [Example: Enrich your data based on exact values](docs-content://manage-data/ingest/transform-enrich/example-enrich-data-based-on-exact-values.md). `range` -: Matches a number, date, or IP address in incoming documents to a range in the enrich index based on a [`term` query](/reference/query-languages/query-dsl-term-query.md). For an example, see [Example: Enrich your data by matching a value to a range](docs-content://manage-data/ingest/transform-enrich/example-enrich-data-by-matching-value-to-range.md). +: Matches a number, date, or IP address in incoming documents to a range in the enrich index based on a [`term` query](/reference/query-languages/query-dsl/query-dsl-term-query.md). For an example, see [Example: Enrich your data by matching a value to a range](docs-content://manage-data/ingest/transform-enrich/example-enrich-data-by-matching-value-to-range.md). While all three enrich policy types are supported, there are some limitations to be aware of: diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/to_lower.json b/docs/reference/query-languages/esql/kibana/definition/functions/to_lower.json index 1b77709586a5..fdff47a19e36 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/to_lower.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/to_lower.json @@ -10,7 +10,7 @@ "name" : "str", "type" : "keyword", "optional" : false, - "description" : "String expression. If `null`, the function returns `null`." + "description" : "String expression. If `null`, the function returns `null`. The input can be a single- or multi-valued column or an expression." } ], "variadic" : false, @@ -22,7 +22,7 @@ "name" : "str", "type" : "text", "optional" : false, - "description" : "String expression. If `null`, the function returns `null`." + "description" : "String expression. If `null`, the function returns `null`. The input can be a single- or multi-valued column or an expression." } ], "variadic" : false, @@ -30,7 +30,8 @@ } ], "examples" : [ - "ROW message = \"Some Text\"\n| EVAL message_lower = TO_LOWER(message)" + "ROW message = \"Some Text\"\n| EVAL message_lower = TO_LOWER(message)", + "ROW v = TO_LOWER([\"Some\", \"Text\"])" ], "preview" : false, "snapshot_only" : false diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/to_upper.json b/docs/reference/query-languages/esql/kibana/definition/functions/to_upper.json index efd6885ad350..422830552342 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/to_upper.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/to_upper.json @@ -10,7 +10,7 @@ "name" : "str", "type" : "keyword", "optional" : false, - "description" : "String expression. If `null`, the function returns `null`." + "description" : "String expression. If `null`, the function returns `null`. The input can be a single- or multi-valued column or an expression." } ], "variadic" : false, @@ -22,7 +22,7 @@ "name" : "str", "type" : "text", "optional" : false, - "description" : "String expression. If `null`, the function returns `null`." + "description" : "String expression. If `null`, the function returns `null`. The input can be a single- or multi-valued column or an expression." } ], "variadic" : false, diff --git a/docs/reference/query-languages/query-dsl-constant-score-query.md b/docs/reference/query-languages/query-dsl-constant-score-query.md deleted file mode 100644 index ad2e9a7cae44..000000000000 --- a/docs/reference/query-languages/query-dsl-constant-score-query.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -navigation_title: "Constant score" -mapped_pages: - - https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-constant-score-query.html ---- - -# Constant score query [query-dsl-constant-score-query] - - -Wraps a [filter query](/reference/query-languages/query-dsl-bool-query.md) and returns every matching document with a [relevance score](/reference/query-languages/query-filter-context.md#relevance-scores) equal to the `boost` parameter value. - -```console -GET /_search -{ - "query": { - "constant_score": { - "filter": { - "term": { "user.id": "kimchy" } - }, - "boost": 1.2 - } - } -} -``` - -## Top-level parameters for `constant_score` [constant-score-top-level-params] - -`filter` -: (Required, query object) [Filter query](/reference/query-languages/query-dsl-bool-query.md) you wish to run. Any returned documents must match this query. - -Filter queries do not calculate [relevance scores](/reference/query-languages/query-filter-context.md#relevance-scores). To speed up performance, {{es}} automatically caches frequently used filter queries. - - -`boost` -: (Optional, float) Floating point number used as the constant [relevance score](/reference/query-languages/query-filter-context.md#relevance-scores) for every document matching the `filter` query. Defaults to `1.0`. - - diff --git a/docs/reference/query-languages/query-dsl-match-bool-prefix-query.md b/docs/reference/query-languages/query-dsl-match-bool-prefix-query.md deleted file mode 100644 index db043a567806..000000000000 --- a/docs/reference/query-languages/query-dsl-match-bool-prefix-query.md +++ /dev/null @@ -1,64 +0,0 @@ ---- -navigation_title: "Match boolean prefix" -mapped_pages: - - https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-bool-prefix-query.html ---- - -# Match boolean prefix query [query-dsl-match-bool-prefix-query] - - -A `match_bool_prefix` query analyzes its input and constructs a [`bool` query](/reference/query-languages/query-dsl-bool-query.md) from the terms. Each term except the last is used in a `term` query. The last term is used in a `prefix` query. A `match_bool_prefix` query such as - -```console -GET /_search -{ - "query": { - "match_bool_prefix" : { - "message" : "quick brown f" - } - } -} -``` - -where analysis produces the terms `quick`, `brown`, and `f` is similar to the following `bool` query - -```console -GET /_search -{ - "query": { - "bool" : { - "should": [ - { "term": { "message": "quick" }}, - { "term": { "message": "brown" }}, - { "prefix": { "message": "f"}} - ] - } - } -} -``` - -An important difference between the `match_bool_prefix` query and [`match_phrase_prefix`](/reference/query-languages/query-dsl-match-query-phrase-prefix.md) is that the `match_phrase_prefix` query matches its terms as a phrase, but the `match_bool_prefix` query can match its terms in any position. The example `match_bool_prefix` query above could match a field containing `quick brown fox`, but it could also match `brown fox quick`. It could also match a field containing the term `quick`, the term `brown` and a term starting with `f`, appearing in any position. - -## Parameters [_parameters] - -By default, `match_bool_prefix` queries' input text will be analyzed using the analyzer from the queried field’s mapping. A different search analyzer can be configured with the `analyzer` parameter - -```console -GET /_search -{ - "query": { - "match_bool_prefix": { - "message": { - "query": "quick brown f", - "analyzer": "keyword" - } - } - } -} -``` - -`match_bool_prefix` queries support the [`minimum_should_match`](/reference/query-languages/query-dsl-minimum-should-match.md) and `operator` parameters as described for the [`match` query](/reference/query-languages/query-dsl-match-query.md#query-dsl-match-query-boolean), applying the setting to the constructed `bool` query. The number of clauses in the constructed `bool` query will in most cases be the number of terms produced by analysis of the query text. - -The [`fuzziness`](/reference/query-languages/query-dsl-match-query.md#query-dsl-match-query-fuzziness), `prefix_length`, `max_expansions`, `fuzzy_transpositions`, and `fuzzy_rewrite` parameters can be applied to the `term` subqueries constructed for all terms but the final term. They do not have any effect on the prefix query constructed for the final term. - - diff --git a/docs/reference/query-languages/compound-queries.md b/docs/reference/query-languages/query-dsl/compound-queries.md similarity index 75% rename from docs/reference/query-languages/compound-queries.md rename to docs/reference/query-languages/query-dsl/compound-queries.md index 69cffa4da54b..bfcdf6c4c45a 100644 --- a/docs/reference/query-languages/compound-queries.md +++ b/docs/reference/query-languages/query-dsl/compound-queries.md @@ -9,19 +9,19 @@ Compound queries wrap other compound or leaf queries, either to combine their re The queries in this group are: -[`bool` query](/reference/query-languages/query-dsl-bool-query.md) +[`bool` query](/reference/query-languages/query-dsl/query-dsl-bool-query.md) : The default query for combining multiple leaf or compound query clauses, as `must`, `should`, `must_not`, or `filter` clauses. The `must` and `should` clauses have their scores combined — the more matching clauses, the better — while the `must_not` and `filter` clauses are executed in filter context. -[`boosting` query](/reference/query-languages/query-dsl-boosting-query.md) +[`boosting` query](/reference/query-languages/query-dsl/query-dsl-boosting-query.md) : Return documents which match a `positive` query, but reduce the score of documents which also match a `negative` query. -[`constant_score` query](/reference/query-languages/query-dsl-constant-score-query.md) +[`constant_score` query](/reference/query-languages/query-dsl/query-dsl-constant-score-query.md) : A query which wraps another query, but executes it in filter context. All matching documents are given the same constant `_score`. -[`dis_max` query](/reference/query-languages/query-dsl-dis-max-query.md) +[`dis_max` query](/reference/query-languages/query-dsl/query-dsl-dis-max-query.md) : A query which accepts multiple queries, and returns any documents which match any of the query clauses. While the `bool` query combines the scores from all matching queries, the `dis_max` query uses the score of the single best- matching query clause. -[`function_score` query](/reference/query-languages/query-dsl-function-score-query.md) +[`function_score` query](/reference/query-languages/query-dsl/query-dsl-function-score-query.md) : Modify the scores returned by the main query with functions to take into account factors like popularity, recency, distance, or custom algorithms implemented with scripting. diff --git a/docs/reference/query-languages/full-text-queries.md b/docs/reference/query-languages/query-dsl/full-text-queries.md similarity index 62% rename from docs/reference/query-languages/full-text-queries.md rename to docs/reference/query-languages/query-dsl/full-text-queries.md index 661158baea9a..1856e943620b 100644 --- a/docs/reference/query-languages/full-text-queries.md +++ b/docs/reference/query-languages/query-dsl/full-text-queries.md @@ -9,31 +9,31 @@ The full text queries enable you to search [analyzed text fields](docs-content:/ The queries in this group are: -[`intervals` query](/reference/query-languages/query-dsl-intervals-query.md) +[`intervals` query](/reference/query-languages/query-dsl/query-dsl-intervals-query.md) : A full text query that allows fine-grained control of the ordering and proximity of matching terms. -[`match` query](/reference/query-languages/query-dsl-match-query.md) +[`match` query](/reference/query-languages/query-dsl/query-dsl-match-query.md) : The standard query for performing full text queries, including fuzzy matching and phrase or proximity queries. -[`match_bool_prefix` query](/reference/query-languages/query-dsl-match-bool-prefix-query.md) +[`match_bool_prefix` query](/reference/query-languages/query-dsl/query-dsl-match-bool-prefix-query.md) : Creates a `bool` query that matches each term as a `term` query, except for the last term, which is matched as a `prefix` query -[`match_phrase` query](/reference/query-languages/query-dsl-match-query-phrase.md) +[`match_phrase` query](/reference/query-languages/query-dsl/query-dsl-match-query-phrase.md) : Like the `match` query but used for matching exact phrases or word proximity matches. -[`match_phrase_prefix` query](/reference/query-languages/query-dsl-match-query-phrase-prefix.md) +[`match_phrase_prefix` query](/reference/query-languages/query-dsl/query-dsl-match-query-phrase-prefix.md) : Like the `match_phrase` query, but does a wildcard search on the final word. -[`multi_match` query](/reference/query-languages/query-dsl-multi-match-query.md) +[`multi_match` query](/reference/query-languages/query-dsl/query-dsl-multi-match-query.md) : The multi-field version of the `match` query. -[`combined_fields` query](/reference/query-languages/query-dsl-combined-fields-query.md) +[`combined_fields` query](/reference/query-languages/query-dsl/query-dsl-combined-fields-query.md) : Matches over multiple fields as if they had been indexed into one combined field. -[`query_string` query](/reference/query-languages/query-dsl-query-string-query.md) -: Supports the compact Lucene [query string syntax](/reference/query-languages/query-dsl-query-string-query.md#query-string-syntax), allowing you to specify AND|OR|NOT conditions and multi-field search within a single query string. For expert users only. +[`query_string` query](/reference/query-languages/query-dsl/query-dsl-query-string-query.md) +: Supports the compact Lucene [query string syntax](/reference/query-languages/query-dsl/query-dsl-query-string-query.md#query-string-syntax), allowing you to specify AND|OR|NOT conditions and multi-field search within a single query string. For expert users only. -[`simple_query_string` query](/reference/query-languages/query-dsl-simple-query-string-query.md) +[`simple_query_string` query](/reference/query-languages/query-dsl/query-dsl-simple-query-string-query.md) : A simpler, more robust version of the `query_string` syntax suitable for exposing directly to users. diff --git a/docs/reference/query-languages/geo-queries.md b/docs/reference/query-languages/query-dsl/geo-queries.md similarity index 71% rename from docs/reference/query-languages/geo-queries.md rename to docs/reference/query-languages/query-dsl/geo-queries.md index ab5b36da6975..4d6f13c5477e 100644 --- a/docs/reference/query-languages/geo-queries.md +++ b/docs/reference/query-languages/query-dsl/geo-queries.md @@ -9,13 +9,13 @@ Elasticsearch supports two types of geo data: [`geo_point`](/reference/elasticse The queries in this group are: -[`geo_bounding_box`](/reference/query-languages/query-dsl-geo-bounding-box-query.md) query +[`geo_bounding_box`](/reference/query-languages/query-dsl/query-dsl-geo-bounding-box-query.md) query : Finds documents with geoshapes or geopoints which intersect the specified rectangle. -[`geo_distance`](/reference/query-languages/query-dsl-geo-distance-query.md) query +[`geo_distance`](/reference/query-languages/query-dsl/query-dsl-geo-distance-query.md) query : Finds documents with geoshapes or geopoints within the specified distance of a central point. -[`geo_grid`](/reference/query-languages/query-dsl-geo-grid-query.md) query +[`geo_grid`](/reference/query-languages/query-dsl/query-dsl-geo-grid-query.md) query : Finds documents with: * Geoshapes or geopoints which intersect the specified geohash @@ -23,10 +23,10 @@ The queries in this group are: * Geopoints which intersect the specified H3 bin -[`geo_polygon`](/reference/query-languages/query-dsl-geo-polygon-query.md) query +[`geo_polygon`](/reference/query-languages/query-dsl/query-dsl-geo-polygon-query.md) query : Find documents with geoshapes or geopoints which intersect the specified polygon. -[`geo_shape`](/reference/query-languages/query-dsl-geo-shape-query.md) query +[`geo_shape`](/reference/query-languages/query-dsl/query-dsl-geo-shape-query.md) query : Finds documents with geoshapes or geopoints which are related to the specified geoshape. Possible spatial relationships to specify are: intersects, contained, within and disjoint. diff --git a/docs/reference/query-languages/joining-queries.md b/docs/reference/query-languages/query-dsl/joining-queries.md similarity index 74% rename from docs/reference/query-languages/joining-queries.md rename to docs/reference/query-languages/query-dsl/joining-queries.md index 113f1a08d570..34831feb73d0 100644 --- a/docs/reference/query-languages/joining-queries.md +++ b/docs/reference/query-languages/query-dsl/joining-queries.md @@ -7,13 +7,13 @@ mapped_pages: Performing full SQL-style joins in a distributed system like Elasticsearch is prohibitively expensive. Instead, Elasticsearch offers two forms of join which are designed to scale horizontally. -[`nested` query](/reference/query-languages/query-dsl-nested-query.md) +[`nested` query](/reference/query-languages/query-dsl/query-dsl-nested-query.md) : Documents may contain fields of type [`nested`](/reference/elasticsearch/mapping-reference/nested.md). These fields are used to index arrays of objects, where each object can be queried (with the `nested` query) as an independent document. -[`has_child`](/reference/query-languages/query-dsl-has-child-query.md) and [`has_parent`](/reference/query-languages/query-dsl-has-parent-query.md) queries +[`has_child`](/reference/query-languages/query-dsl/query-dsl-has-child-query.md) and [`has_parent`](/reference/query-languages/query-dsl/query-dsl-has-parent-query.md) queries : A [`join` field relationship](/reference/elasticsearch/mapping-reference/parent-join.md) can exist between documents within a single index. The `has_child` query returns parent documents whose child documents match the specified query, while the `has_parent` query returns child documents whose parent document matches the specified query. -Also see the [terms-lookup mechanism](/reference/query-languages/query-dsl-terms-query.md#query-dsl-terms-lookup) in the `terms` query, which allows you to build a `terms` query from values contained in another document. +Also see the [terms-lookup mechanism](/reference/query-languages/query-dsl/query-dsl-terms-query.md#query-dsl-terms-lookup) in the `terms` query, which allows you to build a `terms` query from values contained in another document. ## Notes [joining-queries-notes] diff --git a/docs/reference/query-languages/query-dsl-bool-query.md b/docs/reference/query-languages/query-dsl/query-dsl-bool-query.md similarity index 90% rename from docs/reference/query-languages/query-dsl-bool-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-bool-query.md index f21def09731d..8c2141c9497f 100644 --- a/docs/reference/query-languages/query-dsl-bool-query.md +++ b/docs/reference/query-languages/query-dsl/query-dsl-bool-query.md @@ -13,8 +13,8 @@ A query that matches documents matching boolean combinations of other queries. T | --- | --- | | `must` | The clause (query) must appear in matching documents and willcontribute to the score. Each query defined under a `must` acts as a logical "AND", returning only documents that match *all* the specified queries. | | `should` | The clause (query) should appear in the matching document. Each query defined under a `should` acts as a logical "OR", returning documents that match *any* of the specified queries. | -| `filter` | The clause (query) must appear in matching documents. However unlike`must` the score of the query will be ignored. Filter clauses are executedin [filter context](/reference/query-languages/query-filter-context.md), meaning that scoring is ignoredand clauses are considered for caching. Each query defined under a `filter` acts as a logical "AND", returning only documents that match *all* the specified queries. | -| `must_not` | The clause (query) must not appear in the matchingdocuments. Clauses are executed in [filter context](/reference/query-languages/query-filter-context.md) meaningthat scoring is ignored and clauses are considered for caching. Because scoring isignored, a score of `0` for all documents is returned. Each query defined under a `must_not` acts as a logical "NOT", returning only documents that do not match any of the specified queries. | +| `filter` | The clause (query) must appear in matching documents. However unlike`must` the score of the query will be ignored. Filter clauses are executedin [filter context](/reference/query-languages/query-dsl/query-filter-context.md), meaning that scoring is ignoredand clauses are considered for caching. Each query defined under a `filter` acts as a logical "AND", returning only documents that match *all* the specified queries. | +| `must_not` | The clause (query) must not appear in the matchingdocuments. Clauses are executed in [filter context](/reference/query-languages/query-dsl/query-filter-context.md) meaningthat scoring is ignored and clauses are considered for caching. Because scoring isignored, a score of `0` for all documents is returned. Each query defined under a `must_not` acts as a logical "NOT", returning only documents that do not match any of the specified queries. | The `must` and `should` clauses function as logical AND, OR operators, contributing to the scoring of results. However, these results will not be cached for faster retrieval. In contrast, the `filter` and `must_not` clauses are used to include or exclude results without impacting the score, unless used within a `constant_score` query. @@ -53,7 +53,7 @@ You can use the `minimum_should_match` parameter to specify the number or percen If the `bool` query includes at least one `should` clause and no `must` or `filter` clauses, the default value is `1`. Otherwise, the default value is `0`. -For other valid values, see the [`minimum_should_match` parameter](/reference/query-languages/query-dsl-minimum-should-match.md). +For other valid values, see the [`minimum_should_match` parameter](/reference/query-languages/query-dsl/query-dsl-minimum-should-match.md). ## Scoring with `bool.filter` [score-bool-filter] diff --git a/docs/reference/query-languages/query-dsl-boosting-query.md b/docs/reference/query-languages/query-dsl/query-dsl-boosting-query.md similarity index 74% rename from docs/reference/query-languages/query-dsl-boosting-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-boosting-query.md index bb6625a63fce..75d64dfc2762 100644 --- a/docs/reference/query-languages/query-dsl-boosting-query.md +++ b/docs/reference/query-languages/query-dsl/query-dsl-boosting-query.md @@ -7,7 +7,7 @@ mapped_pages: # Boosting query [query-dsl-boosting-query] -Returns documents matching a `positive` query while reducing the [relevance score](/reference/query-languages/query-filter-context.md#relevance-scores) of documents that also match a `negative` query. +Returns documents matching a `positive` query while reducing the [relevance score](/reference/query-languages/query-dsl/query-filter-context.md#relevance-scores) of documents that also match a `negative` query. You can use the `boosting` query to demote certain documents without excluding them from the search results. @@ -41,15 +41,15 @@ GET /_search : (Required, query object) Query you wish to run. Any returned documents must match this query. `negative` -: (Required, query object) Query used to decrease the [relevance score](/reference/query-languages/query-filter-context.md#relevance-scores) of matching documents. +: (Required, query object) Query used to decrease the [relevance score](/reference/query-languages/query-dsl/query-filter-context.md#relevance-scores) of matching documents. -If a returned document matches the `positive` query and this query, the `boosting` query calculates the final [relevance score](/reference/query-languages/query-filter-context.md#relevance-scores) for the document as follows: +If a returned document matches the `positive` query and this query, the `boosting` query calculates the final [relevance score](/reference/query-languages/query-dsl/query-filter-context.md#relevance-scores) for the document as follows: 1. Take the original relevance score from the `positive` query. 2. Multiply the score by the `negative_boost` value. `negative_boost` -: (Required, float) Floating point number between `0` and `1.0` used to decrease the [relevance scores](/reference/query-languages/query-filter-context.md#relevance-scores) of documents matching the `negative` query. +: (Required, float) Floating point number between `0` and `1.0` used to decrease the [relevance scores](/reference/query-languages/query-dsl/query-filter-context.md#relevance-scores) of documents matching the `negative` query. diff --git a/docs/reference/query-languages/query-dsl-combined-fields-query.md b/docs/reference/query-languages/query-dsl/query-dsl-combined-fields-query.md similarity index 89% rename from docs/reference/query-languages/query-dsl-combined-fields-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-combined-fields-query.md index e23e0d32cb1b..70b6a45ec867 100644 --- a/docs/reference/query-languages/query-dsl-combined-fields-query.md +++ b/docs/reference/query-languages/query-dsl/query-dsl-combined-fields-query.md @@ -69,9 +69,9 @@ The `combined_fields` query [analyzes](docs-content://manage-data/data-store/tex `auto_generate_synonyms_phrase_query` -: (Optional, Boolean) If `true`, [match phrase](/reference/query-languages/query-dsl-match-query-phrase.md) queries are automatically created for multi-term synonyms. Defaults to `true`. +: (Optional, Boolean) If `true`, [match phrase](/reference/query-languages/query-dsl/query-dsl-match-query-phrase.md) queries are automatically created for multi-term synonyms. Defaults to `true`. -See [Use synonyms with match query](/reference/query-languages/query-dsl-match-query.md#query-dsl-match-query-synonyms) for an example. +See [Use synonyms with match query](/reference/query-languages/query-dsl/query-dsl-match-query.md#query-dsl-match-query-synonyms) for an example. `operator` @@ -85,7 +85,7 @@ See [Use synonyms with match query](/reference/query-languages/query-dsl-match-q `minimum_should_match` -: (Optional, string) Minimum number of clauses that must match for a document to be returned. See the [`minimum_should_match` parameter](/reference/query-languages/query-dsl-minimum-should-match.md) for valid values and more information. +: (Optional, string) Minimum number of clauses that must match for a document to be returned. See the [`minimum_should_match` parameter](/reference/query-languages/query-dsl/query-dsl-minimum-should-match.md) for valid values and more information. `zero_terms_query` @@ -95,16 +95,16 @@ See [Use synonyms with match query](/reference/query-languages/query-dsl-match-q : No documents are returned if the `analyzer` removes all tokens. `all` -: Returns all documents, similar to a [`match_all`](/reference/query-languages/query-dsl-match-all-query.md) query. +: Returns all documents, similar to a [`match_all`](/reference/query-languages/query-dsl/query-dsl-match-all-query.md) query. -See [Zero terms query](/reference/query-languages/query-dsl-match-query.md#query-dsl-match-query-zero) for an example. +See [Zero terms query](/reference/query-languages/query-dsl/query-dsl-match-query.md#query-dsl-match-query-zero) for an example. ### Comparison to `multi_match` query [_comparison_to_multi_match_query] The `combined_fields` query provides a principled way of matching and scoring across multiple [`text`](/reference/elasticsearch/mapping-reference/text.md) fields. To support this, it requires that all fields have the same search [`analyzer`](/reference/elasticsearch/mapping-reference/analyzer.md). -If you want a single query that handles fields of different types like keywords or numbers, then the [`multi_match`](/reference/query-languages/query-dsl-multi-match-query.md) query may be a better fit. It supports both text and non-text fields, and accepts text fields that do not share the same analyzer. +If you want a single query that handles fields of different types like keywords or numbers, then the [`multi_match`](/reference/query-languages/query-dsl/query-dsl-multi-match-query.md) query may be a better fit. It supports both text and non-text fields, and accepts text fields that do not share the same analyzer. The main `multi_match` modes `best_fields` and `most_fields` take a field-centric view of the query. In contrast, `combined_fields` is term-centric: `operator` and `minimum_should_match` are applied per-term, instead of per-field. Concretely, a query like diff --git a/docs/reference/query-languages/query-dsl/query-dsl-constant-score-query.md b/docs/reference/query-languages/query-dsl/query-dsl-constant-score-query.md new file mode 100644 index 000000000000..e6bb940665bb --- /dev/null +++ b/docs/reference/query-languages/query-dsl/query-dsl-constant-score-query.md @@ -0,0 +1,37 @@ +--- +navigation_title: "Constant score" +mapped_pages: + - https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-constant-score-query.html +--- + +# Constant score query [query-dsl-constant-score-query] + + +Wraps a [filter query](/reference/query-languages/query-dsl/query-dsl-bool-query.md) and returns every matching document with a [relevance score](/reference/query-languages/query-dsl/query-filter-context.md#relevance-scores) equal to the `boost` parameter value. + +```console +GET /_search +{ + "query": { + "constant_score": { + "filter": { + "term": { "user.id": "kimchy" } + }, + "boost": 1.2 + } + } +} +``` + +## Top-level parameters for `constant_score` [constant-score-top-level-params] + +`filter` +: (Required, query object) [Filter query](/reference/query-languages/query-dsl/query-dsl-bool-query.md) you wish to run. Any returned documents must match this query. + +Filter queries do not calculate [relevance scores](/reference/query-languages/query-dsl/query-filter-context.md#relevance-scores). To speed up performance, {{es}} automatically caches frequently used filter queries. + + +`boost` +: (Optional, float) Floating point number used as the constant [relevance score](/reference/query-languages/query-dsl/query-filter-context.md#relevance-scores) for every document matching the `filter` query. Defaults to `1.0`. + + diff --git a/docs/reference/query-languages/query-dsl-dis-max-query.md b/docs/reference/query-languages/query-dsl/query-dsl-dis-max-query.md similarity index 90% rename from docs/reference/query-languages/query-dsl-dis-max-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-dis-max-query.md index 2775f744abc2..60f6843e4f9e 100644 --- a/docs/reference/query-languages/query-dsl-dis-max-query.md +++ b/docs/reference/query-languages/query-dsl/query-dsl-dis-max-query.md @@ -32,10 +32,10 @@ GET /_search ## Top-level parameters for `dis_max` [query-dsl-dis-max-query-top-level-params] `queries` -: (Required, array of query objects) Contains one or more query clauses. Returned documents **must match one or more** of these queries. If a document matches multiple queries, {{es}} uses the highest [relevance score](/reference/query-languages/query-filter-context.md). +: (Required, array of query objects) Contains one or more query clauses. Returned documents **must match one or more** of these queries. If a document matches multiple queries, {{es}} uses the highest [relevance score](/reference/query-languages/query-dsl/query-filter-context.md). `tie_breaker` -: (Optional, float) Floating point number between `0` and `1.0` used to increase the [relevance scores](/reference/query-languages/query-filter-context.md#relevance-scores) of documents matching multiple query clauses. Defaults to `0.0`. +: (Optional, float) Floating point number between `0` and `1.0` used to increase the [relevance scores](/reference/query-languages/query-dsl/query-filter-context.md#relevance-scores) of documents matching multiple query clauses. Defaults to `0.0`. You can use the `tie_breaker` value to assign higher relevance scores to documents that contain the same term in multiple fields than documents that contain this term in only the best of those multiple fields, without confusing this with the better case of two different terms in the multiple fields. diff --git a/docs/reference/query-languages/query-dsl-distance-feature-query.md b/docs/reference/query-languages/query-dsl/query-dsl-distance-feature-query.md similarity index 84% rename from docs/reference/query-languages/query-dsl-distance-feature-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-distance-feature-query.md index 592302dd696d..35a5a9ef36f2 100644 --- a/docs/reference/query-languages/query-dsl-distance-feature-query.md +++ b/docs/reference/query-languages/query-dsl/query-dsl-distance-feature-query.md @@ -7,9 +7,9 @@ mapped_pages: # Distance feature query [query-dsl-distance-feature-query] -Boosts the [relevance score](/reference/query-languages/query-filter-context.md#relevance-scores) of documents closer to a provided `origin` date or point. For example, you can use this query to give more weight to documents closer to a certain date or location. +Boosts the [relevance score](/reference/query-languages/query-dsl/query-filter-context.md#relevance-scores) of documents closer to a provided `origin` date or point. For example, you can use this query to give more weight to documents closer to a certain date or location. -You can use the `distance_feature` query to find the nearest neighbors to a location. You can also use the query in a [`bool`](/reference/query-languages/query-dsl-bool-query.md) search’s `should` filter to add boosted relevance scores to the `bool` query’s scores. +You can use the `distance_feature` query to find the nearest neighbors to a location. You can also use the query in a [`bool`](/reference/query-languages/query-dsl/query-dsl-bool-query.md) search’s `should` filter to add boosted relevance scores to the `bool` query’s scores. ## Example request [distance-feature-query-ex-request] @@ -157,7 +157,7 @@ If the `field` value is a [`geo_point`](/reference/elasticsearch/mapping-referen `boost` -: (Optional, float) Floating point number used to multiply the [relevance score](/reference/query-languages/query-filter-context.md#relevance-scores) of matching documents. This value cannot be negative. Defaults to `1.0`. +: (Optional, float) Floating point number used to multiply the [relevance score](/reference/query-languages/query-dsl/query-filter-context.md#relevance-scores) of matching documents. This value cannot be negative. Defaults to `1.0`. @@ -165,9 +165,9 @@ If the `field` value is a [`geo_point`](/reference/elasticsearch/mapping-referen ### How the `distance_feature` query calculates relevance scores [distance-feature-calculation] -The `distance_feature` query dynamically calculates the distance between the `origin` value and a document’s field values. It then uses this distance as a feature to boost the [relevance score](/reference/query-languages/query-filter-context.md#relevance-scores) of closer documents. +The `distance_feature` query dynamically calculates the distance between the `origin` value and a document’s field values. It then uses this distance as a feature to boost the [relevance score](/reference/query-languages/query-dsl/query-filter-context.md#relevance-scores) of closer documents. -The `distance_feature` query calculates a document’s [relevance score](/reference/query-languages/query-filter-context.md#relevance-scores) as follows: +The `distance_feature` query calculates a document’s [relevance score](/reference/query-languages/query-dsl/query-filter-context.md#relevance-scores) as follows: ``` relevance score = boost * pivot / (pivot + distance) @@ -178,4 +178,4 @@ The `distance` is the absolute difference between the `origin` value and a docum ### Skip non-competitive hits [distance-feature-skip-hits] -Unlike the [`function_score`](/reference/query-languages/query-dsl-function-score-query.md) query or other ways to change [relevance scores](/reference/query-languages/query-filter-context.md#relevance-scores), the `distance_feature` query efficiently skips non-competitive hits when the [`track_total_hits`](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search) parameter is **not** `true`. +Unlike the [`function_score`](/reference/query-languages/query-dsl/query-dsl-function-score-query.md) query or other ways to change [relevance scores](/reference/query-languages/query-dsl/query-filter-context.md#relevance-scores), the `distance_feature` query efficiently skips non-competitive hits when the [`track_total_hits`](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search) parameter is **not** `true`. diff --git a/docs/reference/query-languages/query-dsl-exists-query.md b/docs/reference/query-languages/query-dsl/query-dsl-exists-query.md similarity index 96% rename from docs/reference/query-languages/query-dsl-exists-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-exists-query.md index 29997fdfdaea..f6259aa76e7b 100644 --- a/docs/reference/query-languages/query-dsl-exists-query.md +++ b/docs/reference/query-languages/query-dsl/query-dsl-exists-query.md @@ -47,7 +47,7 @@ GET /_search ### Find documents missing indexed values [find-docs-null-values] -To find documents that are missing an indexed value for a field, use the `must_not` [boolean query](/reference/query-languages/query-dsl-bool-query.md) with the `exists` query. +To find documents that are missing an indexed value for a field, use the `must_not` [boolean query](/reference/query-languages/query-dsl/query-dsl-bool-query.md) with the `exists` query. The following search returns documents that are missing an indexed value for the `user.id` field. diff --git a/docs/reference/query-languages/query-dsl-function-score-query.md b/docs/reference/query-languages/query-dsl/query-dsl-function-score-query.md similarity index 95% rename from docs/reference/query-languages/query-dsl-function-score-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-function-score-query.md index 2829bd4adac5..68894d271f52 100644 --- a/docs/reference/query-languages/query-dsl-function-score-query.md +++ b/docs/reference/query-languages/query-dsl/query-dsl-function-score-query.md @@ -360,11 +360,11 @@ The `DECAY_FUNCTION` determines the shape of the decay: `gauss` : Normal decay, computed as: -![Gaussian](../../images/Gaussian.png "") +![Gaussian](/images/Gaussian.png "") -where ![sigma](../../images/sigma.png "") is computed to assure that the score takes the value `decay` at distance `scale` from `origin`+-`offset` +where ![sigma](/images/sigma.png "") is computed to assure that the score takes the value `decay` at distance `scale` from `origin`+-`offset` -![sigma calc](../../images/sigma_calc.png "") +![sigma calc](/images/sigma_calc.png "") See [Normal decay, keyword `gauss`](#gauss-decay) for graphs demonstrating the curve generated by the `gauss` function. @@ -372,11 +372,11 @@ See [Normal decay, keyword `gauss`](#gauss-decay) for graphs demonstrating the c `exp` : Exponential decay, computed as: -![Exponential](../../images/Exponential.png "") +![Exponential](/images/Exponential.png "") -where again the parameter ![lambda](../../images/lambda.png "") is computed to assure that the score takes the value `decay` at distance `scale` from `origin`+-`offset` +where again the parameter ![lambda](/images/lambda.png "") is computed to assure that the score takes the value `decay` at distance `scale` from `origin`+-`offset` -![lambda calc](../../images/lambda_calc.png "") +![lambda calc](/images/lambda_calc.png "") See [Exponential decay, keyword `exp`](#exp-decay) for graphs demonstrating the curve generated by the `exp` function. @@ -384,18 +384,18 @@ See [Exponential decay, keyword `exp`](#exp-decay) for graphs demonstrating the `linear` : Linear decay, computed as: -![Linear](../../images/Linear.png ""). +![Linear](/images/Linear.png ""). where again the parameter `s` is computed to assure that the score takes the value `decay` at distance `scale` from `origin`+-`offset` -![s calc](../../images/s_calc.png "") +![s calc](/images/s_calc.png "") In contrast to the normal and exponential decay, this function actually sets the score to 0 if the field value exceeds twice the user given scale value. For single functions the three decay functions together with their parameters can be visualized like this (the field in this example called "age"): -![decay 2d](../../images/decay_2d.png "") +![decay 2d](/images/decay_2d.png "") ### Multi-values fields [_multi_values_fields] @@ -510,10 +510,10 @@ Next, we show how the computed score looks like for each of the three possible d When choosing `gauss` as the decay function in the above example, the contour and surface plot of the multiplier looks like this: -:::{image} ../../images/normal-decay-keyword-gauss-1.png +:::{image} /images/normal-decay-keyword-gauss-1.png ::: -:::{image} ../../images/normal-decay-keyword-gauss-2.png +:::{image} /images/normal-decay-keyword-gauss-2.png ::: Suppose your original search results matches three hotels : @@ -529,20 +529,20 @@ Suppose your original search results matches three hotels : When choosing `exp` as the decay function in the above example, the contour and surface plot of the multiplier looks like this: -:::{image} ../../images/exponential-decay-keyword-exp-1.png +:::{image} /images/exponential-decay-keyword-exp-1.png ::: -:::{image} ../../images/exponential-decay-keyword-exp-2.png +:::{image} /images/exponential-decay-keyword-exp-2.png ::: ### Linear decay, keyword `linear` [linear-decay] When choosing `linear` as the decay function in the above example, the contour and surface plot of the multiplier looks like this: -:::{image} ../../images/linear-decay-keyword-linear-1.png +:::{image} /images/linear-decay-keyword-linear-1.png ::: -:::{image} ../../images/linear-decay-keyword-linear-2.png +:::{image} /images/linear-decay-keyword-linear-2.png ::: ## Supported fields for decay functions [_supported_fields_for_decay_functions] diff --git a/docs/reference/query-languages/query-dsl-fuzzy-query.md b/docs/reference/query-languages/query-dsl/query-dsl-fuzzy-query.md similarity index 97% rename from docs/reference/query-languages/query-dsl-fuzzy-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-fuzzy-query.md index f8f720219bd2..5802502687bd 100644 --- a/docs/reference/query-languages/query-dsl-fuzzy-query.md +++ b/docs/reference/query-languages/query-dsl/query-dsl-fuzzy-query.md @@ -88,7 +88,7 @@ Avoid using a high value in the `max_expansions` parameter, especially if the `p : (Optional, Boolean) Indicates whether edits include transpositions of two adjacent characters (ab → ba). Defaults to `true`. `rewrite` -: (Optional, string) Method used to rewrite the query. For valid values and more information, see the [`rewrite` parameter](/reference/query-languages/query-dsl-multi-term-rewrite.md). +: (Optional, string) Method used to rewrite the query. For valid values and more information, see the [`rewrite` parameter](/reference/query-languages/query-dsl/query-dsl-multi-term-rewrite.md). ## Notes [fuzzy-query-notes] diff --git a/docs/reference/query-languages/query-dsl-geo-bounding-box-query.md b/docs/reference/query-languages/query-dsl/query-dsl-geo-bounding-box-query.md similarity index 100% rename from docs/reference/query-languages/query-dsl-geo-bounding-box-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-geo-bounding-box-query.md diff --git a/docs/reference/query-languages/query-dsl-geo-distance-query.md b/docs/reference/query-languages/query-dsl/query-dsl-geo-distance-query.md similarity index 100% rename from docs/reference/query-languages/query-dsl-geo-distance-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-geo-distance-query.md diff --git a/docs/reference/query-languages/query-dsl-geo-grid-query.md b/docs/reference/query-languages/query-dsl/query-dsl-geo-grid-query.md similarity index 100% rename from docs/reference/query-languages/query-dsl-geo-grid-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-geo-grid-query.md diff --git a/docs/reference/query-languages/query-dsl-geo-polygon-query.md b/docs/reference/query-languages/query-dsl/query-dsl-geo-polygon-query.md similarity index 93% rename from docs/reference/query-languages/query-dsl-geo-polygon-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-geo-polygon-query.md index 95081e413407..57eb679cbdf5 100644 --- a/docs/reference/query-languages/query-dsl-geo-polygon-query.md +++ b/docs/reference/query-languages/query-dsl/query-dsl-geo-polygon-query.md @@ -10,7 +10,7 @@ mapped_pages: ::::{admonition} Deprecated in 7.12. :class: warning -Use [Geoshape](/reference/query-languages/query-dsl-geo-shape-query.md) instead where polygons are defined in GeoJSON or [Well-Known Text (WKT)](http://docs.opengeospatial.org/is/18-010r7/18-010r7.html). +Use [Geoshape](/reference/query-languages/query-dsl/query-dsl-geo-shape-query.md) instead where polygons are defined in GeoJSON or [Well-Known Text (WKT)](http://docs.opengeospatial.org/is/18-010r7/18-010r7.html). :::: diff --git a/docs/reference/query-languages/query-dsl-geo-shape-query.md b/docs/reference/query-languages/query-dsl/query-dsl-geo-shape-query.md similarity index 100% rename from docs/reference/query-languages/query-dsl-geo-shape-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-geo-shape-query.md diff --git a/docs/reference/query-languages/query-dsl-has-child-query.md b/docs/reference/query-languages/query-dsl/query-dsl-has-child-query.md similarity index 97% rename from docs/reference/query-languages/query-dsl-has-child-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-has-child-query.md index cb37096b5b04..3e0f2e6051aa 100644 --- a/docs/reference/query-languages/query-dsl-has-child-query.md +++ b/docs/reference/query-languages/query-dsl/query-dsl-has-child-query.md @@ -84,7 +84,7 @@ You can use this parameter to query multiple indices that may not contain the `t : (Optional, integer) Minimum number of child documents that match the `query` required to match the query for a returned parent document. If the parent document does not meet this limit, it is excluded from the search results. `score_mode` -: (Optional, string) Indicates how scores for matching child documents affect the root parent document’s [relevance score](/reference/query-languages/query-filter-context.md#relevance-scores). Valid values are: +: (Optional, string) Indicates how scores for matching child documents affect the root parent document’s [relevance score](/reference/query-languages/query-dsl/query-filter-context.md#relevance-scores). Valid values are: `none` (Default) : Do not use the relevance scores of matching child documents. The query assigns parent documents a score of `0`. diff --git a/docs/reference/query-languages/query-dsl-has-parent-query.md b/docs/reference/query-languages/query-dsl/query-dsl-has-parent-query.md similarity index 95% rename from docs/reference/query-languages/query-dsl-has-parent-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-has-parent-query.md index 74fa3b4cfdeb..9ae1189ba091 100644 --- a/docs/reference/query-languages/query-dsl-has-parent-query.md +++ b/docs/reference/query-languages/query-dsl/query-dsl-has-parent-query.md @@ -72,7 +72,7 @@ GET /my-index-000001/_search : (Required, query object) Query you wish to run on parent documents of the `parent_type` field. If a parent document matches the search, the query returns its child documents. `score` -: (Optional, Boolean) Indicates whether the [relevance score](/reference/query-languages/query-filter-context.md) of a matching parent document is aggregated into its child documents. Defaults to `false`. +: (Optional, Boolean) Indicates whether the [relevance score](/reference/query-languages/query-dsl/query-filter-context.md) of a matching parent document is aggregated into its child documents. Defaults to `false`. If `false`, {{es}} ignores the relevance score of the parent document. {{es}} also assigns each child document a relevance score equal to the `query`'s `boost`, which defaults to `1`. diff --git a/docs/reference/query-languages/query-dsl-ids-query.md b/docs/reference/query-languages/query-dsl/query-dsl-ids-query.md similarity index 100% rename from docs/reference/query-languages/query-dsl-ids-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-ids-query.md diff --git a/docs/reference/query-languages/query-dsl-intervals-query.md b/docs/reference/query-languages/query-dsl/query-dsl-intervals-query.md similarity index 99% rename from docs/reference/query-languages/query-dsl-intervals-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-intervals-query.md index 5ce62227a25b..0c84d085947f 100644 --- a/docs/reference/query-languages/query-dsl-intervals-query.md +++ b/docs/reference/query-languages/query-dsl/query-dsl-intervals-query.md @@ -149,7 +149,7 @@ The `pattern` is normalized using the search analyzer from this field, unless `a The `regexp` rule matches terms using a regular expression pattern. This pattern can expand to match at most `indices.query.bool.max_clause_count` [search setting](/reference/elasticsearch/configuration-reference/search-settings.md) terms. If the pattern matches more terms,{{es}} returns an error. `pattern` -: (Required, string) Regexp pattern used to find matching terms. For a list of operators supported by the `regexp` pattern, see [Regular expression syntax](/reference/query-languages/regexp-syntax.md). +: (Required, string) Regexp pattern used to find matching terms. For a list of operators supported by the `regexp` pattern, see [Regular expression syntax](/reference/query-languages/query-dsl/regexp-syntax.md). ::::{warning} Avoid using wildcard patterns, such as `.*` or `.*?+``. This can increase the iterations needed to find matching terms and slow search performance. diff --git a/docs/reference/query-languages/query-dsl-knn-query.md b/docs/reference/query-languages/query-dsl/query-dsl-knn-query.md similarity index 100% rename from docs/reference/query-languages/query-dsl-knn-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-knn-query.md diff --git a/docs/reference/query-languages/query-dsl-match-all-query.md b/docs/reference/query-languages/query-dsl/query-dsl-match-all-query.md similarity index 100% rename from docs/reference/query-languages/query-dsl-match-all-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-match-all-query.md diff --git a/docs/reference/query-languages/query-dsl/query-dsl-match-bool-prefix-query.md b/docs/reference/query-languages/query-dsl/query-dsl-match-bool-prefix-query.md new file mode 100644 index 000000000000..fd6785f702d5 --- /dev/null +++ b/docs/reference/query-languages/query-dsl/query-dsl-match-bool-prefix-query.md @@ -0,0 +1,64 @@ +--- +navigation_title: "Match boolean prefix" +mapped_pages: + - https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-bool-prefix-query.html +--- + +# Match boolean prefix query [query-dsl-match-bool-prefix-query] + + +A `match_bool_prefix` query analyzes its input and constructs a [`bool` query](/reference/query-languages/query-dsl/query-dsl-bool-query.md) from the terms. Each term except the last is used in a `term` query. The last term is used in a `prefix` query. A `match_bool_prefix` query such as + +```console +GET /_search +{ + "query": { + "match_bool_prefix" : { + "message" : "quick brown f" + } + } +} +``` + +where analysis produces the terms `quick`, `brown`, and `f` is similar to the following `bool` query + +```console +GET /_search +{ + "query": { + "bool" : { + "should": [ + { "term": { "message": "quick" }}, + { "term": { "message": "brown" }}, + { "prefix": { "message": "f"}} + ] + } + } +} +``` + +An important difference between the `match_bool_prefix` query and [`match_phrase_prefix`](/reference/query-languages/query-dsl/query-dsl-match-query-phrase-prefix.md) is that the `match_phrase_prefix` query matches its terms as a phrase, but the `match_bool_prefix` query can match its terms in any position. The example `match_bool_prefix` query above could match a field containing `quick brown fox`, but it could also match `brown fox quick`. It could also match a field containing the term `quick`, the term `brown` and a term starting with `f`, appearing in any position. + +## Parameters [_parameters] + +By default, `match_bool_prefix` queries' input text will be analyzed using the analyzer from the queried field’s mapping. A different search analyzer can be configured with the `analyzer` parameter + +```console +GET /_search +{ + "query": { + "match_bool_prefix": { + "message": { + "query": "quick brown f", + "analyzer": "keyword" + } + } + } +} +``` + +`match_bool_prefix` queries support the [`minimum_should_match`](/reference/query-languages/query-dsl/query-dsl-minimum-should-match.md) and `operator` parameters as described for the [`match` query](/reference/query-languages/query-dsl/query-dsl-match-query.md#query-dsl-match-query-boolean), applying the setting to the constructed `bool` query. The number of clauses in the constructed `bool` query will in most cases be the number of terms produced by analysis of the query text. + +The [`fuzziness`](/reference/query-languages/query-dsl/query-dsl-match-query.md#query-dsl-match-query-fuzziness), `prefix_length`, `max_expansions`, `fuzzy_transpositions`, and `fuzzy_rewrite` parameters can be applied to the `term` subqueries constructed for all terms but the final term. They do not have any effect on the prefix query constructed for the final term. + + diff --git a/docs/reference/query-languages/query-dsl-match-query-phrase-prefix.md b/docs/reference/query-languages/query-dsl/query-dsl-match-query-phrase-prefix.md similarity index 92% rename from docs/reference/query-languages/query-dsl-match-query-phrase-prefix.md rename to docs/reference/query-languages/query-dsl/query-dsl-match-query-phrase-prefix.md index 5fe922e99cfd..00af71cac505 100644 --- a/docs/reference/query-languages/query-dsl-match-query-phrase-prefix.md +++ b/docs/reference/query-languages/query-dsl/query-dsl-match-query-phrase-prefix.md @@ -7,7 +7,7 @@ mapped_pages: # Match phrase prefix query [query-dsl-match-query-phrase-prefix] -Returns documents that contain the words of a provided text, in the **same order** as provided. The last term of the provided text is treated as a [prefix](/reference/query-languages/query-dsl-prefix-query.md), matching any words that begin with that term. +Returns documents that contain the words of a provided text, in the **same order** as provided. The last term of the provided text is treated as a [prefix](/reference/query-languages/query-dsl/query-dsl-prefix-query.md), matching any words that begin with that term. ## Example request [match-phrase-prefix-query-ex-request] @@ -40,7 +40,7 @@ GET /_search `query` : (Required, string) Text you wish to find in the provided ``. -The `match_phrase_prefix` query [analyzes](docs-content://manage-data/data-store/text-analysis.md) any provided text into tokens before performing a search. The last term of this text is treated as a [prefix](/reference/query-languages/query-dsl-prefix-query.md), matching any words that begin with that term. +The `match_phrase_prefix` query [analyzes](docs-content://manage-data/data-store/text-analysis.md) any provided text into tokens before performing a search. The last term of this text is treated as a [prefix](/reference/query-languages/query-dsl/query-dsl-prefix-query.md), matching any words that begin with that term. `analyzer` @@ -59,7 +59,7 @@ The `match_phrase_prefix` query [analyzes](docs-content://manage-data/data-store : No documents are returned if the `analyzer` removes all tokens. `all` -: Returns all documents, similar to a [`match_all`](/reference/query-languages/query-dsl-match-all-query.md) query. +: Returns all documents, similar to a [`match_all`](/reference/query-languages/query-dsl/query-dsl-match-all-query.md) query. diff --git a/docs/reference/query-languages/query-dsl-match-query-phrase.md b/docs/reference/query-languages/query-dsl/query-dsl-match-query-phrase.md similarity index 96% rename from docs/reference/query-languages/query-dsl-match-query-phrase.md rename to docs/reference/query-languages/query-dsl/query-dsl-match-query-phrase.md index f5fbfd9362c9..7d90dab993b2 100644 --- a/docs/reference/query-languages/query-dsl-match-query-phrase.md +++ b/docs/reference/query-languages/query-dsl/query-dsl-match-query-phrase.md @@ -39,7 +39,7 @@ GET /_search : No documents are returned if the `analyzer` removes all tokens. `all` -: Returns all documents, similar to a [`match_all`](/reference/query-languages/query-dsl-match-all-query.md) query. +: Returns all documents, similar to a [`match_all`](/reference/query-languages/query-dsl/query-dsl-match-all-query.md) query. A phrase query matches terms up to a configurable `slop` (which defaults to 0) in any order. Transposed terms have a slop of 2. diff --git a/docs/reference/query-languages/query-dsl-match-query.md b/docs/reference/query-languages/query-dsl/query-dsl-match-query.md similarity index 91% rename from docs/reference/query-languages/query-dsl-match-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-match-query.md index 19f60ddfc802..7ccf064cac88 100644 --- a/docs/reference/query-languages/query-dsl-match-query.md +++ b/docs/reference/query-languages/query-dsl/query-dsl-match-query.md @@ -47,13 +47,13 @@ The `match` query [analyzes](docs-content://manage-data/data-store/text-analysis : (Optional, string) [Analyzer](docs-content://manage-data/data-store/text-analysis.md) used to convert the text in the `query` value into tokens. Defaults to the [index-time analyzer](docs-content://manage-data/data-store/text-analysis/specify-an-analyzer.md#specify-index-time-analyzer) mapped for the ``. If no analyzer is mapped, the index’s default analyzer is used. `auto_generate_synonyms_phrase_query` -: (Optional, Boolean) If `true`, [match phrase](/reference/query-languages/query-dsl-match-query-phrase.md) queries are automatically created for multi-term synonyms. Defaults to `true`. +: (Optional, Boolean) If `true`, [match phrase](/reference/query-languages/query-dsl/query-dsl-match-query-phrase.md) queries are automatically created for multi-term synonyms. Defaults to `true`. See [Use synonyms with match query](#query-dsl-match-query-synonyms) for an example. `boost` -: (Optional, float) Floating point number used to decrease or increase the [relevance scores](/reference/query-languages/query-filter-context.md#relevance-scores) of the query. Defaults to `1.0`. +: (Optional, float) Floating point number used to decrease or increase the [relevance scores](/reference/query-languages/query-dsl/query-filter-context.md#relevance-scores) of the query. Defaults to `1.0`. Boost values are relative to the default value of `1.0`. A boost value between `0` and `1.0` decreases the relevance score. A value greater than `1.0` increases the relevance score. @@ -71,7 +71,7 @@ Boost values are relative to the default value of `1.0`. A boost value between ` : (Optional, Boolean) If `true`, edits for fuzzy matching include transpositions of two adjacent characters (ab → ba). Defaults to `true`. `fuzzy_rewrite` -: (Optional, string) Method used to rewrite the query. See the [`rewrite` parameter](/reference/query-languages/query-dsl-multi-term-rewrite.md) for valid values and more information. +: (Optional, string) Method used to rewrite the query. See the [`rewrite` parameter](/reference/query-languages/query-dsl/query-dsl-multi-term-rewrite.md) for valid values and more information. If the `fuzziness` parameter is not `0`, the `match` query uses a `fuzzy_rewrite` method of `top_terms_blended_freqs_${max_expansions}` by default. @@ -90,7 +90,7 @@ If the `fuzziness` parameter is not `0`, the `match` query uses a `fuzzy_rewrite `minimum_should_match` -: (Optional, string) Minimum number of clauses that must match for a document to be returned. See the [`minimum_should_match` parameter](/reference/query-languages/query-dsl-minimum-should-match.md) for valid values and more information. +: (Optional, string) Minimum number of clauses that must match for a document to be returned. See the [`minimum_should_match` parameter](/reference/query-languages/query-dsl/query-dsl-minimum-should-match.md) for valid values and more information. `zero_terms_query` @@ -100,7 +100,7 @@ If the `fuzziness` parameter is not `0`, the `match` query uses a `fuzzy_rewrite : No documents are returned if the `analyzer` removes all tokens. `all` -: Returns all documents, similar to a [`match_all`](/reference/query-languages/query-dsl-match-all-query.md) query. +: Returns all documents, similar to a [`match_all`](/reference/query-languages/query-dsl/query-dsl-match-all-query.md) query. See [Zero terms query](#query-dsl-match-query-zero) for an example. @@ -126,7 +126,7 @@ GET /_search ### How the match query works [query-dsl-match-query-boolean] -The `match` query is of type `boolean`. It means that the text provided is analyzed and the analysis process constructs a boolean query from the provided text. The `operator` parameter can be set to `or` or `and` to control the boolean clauses (defaults to `or`). The minimum number of optional `should` clauses to match can be set using the [`minimum_should_match`](/reference/query-languages/query-dsl-minimum-should-match.md) parameter. +The `match` query is of type `boolean`. It means that the text provided is analyzed and the analysis process constructs a boolean query from the provided text. The `operator` parameter can be set to `or` or `and` to control the boolean clauses (defaults to `or`). The minimum number of optional `should` clauses to match can be set using the [`minimum_should_match`](/reference/query-languages/query-dsl/query-dsl-minimum-should-match.md) parameter. Here is an example with the `operator` parameter: @@ -153,7 +153,7 @@ The `lenient` parameter can be set to `true` to ignore exceptions caused by data `fuzziness` allows *fuzzy matching* based on the type of field being queried. See [Fuzziness](/reference/elasticsearch/rest-apis/common-options.md#fuzziness) for allowed settings. -The `prefix_length` and `max_expansions` can be set in this case to control the fuzzy process. If the fuzzy option is set the query will use `top_terms_blended_freqs_${max_expansions}` as its [rewrite method](/reference/query-languages/query-dsl-multi-term-rewrite.md) the `fuzzy_rewrite` parameter allows to control how the query will get rewritten. +The `prefix_length` and `max_expansions` can be set in this case to control the fuzzy process. If the fuzzy option is set the query will use `top_terms_blended_freqs_${max_expansions}` as its [rewrite method](/reference/query-languages/query-dsl/query-dsl-multi-term-rewrite.md) the `fuzzy_rewrite` parameter allows to control how the query will get rewritten. Fuzzy transpositions (`ab` → `ba`) are allowed by default but can be disabled by setting `fuzzy_transpositions` to `false`. diff --git a/docs/reference/query-languages/query-dsl-minimum-should-match.md b/docs/reference/query-languages/query-dsl/query-dsl-minimum-should-match.md similarity index 100% rename from docs/reference/query-languages/query-dsl-minimum-should-match.md rename to docs/reference/query-languages/query-dsl/query-dsl-minimum-should-match.md diff --git a/docs/reference/query-languages/query-dsl-mlt-query.md b/docs/reference/query-languages/query-dsl/query-dsl-mlt-query.md similarity index 98% rename from docs/reference/query-languages/query-dsl-mlt-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-mlt-query.md index 17ef4afa3240..74f04c4f02d3 100644 --- a/docs/reference/query-languages/query-dsl-mlt-query.md +++ b/docs/reference/query-languages/query-dsl/query-dsl-mlt-query.md @@ -135,7 +135,7 @@ The only required parameter is `like`, all other parameters have sensible defaul : The `unlike` parameter is used in conjunction with `like` in order not to select terms found in a chosen set of documents. In other words, we could ask for documents `like: "Apple"`, but `unlike: "cake crumble tree"`. The syntax is the same as `like`. `fields` -: A list of fields to fetch and analyze the text from. Defaults to the `index.query.default_field` index setting, which has a default value of `*`. The `*` value matches all fields eligible for [term-level queries](/reference/query-languages/term-level-queries.md), excluding metadata fields. +: A list of fields to fetch and analyze the text from. Defaults to the `index.query.default_field` index setting, which has a default value of `*`. The `*` value matches all fields eligible for [term-level queries](/reference/query-languages/query-dsl/term-level-queries.md), excluding metadata fields. ### Term selection parameters [mlt-query-term-selection] @@ -168,7 +168,7 @@ The only required parameter is `like`, all other parameters have sensible defaul ### Query formation parameters [_query_formation_parameters] `minimum_should_match` -: After the disjunctive query has been formed, this parameter controls the number of terms that must match. The syntax is the same as the [minimum should match](/reference/query-languages/query-dsl-minimum-should-match.md). (Defaults to `"30%"`). +: After the disjunctive query has been formed, this parameter controls the number of terms that must match. The syntax is the same as the [minimum should match](/reference/query-languages/query-dsl/query-dsl-minimum-should-match.md). (Defaults to `"30%"`). `fail_on_unsupported_field` : Controls whether the query should fail (throw an exception) if any of the specified fields are not of the supported types (`text` or `keyword`). Set this to `false` to ignore the field and continue processing. Defaults to `true`. diff --git a/docs/reference/query-languages/query-dsl-multi-match-query.md b/docs/reference/query-languages/query-dsl/query-dsl-multi-match-query.md similarity index 90% rename from docs/reference/query-languages/query-dsl-multi-match-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-multi-match-query.md index ca2c472e9251..166c62b4b132 100644 --- a/docs/reference/query-languages/query-dsl-multi-match-query.md +++ b/docs/reference/query-languages/query-dsl/query-dsl-multi-match-query.md @@ -7,7 +7,7 @@ mapped_pages: # Multi-match query [query-dsl-multi-match-query] -The `multi_match` query builds on the [`match` query](/reference/query-languages/query-dsl-match-query.md) to allow multi-field queries: +The `multi_match` query builds on the [`match` query](/reference/query-languages/query-dsl/query-dsl-match-query.md) to allow multi-field queries: ```console GET /_search @@ -99,7 +99,7 @@ The way the `multi_match` query is executed internally depends on the `type` par The `best_fields` type is most useful when you are searching for multiple words best found in the same field. For instance brown fox in a single field is more meaningful than brown in one field and fox in the other. -The `best_fields` type generates a [`match` query](/reference/query-languages/query-dsl-match-query.md) for each field and wraps them in a [`dis_max`](/reference/query-languages/query-dsl-dis-max-query.md) query, to find the single best matching field. For instance, this query: +The `best_fields` type generates a [`match` query](/reference/query-languages/query-dsl/query-dsl-match-query.md) for each field and wraps them in a [`dis_max`](/reference/query-languages/query-dsl/query-dsl-dis-max-query.md) query, to find the single best matching field. For instance, this query: ```console GET /_search @@ -137,7 +137,7 @@ Normally the `best_fields` type uses the score of the **single** best matching f * the score from the best matching field * plus `tie_breaker * _score` for all other matching fields -Also, accepts `analyzer`, `boost`, `operator`, `minimum_should_match`, `fuzziness`, `lenient`, `prefix_length`, `max_expansions`, `fuzzy_rewrite`, `zero_terms_query`, `auto_generate_synonyms_phrase_query` and `fuzzy_transpositions`, as explained in [match query](/reference/query-languages/query-dsl-match-query.md). +Also, accepts `analyzer`, `boost`, `operator`, `minimum_should_match`, `fuzziness`, `lenient`, `prefix_length`, `max_expansions`, `fuzzy_rewrite`, `zero_terms_query`, `auto_generate_synonyms_phrase_query` and `fuzzy_transpositions`, as explained in [match query](/reference/query-languages/query-dsl/query-dsl-match-query.md). ::::{admonition} `operator` and `minimum_should_match` :class: important @@ -173,7 +173,7 @@ This query is executed as: ``` In other words, **all terms** must be present **in a single field** for a document to match. -The [`combined_fields`](/reference/query-languages/query-dsl-combined-fields-query.md) query offers a term-centric approach that handles `operator` and `minimum_should_match` on a per-term basis. The other multi-match mode [`cross_fields`](#type-cross-fields) also addresses this issue. +The [`combined_fields`](/reference/query-languages/query-dsl/query-dsl-combined-fields-query.md) query offers a term-centric approach that handles `operator` and `minimum_should_match` on a per-term basis. The other multi-match mode [`cross_fields`](#type-cross-fields) also addresses this issue. :::: @@ -255,7 +255,7 @@ GET /_search } ``` -Also, accepts `analyzer`, `boost`, `lenient` and `zero_terms_query` as explained in [Match](/reference/query-languages/query-dsl-match-query.md), as well as `slop` which is explained in [Match phrase](/reference/query-languages/query-dsl-match-query-phrase.md). Type `phrase_prefix` additionally accepts `max_expansions`. +Also, accepts `analyzer`, `boost`, `lenient` and `zero_terms_query` as explained in [Match](/reference/query-languages/query-dsl/query-dsl-match-query.md), as well as `slop` which is explained in [Match phrase](/reference/query-languages/query-dsl/query-dsl-match-query-phrase.md). Type `phrase_prefix` additionally accepts `max_expansions`. ::::{admonition} `phrase`, `phrase_prefix` and `fuzziness` :class: important @@ -327,7 +327,7 @@ If you run the above query through the [Validate](https://www.elastic.co/docs/ap Also, accepts `analyzer`, `boost`, `operator`, `minimum_should_match`, `lenient` and `zero_terms_query`. ::::{warning} -The `cross_fields` type blends field statistics in a complex way that can be hard to interpret. The score combination can even be incorrect, in particular when some documents contain some of the search fields, but not all of them. You should consider the [`combined_fields`](/reference/query-languages/query-dsl-combined-fields-query.md) query as an alternative, which is also term-centric but combines field statistics in a more robust way. +The `cross_fields` type blends field statistics in a complex way that can be hard to interpret. The score combination can even be incorrect, in particular when some documents contain some of the search fields, but not all of them. You should consider the [`combined_fields`](/reference/query-languages/query-dsl/query-dsl-combined-fields-query.md) query as an alternative, which is also term-centric but combines field statistics in a more robust way. :::: @@ -452,7 +452,7 @@ The `fuzziness` parameter cannot be used with the `cross_fields` type. ## `bool_prefix` [type-bool-prefix] -The `bool_prefix` type’s scoring behaves like [`most_fields`](#type-most-fields), but using a [`match_bool_prefix` query](/reference/query-languages/query-dsl-match-bool-prefix-query.md) instead of a `match` query. +The `bool_prefix` type’s scoring behaves like [`most_fields`](#type-most-fields), but using a [`match_bool_prefix` query](/reference/query-languages/query-dsl/query-dsl-match-bool-prefix-query.md) instead of a `match` query. ```console GET /_search @@ -467,7 +467,7 @@ GET /_search } ``` -The `analyzer`, `boost`, `operator`, `minimum_should_match`, `lenient`, `zero_terms_query`, and `auto_generate_synonyms_phrase_query` parameters as explained in [match query](/reference/query-languages/query-dsl-match-query.md) are supported. The `fuzziness`, `prefix_length`, `max_expansions`, `fuzzy_rewrite`, and `fuzzy_transpositions` parameters are supported for the terms that are used to construct term queries, but do not have an effect on the prefix query constructed from the final term. +The `analyzer`, `boost`, `operator`, `minimum_should_match`, `lenient`, `zero_terms_query`, and `auto_generate_synonyms_phrase_query` parameters as explained in [match query](/reference/query-languages/query-dsl/query-dsl-match-query.md) are supported. The `fuzziness`, `prefix_length`, `max_expansions`, `fuzzy_rewrite`, and `fuzzy_transpositions` parameters are supported for the terms that are used to construct term queries, but do not have an effect on the prefix query constructed from the final term. The `slop` parameter is not supported by this query type. diff --git a/docs/reference/query-languages/query-dsl-multi-term-rewrite.md b/docs/reference/query-languages/query-dsl/query-dsl-multi-term-rewrite.md similarity index 71% rename from docs/reference/query-languages/query-dsl-multi-term-rewrite.md rename to docs/reference/query-languages/query-dsl/query-dsl-multi-term-rewrite.md index 98e19a5d5a40..647fef99b701 100644 --- a/docs/reference/query-languages/query-dsl-multi-term-rewrite.md +++ b/docs/reference/query-languages/query-dsl/query-dsl-multi-term-rewrite.md @@ -12,13 +12,13 @@ This parameter is for expert users only. Changing the value of this parameter ca {{es}} uses [Apache Lucene](https://lucene.apache.org/core/) internally to power indexing and searching. In their original form, Lucene cannot execute the following queries: -* [`fuzzy`](/reference/query-languages/query-dsl-fuzzy-query.md) -* [`prefix`](/reference/query-languages/query-dsl-prefix-query.md) -* [`query_string`](/reference/query-languages/query-dsl-query-string-query.md) -* [`regexp`](/reference/query-languages/query-dsl-regexp-query.md) -* [`wildcard`](/reference/query-languages/query-dsl-wildcard-query.md) +* [`fuzzy`](/reference/query-languages/query-dsl/query-dsl-fuzzy-query.md) +* [`prefix`](/reference/query-languages/query-dsl/query-dsl-prefix-query.md) +* [`query_string`](/reference/query-languages/query-dsl/query-dsl-query-string-query.md) +* [`regexp`](/reference/query-languages/query-dsl/query-dsl-regexp-query.md) +* [`wildcard`](/reference/query-languages/query-dsl/query-dsl-wildcard-query.md) -To execute them, Lucene changes these queries to a simpler form, such as a [`bool` query](/reference/query-languages/query-dsl-bool-query.md) or a [bit set](https://en.wikipedia.org/wiki/Bit_array). +To execute them, Lucene changes these queries to a simpler form, such as a [`bool` query](/reference/query-languages/query-dsl/query-dsl-bool-query.md) or a [bit set](https://en.wikipedia.org/wiki/Bit_array). The `rewrite` parameter determines: @@ -32,7 +32,7 @@ The `rewrite` parameter determines: `constant_score_blended` (Default) : Assigns each document a relevance score equal to the `boost` parameter. - This method maintains a [`bool` query](/reference/query-languages/query-dsl-bool-query.md) like implementation over the most costly terms while pre-processing the less costly terms into a filter bitset. + This method maintains a [`bool` query](/reference/query-languages/query-dsl/query-dsl-bool-query.md) like implementation over the most costly terms while pre-processing the less costly terms into a filter bitset. This method can cause the generated `bool` query to exceed the clause limit in the [`indices.query.bool.max_clause_count`](/reference/elasticsearch/configuration-reference/search-settings.md#indices-query-bool-max-clause-count) setting. If the query exceeds this limit, {{es}} returns an error. @@ -43,7 +43,7 @@ The `rewrite` parameter determines: `constant_score_boolean` : Assigns each document a relevance score equal to the `boost` parameter. - This method changes the original query to a [`bool` query](/reference/query-languages/query-dsl-bool-query.md). This `bool` query contains a `should` clause and [`term` query](/reference/query-languages/query-dsl-term-query.md) for each matching term. + This method changes the original query to a [`bool` query](/reference/query-languages/query-dsl/query-dsl-bool-query.md). This `bool` query contains a `should` clause and [`term` query](/reference/query-languages/query-dsl/query-dsl-term-query.md) for each matching term. This method can cause the final `bool` query to exceed the clause limit in the [`indices.query.bool.max_clause_count`](/reference/elasticsearch/configuration-reference/search-settings.md#indices-query-bool-max-clause-count) setting. If the query exceeds this limit, {{es}} returns an error. @@ -51,7 +51,7 @@ The `rewrite` parameter determines: `scoring_boolean` : Calculates a relevance score for each matching document. - This method changes the original query to a [`bool` query](/reference/query-languages/query-dsl-bool-query.md). This `bool` query contains a `should` clause and [`term` query](/reference/query-languages/query-dsl-term-query.md) for each matching term. + This method changes the original query to a [`bool` query](/reference/query-languages/query-dsl/query-dsl-bool-query.md). This `bool` query contains a `should` clause and [`term` query](/reference/query-languages/query-dsl/query-dsl-term-query.md) for each matching term. This method can cause the final `bool` query to exceed the clause limit in the [`indices.query.bool.max_clause_count`](/reference/elasticsearch/configuration-reference/search-settings.md#indices-query-bool-max-clause-count) setting. If the query exceeds this limit, {{es}} returns an error. @@ -59,7 +59,7 @@ The `rewrite` parameter determines: `top_terms_blended_freqs_N` : Calculates a relevance score for each matching document as if all terms had the same frequency. This frequency is the maximum frequency of all matching terms. - This method changes the original query to a [`bool` query](/reference/query-languages/query-dsl-bool-query.md). This `bool` query contains a `should` clause and [`term` query](/reference/query-languages/query-dsl-term-query.md) for each matching term. + This method changes the original query to a [`bool` query](/reference/query-languages/query-dsl/query-dsl-bool-query.md). This `bool` query contains a `should` clause and [`term` query](/reference/query-languages/query-dsl/query-dsl-term-query.md) for each matching term. The final `bool` query only includes `term` queries for the top `N` scoring terms. @@ -69,7 +69,7 @@ The `rewrite` parameter determines: `top_terms_boost_N` : Assigns each matching document a relevance score equal to the `boost` parameter. - This method changes the original query to a [`bool` query](/reference/query-languages/query-dsl-bool-query.md). This `bool` query contains a `should` clause and [`term` query](/reference/query-languages/query-dsl-term-query.md) for each matching term. + This method changes the original query to a [`bool` query](/reference/query-languages/query-dsl/query-dsl-bool-query.md). This `bool` query contains a `should` clause and [`term` query](/reference/query-languages/query-dsl/query-dsl-term-query.md) for each matching term. The final `bool` query only includes `term` queries for the top `N` terms. @@ -79,7 +79,7 @@ The `rewrite` parameter determines: `top_terms_N` : Calculates a relevance score for each matching document. - This method changes the original query to a [`bool` query](/reference/query-languages/query-dsl-bool-query.md). This `bool` query contains a `should` clause and [`term` query](/reference/query-languages/query-dsl-term-query.md) for each matching term. + This method changes the original query to a [`bool` query](/reference/query-languages/query-dsl/query-dsl-bool-query.md). This `bool` query contains a `should` clause and [`term` query](/reference/query-languages/query-dsl/query-dsl-term-query.md) for each matching term. The final `bool` query only includes `term` queries for the top `N` scoring terms. diff --git a/docs/reference/query-languages/query-dsl-nested-query.md b/docs/reference/query-languages/query-dsl/query-dsl-nested-query.md similarity index 96% rename from docs/reference/query-languages/query-dsl-nested-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-nested-query.md index 16f431caf023..f0bce1532546 100644 --- a/docs/reference/query-languages/query-dsl-nested-query.md +++ b/docs/reference/query-languages/query-dsl/query-dsl-nested-query.md @@ -71,7 +71,7 @@ See [Multi-level nested queries](#multi-level-nested-query-ex) for an example. `score_mode` -: (Optional, string) Indicates how scores for matching child objects affect the root parent document’s [relevance score](/reference/query-languages/query-filter-context.md#relevance-scores). Valid values are: +: (Optional, string) Indicates how scores for matching child objects affect the root parent document’s [relevance score](/reference/query-languages/query-dsl/query-filter-context.md#relevance-scores). Valid values are: `avg` (Default) : Use the mean relevance score of all matching child objects. @@ -102,7 +102,7 @@ You can use this parameter to query multiple indices that may not contain the fi ### Context of script queries [nested-query-script-notes] -If you run a [`script` query](/reference/query-languages/query-dsl-script-query.md) within a nested query, you can only access doc values from the nested document, not the parent or root document. +If you run a [`script` query](/reference/query-languages/query-dsl/query-dsl-script-query.md) within a nested query, you can only access doc values from the nested document, not the parent or root document. ### Multi-level nested queries [multi-level-nested-query-ex] @@ -249,7 +249,7 @@ The search request returns the following response: ### `must_not` clauses and `nested` queries [must-not-clauses-and-nested-queries] -If a `nested` query matches one or more nested objects in a document, it returns the document as a hit. This applies even if other nested objects in the document don’t match the query. Keep this in mind when using a `nested` query that contains an inner [`must_not` clause](/reference/query-languages/query-dsl-bool-query.md). +If a `nested` query matches one or more nested objects in a document, it returns the document as a hit. This applies even if other nested objects in the document don’t match the query. Keep this in mind when using a `nested` query that contains an inner [`must_not` clause](/reference/query-languages/query-dsl/query-dsl-bool-query.md). ::::{tip} Use the [`inner_hits`](/reference/elasticsearch/rest-apis/retrieve-inner-hits.md) parameter to see which nested objects matched a `nested` query. diff --git a/docs/reference/query-languages/query-dsl-parent-id-query.md b/docs/reference/query-languages/query-dsl/query-dsl-parent-id-query.md similarity index 100% rename from docs/reference/query-languages/query-dsl-parent-id-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-parent-id-query.md diff --git a/docs/reference/query-languages/query-dsl-percolate-query.md b/docs/reference/query-languages/query-dsl/query-dsl-percolate-query.md similarity index 100% rename from docs/reference/query-languages/query-dsl-percolate-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-percolate-query.md diff --git a/docs/reference/query-languages/query-dsl-pinned-query.md b/docs/reference/query-languages/query-dsl/query-dsl-pinned-query.md similarity index 100% rename from docs/reference/query-languages/query-dsl-pinned-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-pinned-query.md diff --git a/docs/reference/query-languages/query-dsl-prefix-query.md b/docs/reference/query-languages/query-dsl/query-dsl-prefix-query.md similarity index 97% rename from docs/reference/query-languages/query-dsl-prefix-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-prefix-query.md index ae45b1572ba8..30b315453d21 100644 --- a/docs/reference/query-languages/query-dsl-prefix-query.md +++ b/docs/reference/query-languages/query-dsl/query-dsl-prefix-query.md @@ -39,7 +39,7 @@ GET /_search : (Required, string) Beginning characters of terms you wish to find in the provided ``. `rewrite` -: (Optional, string) Method used to rewrite the query. For valid values and more information, see the [`rewrite` parameter](/reference/query-languages/query-dsl-multi-term-rewrite.md). +: (Optional, string) Method used to rewrite the query. For valid values and more information, see the [`rewrite` parameter](/reference/query-languages/query-dsl/query-dsl-multi-term-rewrite.md). `case_insensitive` [7.10.0] : (Optional, Boolean) Allows ASCII case insensitive matching of the value with the indexed field values when set to true. Default is false which means the case sensitivity of matching depends on the underlying field’s mapping. diff --git a/docs/reference/query-languages/query-dsl-query-string-query.md b/docs/reference/query-languages/query-dsl/query-dsl-query-string-query.md similarity index 91% rename from docs/reference/query-languages/query-dsl-query-string-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-query-string-query.md index 76899ea99c31..d0b54024f9b3 100644 --- a/docs/reference/query-languages/query-dsl-query-string-query.md +++ b/docs/reference/query-languages/query-dsl/query-dsl-query-string-query.md @@ -21,7 +21,7 @@ You can use the `query_string` query to create a complex search that includes wi ::::{warning} Because it returns an error for any invalid syntax, we don’t recommend using the `query_string` query for search boxes. -If you don’t need to support a query syntax, consider using the [`match`](/reference/query-languages/query-dsl-match-query.md) query. If you need the features of a query syntax, use the [`simple_query_string`](/reference/query-languages/query-dsl-simple-query-string-query.md) query, which is less strict. +If you don’t need to support a query syntax, consider using the [`match`](/reference/query-languages/query-dsl/query-dsl-match-query.md) query. If you need the features of a query syntax, use the [`simple_query_string`](/reference/query-languages/query-dsl/query-dsl-simple-query-string-query.md) query, which is less strict. :::: @@ -53,7 +53,7 @@ GET /_search Defaults to the [`index.query.default_field`](/reference/elasticsearch/index-settings/index-modules.md#index-query-default-field) index setting, which has a default value of `*`. The `*` value extracts all fields that are eligible for term queries and filters the metadata fields. All extracted fields are then combined to build a query if no `prefix` is specified. -Searching across all eligible fields does not include [nested documents](/reference/elasticsearch/mapping-reference/nested.md). Use a [`nested` query](/reference/query-languages/query-dsl-nested-query.md) to search those documents. +Searching across all eligible fields does not include [nested documents](/reference/elasticsearch/mapping-reference/nested.md). Use a [`nested` query](/reference/query-languages/query-dsl/query-dsl-nested-query.md) to search those documents. ::::{admonition} :name: WARNING @@ -78,10 +78,10 @@ are only [normalized](/reference/data-analysis/text-analysis/normalizers.md). : (Optional, string) [Analyzer](docs-content://manage-data/data-store/text-analysis.md) used to convert text in the query string into tokens. Defaults to the [index-time analyzer](docs-content://manage-data/data-store/text-analysis/specify-an-analyzer.md#specify-index-time-analyzer) mapped for the `default_field`. If no analyzer is mapped, the index’s default analyzer is used. `auto_generate_synonyms_phrase_query` -: (Optional, Boolean) If `true`, [match phrase](/reference/query-languages/query-dsl-match-query-phrase.md) queries are automatically created for multi-term synonyms. Defaults to `true`. See [Synonyms and the `query_string` query](#query-string-synonyms) for an example. +: (Optional, Boolean) If `true`, [match phrase](/reference/query-languages/query-dsl/query-dsl-match-query-phrase.md) queries are automatically created for multi-term synonyms. Defaults to `true`. See [Synonyms and the `query_string` query](#query-string-synonyms) for an example. `boost` -: (Optional, float) Floating point number used to decrease or increase the [relevance scores](/reference/query-languages/query-filter-context.md#relevance-scores) of the query. Defaults to `1.0`. +: (Optional, float) Floating point number used to decrease or increase the [relevance scores](/reference/query-languages/query-dsl/query-filter-context.md#relevance-scores) of the query. Defaults to `1.0`. Boost values are relative to the default value of `1.0`. A boost value between `0` and `1.0` decreases the relevance score. A value greater than `1.0` increases the relevance score. @@ -129,7 +129,7 @@ You can use this parameter to prevent that conversion from unintentionally consu `minimum_should_match` -: (Optional, string) Minimum number of clauses that must match for a document to be returned. See the [`minimum_should_match` parameter](/reference/query-languages/query-dsl-minimum-should-match.md) for valid values and more information. See [How `minimum_should_match` works](#query-string-min-should-match) for an example. +: (Optional, string) Minimum number of clauses that must match for a document to be returned. See the [`minimum_should_match` parameter](/reference/query-languages/query-dsl/query-dsl-minimum-should-match.md) for valid values and more information. See [How `minimum_should_match` works](#query-string-min-should-match) for an example. `quote_analyzer` : (Optional, string) [Analyzer](docs-content://manage-data/data-store/text-analysis.md) used to convert quoted text in the query string into tokens. Defaults to the [`search_quote_analyzer`](/reference/elasticsearch/mapping-reference/analyzer.md#search-quote-analyzer) mapped for the `default_field`. @@ -147,7 +147,7 @@ You can use this suffix to use a different analysis method for exact matches. Se `rewrite` -: (Optional, string) Method used to rewrite the query. For valid values and more information, see the [`rewrite` parameter](/reference/query-languages/query-dsl-multi-term-rewrite.md). +: (Optional, string) Method used to rewrite the query. For valid values and more information, see the [`rewrite` parameter](/reference/query-languages/query-dsl/query-dsl-multi-term-rewrite.md). `time_zone` : (Optional, string) [Coordinated Universal Time (UTC) offset](https://en.wikipedia.org/wiki/List_of_UTC_time_offsets) or [IANA time zone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) used to convert `date` values in the query string to UTC. @@ -224,7 +224,7 @@ qu?ck bro* Be aware that wildcard queries can use an enormous amount of memory and perform very badly — just think how many terms need to be queried to match the query string `"a* b* c*"`. ::::{warning} -Pure wildcards `\*` are rewritten to [`exists`](/reference/query-languages/query-dsl-exists-query.md) queries for efficiency. As a consequence, the wildcard `"field:*"` would match documents with an empty value like the following: +Pure wildcards `\*` are rewritten to [`exists`](/reference/query-languages/query-dsl/query-dsl-exists-query.md) queries for efficiency. As a consequence, the wildcard `"field:*"` would match documents with an empty value like the following: ``` { @@ -261,7 +261,7 @@ Regular expression patterns can be embedded in the query string by wrapping them ``` name:/joh?n(ath[oa]n)/ ``` -The supported regular expression syntax is explained in [*Regular expression syntax*](/reference/query-languages/regexp-syntax.md). +The supported regular expression syntax is explained in [*Regular expression syntax*](/reference/query-languages/query-dsl/regexp-syntax.md). ::::{warning} The `allow_leading_wildcard` parameter does not have any control over regular expressions. A query string such as the following would force Elasticsearch to visit every term in the index: @@ -277,7 +277,7 @@ Use with caution! #### Fuzziness [query-string-fuzziness] -You can run [`fuzzy` queries](/reference/query-languages/query-dsl-fuzzy-query.md) using the `~` operator: +You can run [`fuzzy` queries](/reference/query-languages/query-dsl/query-dsl-fuzzy-query.md) using the `~` operator: ``` quikc~ brwn~ foks~ @@ -374,10 +374,10 @@ age:(+>=10 +<20) :::: -The parsing of ranges in query strings can be complex and error prone. It is much more reliable to use an explicit [`range` query](/reference/query-languages/query-dsl-range-query.md). +The parsing of ranges in query strings can be complex and error prone. It is much more reliable to use an explicit [`range` query](/reference/query-languages/query-dsl/query-dsl-range-query.md). -#### Boosting [_boosting] +#### Boosting [boosting] Use the *boost* operator `^` to make one term more relevant than another. For instance, if we want to find all documents about foxes, but we are especially interested in quick foxes: @@ -412,7 +412,7 @@ The familiar boolean operators `AND`, `OR` and `NOT` (also written `&&`, `||` an `((quick AND fox) OR (brown AND fox) OR fox) AND NOT news` : This form now replicates the logic from the original query correctly, but the relevance scoring bears little resemblance to the original. -In contrast, the same query rewritten using the [`match` query](/reference/query-languages/query-dsl-match-query.md) would look like this: +In contrast, the same query rewritten using the [`match` query](/reference/query-languages/query-dsl/query-dsl-match-query.md) would look like this: ``` { @@ -472,7 +472,7 @@ If the query string is empty or only contains whitespaces the query will yield a #### Avoid using the `query_string` query for nested documents [query-string-nested] -`query_string` searches do not return [nested](/reference/elasticsearch/mapping-reference/nested.md) documents. To search nested documents, use the [`nested` query](/reference/query-languages/query-dsl-nested-query.md). +`query_string` searches do not return [nested](/reference/elasticsearch/mapping-reference/nested.md) documents. To search nested documents, use the [`nested` query](/reference/query-languages/query-dsl/query-dsl-nested-query.md). #### Search multiple fields [query-string-multi-field] @@ -582,24 +582,24 @@ When running the `query_string` query against multiple fields, the following add : (Optional, string) Determines how the query matches and scores documents. Valid values are: `best_fields` (Default) -: Finds documents which match any field and uses the highest [`_score`](/reference/query-languages/query-filter-context.md#relevance-scores) from any matching field. See [`best_fields`](/reference/query-languages/query-dsl-multi-match-query.md#type-best-fields). +: Finds documents which match any field and uses the highest [`_score`](/reference/query-languages/query-dsl/query-filter-context.md#relevance-scores) from any matching field. See [`best_fields`](/reference/query-languages/query-dsl/query-dsl-multi-match-query.md#type-best-fields). `bool_prefix` -: Creates a `match_bool_prefix` query on each field and combines the `_score` from each field. See [`bool_prefix`](/reference/query-languages/query-dsl-multi-match-query.md#type-bool-prefix). +: Creates a `match_bool_prefix` query on each field and combines the `_score` from each field. See [`bool_prefix`](/reference/query-languages/query-dsl/query-dsl-multi-match-query.md#type-bool-prefix). `cross_fields` -: Treats fields with the same `analyzer` as though they were one big field. Looks for each word in **any** field. See [`cross_fields`](/reference/query-languages/query-dsl-multi-match-query.md#type-cross-fields). +: Treats fields with the same `analyzer` as though they were one big field. Looks for each word in **any** field. See [`cross_fields`](/reference/query-languages/query-dsl/query-dsl-multi-match-query.md#type-cross-fields). `most_fields` -: Finds documents which match any field and combines the `_score` from each field. See [`most_fields`](/reference/query-languages/query-dsl-multi-match-query.md#type-most-fields). +: Finds documents which match any field and combines the `_score` from each field. See [`most_fields`](/reference/query-languages/query-dsl/query-dsl-multi-match-query.md#type-most-fields). `phrase` -: Runs a `match_phrase` query on each field and uses the `_score` from the best field. See [`phrase` and `phrase_prefix`](/reference/query-languages/query-dsl-multi-match-query.md#type-phrase). +: Runs a `match_phrase` query on each field and uses the `_score` from the best field. See [`phrase` and `phrase_prefix`](/reference/query-languages/query-dsl/query-dsl-multi-match-query.md#type-phrase). `phrase_prefix` -: Runs a `match_phrase_prefix` query on each field and uses the `_score` from the best field. See [`phrase` and `phrase_prefix`](/reference/query-languages/query-dsl-multi-match-query.md#type-phrase). +: Runs a `match_phrase_prefix` query on each field and uses the `_score` from the best field. See [`phrase` and `phrase_prefix`](/reference/query-languages/query-dsl/query-dsl-multi-match-query.md#type-phrase). -NOTE: Additional top-level `multi_match` parameters may be available based on the [`type`](/reference/query-languages/query-dsl-multi-match-query.md#multi-match-types) value. +NOTE: Additional top-level `multi_match` parameters may be available based on the [`type`](/reference/query-languages/query-dsl/query-dsl-multi-match-query.md#multi-match-types) value. @@ -737,4 +737,4 @@ that matches documents with at least two of the three per-term blended queries. ### Allow expensive queries [_allow_expensive_queries] -Query string query can be internally be transformed to a [`prefix query`](/reference/query-languages/query-dsl-prefix-query.md) which means that if the prefix queries are disabled as explained [here](/reference/query-languages/query-dsl-prefix-query.md#prefix-query-allow-expensive-queries) the query will not be executed and an exception will be thrown. +Query string query can be internally be transformed to a [`prefix query`](/reference/query-languages/query-dsl/query-dsl-prefix-query.md) which means that if the prefix queries are disabled as explained [here](/reference/query-languages/query-dsl/query-dsl-prefix-query.md#prefix-query-allow-expensive-queries) the query will not be executed and an exception will be thrown. diff --git a/docs/reference/query-languages/query-dsl-range-query.md b/docs/reference/query-languages/query-dsl/query-dsl-range-query.md similarity index 98% rename from docs/reference/query-languages/query-dsl-range-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-range-query.md index e541a656de61..d7f676109c4f 100644 --- a/docs/reference/query-languages/query-dsl-range-query.md +++ b/docs/reference/query-languages/query-dsl/query-dsl-range-query.md @@ -100,7 +100,7 @@ However, the `time_zone` parameter does convert dates calculated using `now` and `boost`      (Optional, float) Floating point number used to decrease or increase the -     [relevance scores](/reference/query-languages/query-filter-context.md#relevance-scores) of a query. Defaults to `1.0`. +     [relevance scores](/reference/query-languages/query-dsl/query-filter-context.md#relevance-scores) of a query. Defaults to `1.0`.      You can use the `boost` parameter to adjust relevance scores for searches      containing two or more queries. diff --git a/docs/reference/query-languages/query-dsl-rank-feature-query.md b/docs/reference/query-languages/query-dsl/query-dsl-rank-feature-query.md similarity index 81% rename from docs/reference/query-languages/query-dsl-rank-feature-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-rank-feature-query.md index 247e98185193..ea3b40b42a1b 100644 --- a/docs/reference/query-languages/query-dsl-rank-feature-query.md +++ b/docs/reference/query-languages/query-dsl/query-dsl-rank-feature-query.md @@ -7,13 +7,13 @@ mapped_pages: # Rank feature query [query-dsl-rank-feature-query] -Boosts the [relevance score](/reference/query-languages/query-filter-context.md#relevance-scores) of documents based on the numeric value of a [`rank_feature`](/reference/elasticsearch/mapping-reference/rank-feature.md) or [`rank_features`](/reference/elasticsearch/mapping-reference/rank-features.md) field. +Boosts the [relevance score](/reference/query-languages/query-dsl/query-filter-context.md#relevance-scores) of documents based on the numeric value of a [`rank_feature`](/reference/elasticsearch/mapping-reference/rank-feature.md) or [`rank_features`](/reference/elasticsearch/mapping-reference/rank-features.md) field. -The `rank_feature` query is typically used in the `should` clause of a [`bool`](/reference/query-languages/query-dsl-bool-query.md) query so its relevance scores are added to other scores from the `bool` query. +The `rank_feature` query is typically used in the `should` clause of a [`bool`](/reference/query-languages/query-dsl/query-dsl-bool-query.md) query so its relevance scores are added to other scores from the `bool` query. With `positive_score_impact` set to `false` for a `rank_feature` or `rank_features` field, we recommend that every document that participates in a query has a value for this field. Otherwise, if a `rank_feature` query is used in the should clause, it doesn’t add anything to a score of a document with a missing value, but adds some boost for a document containing a feature. This is contrary to what we want – as we consider these features negative, we want to rank documents containing them lower than documents missing them. -Unlike the [`function_score`](/reference/query-languages/query-dsl-function-score-query.md) query or other ways to change [relevance scores](/reference/query-languages/query-filter-context.md#relevance-scores), the `rank_feature` query efficiently skips non-competitive hits when the [`track_total_hits`](docs-content://solutions/search/the-search-api.md#track-total-hits) parameter is **not** `true`. This can dramatically improve query speed. +Unlike the [`function_score`](/reference/query-languages/query-dsl/query-dsl-function-score-query.md) query or other ways to change [relevance scores](/reference/query-languages/query-dsl/query-filter-context.md#relevance-scores), the `rank_feature` query efficiently skips non-competitive hits when the [`track_total_hits`](docs-content://solutions/search/the-search-api.md#track-total-hits) parameter is **not** `true`. This can dramatically improve query speed. ## Rank feature functions [rank-feature-query-functions] @@ -146,34 +146,34 @@ GET /test/_search ## Top-level parameters for `rank_feature` [rank-feature-top-level-params] `field` -: (Required, string) [`rank_feature`](/reference/elasticsearch/mapping-reference/rank-feature.md) or [`rank_features`](/reference/elasticsearch/mapping-reference/rank-features.md) field used to boost [relevance scores](/reference/query-languages/query-filter-context.md#relevance-scores). +: (Required, string) [`rank_feature`](/reference/elasticsearch/mapping-reference/rank-feature.md) or [`rank_features`](/reference/elasticsearch/mapping-reference/rank-features.md) field used to boost [relevance scores](/reference/query-languages/query-dsl/query-filter-context.md#relevance-scores). `boost` -: (Optional, float) Floating point number used to decrease or increase [relevance scores](/reference/query-languages/query-filter-context.md#relevance-scores). Defaults to `1.0`. +: (Optional, float) Floating point number used to decrease or increase [relevance scores](/reference/query-languages/query-dsl/query-filter-context.md#relevance-scores). Defaults to `1.0`. Boost values are relative to the default value of `1.0`. A boost value between `0` and `1.0` decreases the relevance score. A value greater than `1.0` increases the relevance score. `saturation` -: (Optional, [function object](#rank-feature-query-saturation)) Saturation function used to boost [relevance scores](/reference/query-languages/query-filter-context.md#relevance-scores) based on the value of the rank feature `field`. If no function is provided, the `rank_feature` query defaults to the `saturation` function. See [Saturation](#rank-feature-query-saturation) for more information. +: (Optional, [function object](#rank-feature-query-saturation)) Saturation function used to boost [relevance scores](/reference/query-languages/query-dsl/query-filter-context.md#relevance-scores) based on the value of the rank feature `field`. If no function is provided, the `rank_feature` query defaults to the `saturation` function. See [Saturation](#rank-feature-query-saturation) for more information. Only one function `saturation`, `log`, `sigmoid` or `linear` can be provided. `log` -: (Optional, [function object](#rank-feature-query-logarithm)) Logarithmic function used to boost [relevance scores](/reference/query-languages/query-filter-context.md#relevance-scores) based on the value of the rank feature `field`. See [Logarithm](#rank-feature-query-logarithm) for more information. +: (Optional, [function object](#rank-feature-query-logarithm)) Logarithmic function used to boost [relevance scores](/reference/query-languages/query-dsl/query-filter-context.md#relevance-scores) based on the value of the rank feature `field`. See [Logarithm](#rank-feature-query-logarithm) for more information. Only one function `saturation`, `log`, `sigmoid` or `linear` can be provided. `sigmoid` -: (Optional, [function object](#rank-feature-query-sigmoid)) Sigmoid function used to boost [relevance scores](/reference/query-languages/query-filter-context.md#relevance-scores) based on the value of the rank feature `field`. See [Sigmoid](#rank-feature-query-sigmoid) for more information. +: (Optional, [function object](#rank-feature-query-sigmoid)) Sigmoid function used to boost [relevance scores](/reference/query-languages/query-dsl/query-filter-context.md#relevance-scores) based on the value of the rank feature `field`. See [Sigmoid](#rank-feature-query-sigmoid) for more information. Only one function `saturation`, `log`, `sigmoid` or `linear` can be provided. `linear` -: (Optional, [function object](#rank-feature-query-linear)) Linear function used to boost [relevance scores](/reference/query-languages/query-filter-context.md#relevance-scores) based on the value of the rank feature `field`. See [Linear](#rank-feature-query-linear) for more information. +: (Optional, [function object](#rank-feature-query-linear)) Linear function used to boost [relevance scores](/reference/query-languages/query-dsl/query-filter-context.md#relevance-scores) based on the value of the rank feature `field`. See [Linear](#rank-feature-query-linear) for more information. Only one function `saturation`, `log`, `sigmoid` or `linear` can be provided. diff --git a/docs/reference/query-languages/query-dsl-regexp-query.md b/docs/reference/query-languages/query-dsl/query-dsl-regexp-query.md similarity index 91% rename from docs/reference/query-languages/query-dsl-regexp-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-regexp-query.md index f08d18aa118d..149a25c3fb7d 100644 --- a/docs/reference/query-languages/query-dsl-regexp-query.md +++ b/docs/reference/query-languages/query-dsl/query-dsl-regexp-query.md @@ -9,7 +9,7 @@ mapped_pages: Returns documents that contain terms matching a [regular expression](https://en.wikipedia.org/wiki/Regular_expression). -A regular expression is a way to match patterns in data using placeholder characters, called operators. For a list of operators supported by the `regexp` query, see [Regular expression syntax](/reference/query-languages/regexp-syntax.md). +A regular expression is a way to match patterns in data using placeholder characters, called operators. For a list of operators supported by the `regexp` query, see [Regular expression syntax](/reference/query-languages/query-dsl/regexp-syntax.md). ## Example request [regexp-query-ex-request] @@ -42,7 +42,7 @@ GET /_search ## Parameters for `` [regexp-query-field-params] `value` -: (Required, string) Regular expression for terms you wish to find in the provided ``. For a list of supported operators, see [Regular expression syntax](/reference/query-languages/regexp-syntax.md). +: (Required, string) Regular expression for terms you wish to find in the provided ``. For a list of supported operators, see [Regular expression syntax](/reference/query-languages/query-dsl/regexp-syntax.md). By default, regular expressions are limited to 1,000 characters. You can change this limit using the [`index.max_regex_length`](/reference/elasticsearch/index-settings/index-modules.md#index-max-regex-length) setting. @@ -53,7 +53,7 @@ GET /_search `flags` -: (Optional, string) Enables optional operators for the regular expression. For valid values and more information, see [Regular expression syntax](/reference/query-languages/regexp-syntax.md#regexp-optional-operators). +: (Optional, string) Enables optional operators for the regular expression. For valid values and more information, see [Regular expression syntax](/reference/query-languages/query-dsl/regexp-syntax.md#regexp-optional-operators). `case_insensitive` [7.10.0] : (Optional, Boolean) Allows case insensitive matching of the regular expression value with the indexed field values when set to true. Default is false which means the case sensitivity of matching depends on the underlying field’s mapping. @@ -67,7 +67,7 @@ You can use this parameter to prevent that conversion from unintentionally consu `rewrite` -: (Optional, string) Method used to rewrite the query. For valid values and more information, see the [`rewrite` parameter](/reference/query-languages/query-dsl-multi-term-rewrite.md). +: (Optional, string) Method used to rewrite the query. For valid values and more information, see the [`rewrite` parameter](/reference/query-languages/query-dsl/query-dsl-multi-term-rewrite.md). ## Notes [regexp-query-notes] diff --git a/docs/reference/query-languages/query-dsl-rule-query.md b/docs/reference/query-languages/query-dsl/query-dsl-rule-query.md similarity index 83% rename from docs/reference/query-languages/query-dsl-rule-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-rule-query.md index 0e694f708929..c682481cdc58 100644 --- a/docs/reference/query-languages/query-dsl-rule-query.md +++ b/docs/reference/query-languages/query-dsl/query-dsl-rule-query.md @@ -19,7 +19,7 @@ The rule query is not supported for use alongside reranking. If you want to use :::: -Applies [query rules](https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-query_rules) to the query before returning results. Query rules can be used to promote documents in the manner of a [Pinned query](/reference/query-languages/query-dsl-pinned-query.md) based on matching defined rules, or to identify specific documents to exclude from a contextual result set. If no matching query rules are defined, the "organic" matches for the query are returned. All matching rules are applied in the order in which they appear in the query ruleset. If the same document matches both an `exclude` rule and a `pinned` rule, the document will be excluded. +Applies [query rules](https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-query_rules) to the query before returning results. Query rules can be used to promote documents in the manner of a [Pinned query](/reference/query-languages/query-dsl/query-dsl-pinned-query.md) based on matching defined rules, or to identify specific documents to exclude from a contextual result set. If no matching query rules are defined, the "organic" matches for the query are returned. All matching rules are applied in the order in which they appear in the query ruleset. If the same document matches both an `exclude` rule and a `pinned` rule, the document will be excluded. ::::{note} To use the rule query, you first need a defined set of query rules. Use the [query rules management APIs](https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-query_rules) to create and manage query rules. For more information and examples see [Searching with query rules](/reference/elasticsearch/rest-apis/searching-with-query-rules.md). diff --git a/docs/reference/query-languages/query-dsl-script-query.md b/docs/reference/query-languages/query-dsl/query-dsl-script-query.md similarity index 90% rename from docs/reference/query-languages/query-dsl-script-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-script-query.md index 3cb070210b73..7b4d54dcd6a1 100644 --- a/docs/reference/query-languages/query-dsl-script-query.md +++ b/docs/reference/query-languages/query-dsl/query-dsl-script-query.md @@ -12,7 +12,7 @@ mapped_pages: :::: -Filters documents based on a provided [script](docs-content://explore-analyze/scripting/modules-scripting-using.md). The `script` query is typically used in a [filter context](/reference/query-languages/query-filter-context.md). +Filters documents based on a provided [script](docs-content://explore-analyze/scripting/modules-scripting-using.md). The `script` query is typically used in a [filter context](/reference/query-languages/query-dsl/query-filter-context.md). ::::{warning} Using scripts can result in slower search speeds. See [Scripts, caching, and search speed](docs-content://explore-analyze/scripting/scripts-search-speed.md). @@ -83,7 +83,7 @@ GET /_search ### Custom parameters [script-query-custom-params] -Like [filters](/reference/query-languages/query-filter-context.md), scripts are cached for faster execution. If you frequently change the arguments of a script, we recommend you store them in the script’s `params` parameter. For example: +Like [filters](/reference/query-languages/query-dsl/query-filter-context.md), scripts are cached for faster execution. If you frequently change the arguments of a script, we recommend you store them in the script’s `params` parameter. For example: ```console GET /_search diff --git a/docs/reference/query-languages/query-dsl-script-score-query.md b/docs/reference/query-languages/query-dsl/query-dsl-script-score-query.md similarity index 98% rename from docs/reference/query-languages/query-dsl-script-score-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-script-score-query.md index 9cc61cfb45c5..4e1ceb585037 100644 --- a/docs/reference/query-languages/query-dsl-script-score-query.md +++ b/docs/reference/query-languages/query-dsl/query-dsl-script-score-query.md @@ -126,7 +126,7 @@ Note that documents that are within the same shard and have the same value for f #### Decay functions for numeric fields [decay-functions-numeric-fields] -You can read more about decay functions [here](/reference/query-languages/query-dsl-function-score-query.md#function-decay). +You can read more about decay functions [here](/reference/query-languages/query-dsl/query-dsl-function-score-query.md#function-decay). * `double decayNumericLinear(double origin, double scale, double offset, double decay, double docValue)` * `double decayNumericExp(double origin, double scale, double offset, double decay, double docValue)` @@ -206,13 +206,13 @@ Script score queries will not be executed if [`search.allow_expensive_queries`]( The `script_score` query calculates the score for every matching document, or hit. There are faster alternative query types that can efficiently skip non-competitive hits: -* If you want to boost documents on some static fields, use the [`rank_feature`](/reference/query-languages/query-dsl-rank-feature-query.md) query. -* If you want to boost documents closer to a date or geographic point, use the [`distance_feature`](/reference/query-languages/query-dsl-distance-feature-query.md) query. +* If you want to boost documents on some static fields, use the [`rank_feature`](/reference/query-languages/query-dsl/query-dsl-rank-feature-query.md) query. +* If you want to boost documents closer to a date or geographic point, use the [`distance_feature`](/reference/query-languages/query-dsl/query-dsl-distance-feature-query.md) query. ### Transition from the function score query [script-score-function-score-transition] -We recommend using the `script_score` query instead of [`function_score`](/reference/query-languages/query-dsl-function-score-query.md) query for the simplicity of the `script_score` query. +We recommend using the `script_score` query instead of [`function_score`](/reference/query-languages/query-dsl/query-dsl-function-score-query.md) query for the simplicity of the `script_score` query. You can implement the following functions of the `function_score` query using the `script_score` query: diff --git a/docs/reference/query-languages/query-dsl-semantic-query.md b/docs/reference/query-languages/query-dsl/query-dsl-semantic-query.md similarity index 100% rename from docs/reference/query-languages/query-dsl-semantic-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-semantic-query.md diff --git a/docs/reference/query-languages/query-dsl-shape-query.md b/docs/reference/query-languages/query-dsl/query-dsl-shape-query.md similarity index 100% rename from docs/reference/query-languages/query-dsl-shape-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-shape-query.md diff --git a/docs/reference/query-languages/query-dsl-simple-query-string-query.md b/docs/reference/query-languages/query-dsl/query-dsl-simple-query-string-query.md similarity index 89% rename from docs/reference/query-languages/query-dsl-simple-query-string-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-simple-query-string-query.md index 9f7cbe264ccd..1da5008a629f 100644 --- a/docs/reference/query-languages/query-dsl-simple-query-string-query.md +++ b/docs/reference/query-languages/query-dsl/query-dsl-simple-query-string-query.md @@ -11,7 +11,7 @@ Returns documents based on a provided query string, using a parser with a limite This query uses a [simple syntax](#simple-query-string-syntax) to parse and split the provided query string into terms based on special operators. The query then [analyzes](docs-content://manage-data/data-store/text-analysis.md) each term independently before returning matching documents. -While its syntax is more limited than the [`query_string` query](/reference/query-languages/query-dsl-query-string-query.md), the `simple_query_string` query does not return errors for invalid syntax. Instead, it ignores any invalid parts of the query string. +While its syntax is more limited than the [`query_string` query](/reference/query-languages/query-dsl/query-dsl-query-string-query.md), the `simple_query_string` query does not return errors for invalid syntax. Instead, it ignores any invalid parts of the query string. ## Example request [simple-query-string-query-ex-request] @@ -66,7 +66,7 @@ are only [normalized](/reference/data-analysis/text-analysis/normalizers.md). : (Optional, string) [Analyzer](docs-content://manage-data/data-store/text-analysis.md) used to convert text in the query string into tokens. Defaults to the [index-time analyzer](docs-content://manage-data/data-store/text-analysis/specify-an-analyzer.md#specify-index-time-analyzer) mapped for the `default_field`. If no analyzer is mapped, the index’s default analyzer is used. `auto_generate_synonyms_phrase_query` -: (Optional, Boolean) If `true`, the parser creates a [`match_phrase`](/reference/query-languages/query-dsl-match-query-phrase.md) query for each [multi-position token](docs-content://manage-data/data-store/text-analysis/token-graphs.md#token-graphs-multi-position-tokens). Defaults to `true`. For examples, see [Multi-position tokens](#simple-query-string-synonyms). +: (Optional, Boolean) If `true`, the parser creates a [`match_phrase`](/reference/query-languages/query-dsl/query-dsl-match-query-phrase.md) query for each [multi-position token](docs-content://manage-data/data-store/text-analysis/token-graphs.md#token-graphs-multi-position-tokens). Defaults to `true`. For examples, see [Multi-position tokens](#simple-query-string-synonyms). `flags` : (Optional, string) List of enabled operators for the [simple query string syntax](#simple-query-string-syntax). Defaults to `ALL` (all operators). See [Limit operators](#supported-flags) for valid values. @@ -84,7 +84,7 @@ are only [normalized](/reference/data-analysis/text-analysis/normalizers.md). : (Optional, Boolean) If `true`, format-based errors, such as providing a text value for a [numeric](/reference/elasticsearch/mapping-reference/number.md) field, are ignored. Defaults to `false`. `minimum_should_match` -: (Optional, string) Minimum number of clauses that must match for a document to be returned. See the [`minimum_should_match` parameter](/reference/query-languages/query-dsl-minimum-should-match.md) for valid values and more information. +: (Optional, string) Minimum number of clauses that must match for a document to be returned. See the [`minimum_should_match` parameter](/reference/query-languages/query-dsl/query-dsl-minimum-should-match.md) for valid values and more information. `quote_field_suffix` : (Optional, string) Suffix appended to quoted text in the query string. @@ -229,7 +229,7 @@ GET /_search ### Multi-position tokens [simple-query-string-synonyms] -By default, the `simple_query_string` query parser creates a [`match_phrase`](/reference/query-languages/query-dsl-match-query-phrase.md) query for each [multi-position token](docs-content://manage-data/data-store/text-analysis/token-graphs.md#token-graphs-multi-position-tokens) in the query string. For example, the parser creates a `match_phrase` query for the multi-word synonym `ny, new york`: +By default, the `simple_query_string` query parser creates a [`match_phrase`](/reference/query-languages/query-dsl/query-dsl-match-query-phrase.md) query for each [multi-position token](docs-content://manage-data/data-store/text-analysis/token-graphs.md#token-graphs-multi-position-tokens) in the query string. For example, the parser creates a `match_phrase` query for the multi-word synonym `ny, new york`: `(ny OR ("new york"))` @@ -247,7 +247,7 @@ GET /_search } ``` -For the above example, the parser creates the following [`bool`](/reference/query-languages/query-dsl-bool-query.md) query: +For the above example, the parser creates the following [`bool`](/reference/query-languages/query-dsl/query-dsl-bool-query.md) query: `(ny OR (new AND york)) city)` diff --git a/docs/reference/query-languages/query-dsl-span-containing-query.md b/docs/reference/query-languages/query-dsl/query-dsl-span-containing-query.md similarity index 100% rename from docs/reference/query-languages/query-dsl-span-containing-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-span-containing-query.md diff --git a/docs/reference/query-languages/query-dsl-span-field-masking-query.md b/docs/reference/query-languages/query-dsl/query-dsl-span-field-masking-query.md similarity index 100% rename from docs/reference/query-languages/query-dsl-span-field-masking-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-span-field-masking-query.md diff --git a/docs/reference/query-languages/query-dsl-span-first-query.md b/docs/reference/query-languages/query-dsl/query-dsl-span-first-query.md similarity index 100% rename from docs/reference/query-languages/query-dsl-span-first-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-span-first-query.md diff --git a/docs/reference/query-languages/query-dsl-span-multi-term-query.md b/docs/reference/query-languages/query-dsl/query-dsl-span-multi-term-query.md similarity index 73% rename from docs/reference/query-languages/query-dsl-span-multi-term-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-span-multi-term-query.md index 1661be5cb9d3..2bdac20c0f2d 100644 --- a/docs/reference/query-languages/query-dsl-span-multi-term-query.md +++ b/docs/reference/query-languages/query-dsl/query-dsl-span-multi-term-query.md @@ -38,7 +38,7 @@ GET /_search ``` ::::{warning} -`span_multi` queries will hit too many clauses failure if the number of terms that match the query exceeds the `indices.query.bool.max_clause_count` [search setting](/reference/elasticsearch/configuration-reference/search-settings.md). To avoid an unbounded expansion you can set the [rewrite method](/reference/query-languages/query-dsl-multi-term-rewrite.md) of the multi term query to `top_terms_*` rewrite. Or, if you use `span_multi` on `prefix` query only, you can activate the [`index_prefixes`](/reference/elasticsearch/mapping-reference/index-prefixes.md) field option of the `text` field instead. This will rewrite any prefix query on the field to a single term query that matches the indexed prefix. +`span_multi` queries will hit too many clauses failure if the number of terms that match the query exceeds the `indices.query.bool.max_clause_count` [search setting](/reference/elasticsearch/configuration-reference/search-settings.md). To avoid an unbounded expansion you can set the [rewrite method](/reference/query-languages/query-dsl/query-dsl-multi-term-rewrite.md) of the multi term query to `top_terms_*` rewrite. Or, if you use `span_multi` on `prefix` query only, you can activate the [`index_prefixes`](/reference/elasticsearch/mapping-reference/index-prefixes.md) field option of the `text` field instead. This will rewrite any prefix query on the field to a single term query that matches the indexed prefix. :::: diff --git a/docs/reference/query-languages/query-dsl-span-near-query.md b/docs/reference/query-languages/query-dsl/query-dsl-span-near-query.md similarity index 100% rename from docs/reference/query-languages/query-dsl-span-near-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-span-near-query.md diff --git a/docs/reference/query-languages/query-dsl-span-not-query.md b/docs/reference/query-languages/query-dsl/query-dsl-span-not-query.md similarity index 100% rename from docs/reference/query-languages/query-dsl-span-not-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-span-not-query.md diff --git a/docs/reference/query-languages/query-dsl-span-query.md b/docs/reference/query-languages/query-dsl/query-dsl-span-query.md similarity index 100% rename from docs/reference/query-languages/query-dsl-span-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-span-query.md diff --git a/docs/reference/query-languages/query-dsl-span-term-query.md b/docs/reference/query-languages/query-dsl/query-dsl-span-term-query.md similarity index 100% rename from docs/reference/query-languages/query-dsl-span-term-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-span-term-query.md diff --git a/docs/reference/query-languages/query-dsl-span-within-query.md b/docs/reference/query-languages/query-dsl/query-dsl-span-within-query.md similarity index 100% rename from docs/reference/query-languages/query-dsl-span-within-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-span-within-query.md diff --git a/docs/reference/query-languages/query-dsl-sparse-vector-query.md b/docs/reference/query-languages/query-dsl/query-dsl-sparse-vector-query.md similarity index 97% rename from docs/reference/query-languages/query-dsl-sparse-vector-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-sparse-vector-query.md index b13105f4a90d..cbd691f0fd78 100644 --- a/docs/reference/query-languages/query-dsl-sparse-vector-query.md +++ b/docs/reference/query-languages/query-dsl/query-dsl-sparse-vector-query.md @@ -12,7 +12,7 @@ The sparse vector query executes a query consisting of sparse vectors, such as b * Using an {{nlp}} model to convert query text into a list of token-weight pairs * Sending in precalculated token-weight pairs as query vectors -These token-weight pairs are then used in a query against a [sparse vector](/reference/elasticsearch/mapping-reference/sparse-vector.md) or a [semantic_text](/reference/elasticsearch/mapping-reference/semantic-text.md) field with a compatible sparse inference model. At query time, query vectors are calculated using the same inference model that was used to create the tokens. When querying, these query vectors are ORed together with their respective weights, which means scoring is effectively a [dot product](/reference/query-languages/query-dsl-script-score-query.md#vector-functions-dot-product) calculation between stored dimensions and query dimensions. +These token-weight pairs are then used in a query against a [sparse vector](/reference/elasticsearch/mapping-reference/sparse-vector.md) or a [semantic_text](/reference/elasticsearch/mapping-reference/semantic-text.md) field with a compatible sparse inference model. At query time, query vectors are calculated using the same inference model that was used to create the tokens. When querying, these query vectors are ORed together with their respective weights, which means scoring is effectively a [dot product](/reference/query-languages/query-dsl/query-dsl-script-score-query.md#vector-functions-dot-product) calculation between stored dimensions and query dimensions. For example, a stored vector `{"feature_0": 0.12, "feature_1": 1.2, "feature_2": 3.0}` with query vector `{"feature_0": 2.5, "feature_2": 0.2}` would score the document `_score = 0.12*2.5 + 3.0*0.2 = 0.9` @@ -102,7 +102,7 @@ GET my-index/_search } ``` -Multiple `sparse_vector` queries can be combined with each other or other query types. This can be achieved by wrapping them in [boolean query clauses](/reference/query-languages/query-dsl-bool-query.md) and using linear boosting: +Multiple `sparse_vector` queries can be combined with each other or other query types. This can be achieved by wrapping them in [boolean query clauses](/reference/query-languages/query-dsl/query-dsl-bool-query.md) and using linear boosting: ```console GET my-index/_search diff --git a/docs/reference/query-languages/query-dsl-term-query.md b/docs/reference/query-languages/query-dsl/query-dsl-term-query.md similarity index 97% rename from docs/reference/query-languages/query-dsl-term-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-term-query.md index a7e2ad78d23f..633a6b7551cb 100644 --- a/docs/reference/query-languages/query-dsl-term-query.md +++ b/docs/reference/query-languages/query-dsl/query-dsl-term-query.md @@ -16,7 +16,7 @@ Avoid using the `term` query for [`text`](/reference/elasticsearch/mapping-refer By default, {{es}} changes the values of `text` fields as part of [analysis](docs-content://manage-data/data-store/text-analysis.md). This can make finding exact matches for `text` field values difficult. -To search `text` field values, use the [`match`](/reference/query-languages/query-dsl-match-query.md) query instead. +To search `text` field values, use the [`match`](/reference/query-languages/query-dsl/query-dsl-match-query.md) query instead. :::: @@ -50,7 +50,7 @@ GET /_search : (Required, string) Term you wish to find in the provided ``. To return a document, the term must exactly match the field value, including whitespace and capitalization. `boost` -: (Optional, float) Floating point number used to decrease or increase the [relevance scores](/reference/query-languages/query-filter-context.md#relevance-scores) of a query. Defaults to `1.0`. +: (Optional, float) Floating point number used to decrease or increase the [relevance scores](/reference/query-languages/query-dsl/query-filter-context.md#relevance-scores) of a query. Defaults to `1.0`. You can use the `boost` parameter to adjust relevance scores for searches containing two or more queries. diff --git a/docs/reference/query-languages/query-dsl-terms-query.md b/docs/reference/query-languages/query-dsl/query-dsl-terms-query.md similarity index 93% rename from docs/reference/query-languages/query-dsl-terms-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-terms-query.md index 224866b6d380..a812577ea9a4 100644 --- a/docs/reference/query-languages/query-dsl-terms-query.md +++ b/docs/reference/query-languages/query-dsl/query-dsl-terms-query.md @@ -9,7 +9,7 @@ mapped_pages: Returns documents that contain one or more **exact** terms in a provided field. -The `terms` query is the same as the [`term` query](/reference/query-languages/query-dsl-term-query.md), except you can search for multiple values. A document will match if it contains at least one of the terms. To search for documents that contain more than one matching term, use the [`terms_set` query](/reference/query-languages/query-dsl-terms-set-query.md). +The `terms` query is the same as the [`term` query](/reference/query-languages/query-dsl/query-dsl-term-query.md), except you can search for multiple values. A document will match if it contains at least one of the terms. To search for documents that contain more than one matching term, use the [`terms_set` query](/reference/query-languages/query-dsl/query-dsl-terms-set-query.md). ## Example request [terms-query-ex-request] @@ -44,7 +44,7 @@ To use the field values of an existing document as search terms, use the [terms `boost` -: (Optional, float) Floating point number used to decrease or increase the [relevance scores](/reference/query-languages/query-filter-context.md#relevance-scores) of a query. Defaults to `1.0`. +: (Optional, float) Floating point number used to decrease or increase the [relevance scores](/reference/query-languages/query-dsl/query-filter-context.md#relevance-scores) of a query. Defaults to `1.0`. You can use the `boost` parameter to adjust relevance scores for searches containing two or more queries. diff --git a/docs/reference/query-languages/query-dsl-terms-set-query.md b/docs/reference/query-languages/query-dsl/query-dsl-terms-set-query.md similarity index 96% rename from docs/reference/query-languages/query-dsl-terms-set-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-terms-set-query.md index 9bf7a4f08ed0..29c2eeb0c8c1 100644 --- a/docs/reference/query-languages/query-dsl-terms-set-query.md +++ b/docs/reference/query-languages/query-dsl/query-dsl-terms-set-query.md @@ -9,7 +9,7 @@ mapped_pages: Returns documents that contain a minimum number of **exact** terms in a provided field. -The `terms_set` query is the same as the [`terms` query](/reference/query-languages/query-dsl-terms-query.md), except you can define the number of matching terms required to return a document. For example: +The `terms_set` query is the same as the [`terms` query](/reference/query-languages/query-dsl/query-dsl-terms-query.md), except you can define the number of matching terms required to return a document. For example: * A field, `programming_languages`, contains a list of known programming languages, such as `c++`, `java`, or `php` for job candidates. You can use the `terms_set` query to return documents that match at least two of these languages. * A field, `permissions`, contains a list of possible user permissions for an application. You can use the `terms_set` query to return documents that match a subset of these permissions. @@ -126,7 +126,7 @@ The required number of matching terms is defined in the `minimum_should_match`, `minimum_should_match` : (Optional) Specification for the number of matching terms required to return a document. -For valid values, see [`minimum_should_match` parameter](/reference/query-languages/query-dsl-minimum-should-match.md). +For valid values, see [`minimum_should_match` parameter](/reference/query-languages/query-dsl/query-dsl-minimum-should-match.md). `minimum_should_match_field` diff --git a/docs/reference/query-languages/query-dsl-text-expansion-query.md b/docs/reference/query-languages/query-dsl/query-dsl-text-expansion-query.md similarity index 98% rename from docs/reference/query-languages/query-dsl-text-expansion-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-text-expansion-query.md index e5839efd881c..1eca639ea646 100644 --- a/docs/reference/query-languages/query-dsl-text-expansion-query.md +++ b/docs/reference/query-languages/query-dsl/query-dsl-text-expansion-query.md @@ -10,7 +10,7 @@ mapped_pages: ::::{admonition} Deprecated in 8.15.0. :class: warning -This query has been replaced by [Sparse vector](/reference/query-languages/query-dsl-sparse-vector-query.md). +This query has been replaced by [Sparse vector](/reference/query-languages/query-dsl/query-dsl-sparse-vector-query.md). :::: @@ -92,7 +92,7 @@ GET my-index/_search } ``` -Multiple `text_expansion` queries can be combined with each other or other query types. This can be achieved by wrapping them in [boolean query clauses](/reference/query-languages/query-dsl-bool-query.md) and using linear boosting: +Multiple `text_expansion` queries can be combined with each other or other query types. This can be achieved by wrapping them in [boolean query clauses](/reference/query-languages/query-dsl/query-dsl-bool-query.md) and using linear boosting: ```console GET my-index/_search diff --git a/docs/reference/query-languages/query-dsl-weighted-tokens-query.md b/docs/reference/query-languages/query-dsl/query-dsl-weighted-tokens-query.md similarity index 98% rename from docs/reference/query-languages/query-dsl-weighted-tokens-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-weighted-tokens-query.md index 06be623bee1f..ab37210892a8 100644 --- a/docs/reference/query-languages/query-dsl-weighted-tokens-query.md +++ b/docs/reference/query-languages/query-dsl/query-dsl-weighted-tokens-query.md @@ -10,7 +10,7 @@ mapped_pages: ::::{admonition} Deprecated in 8.15.0. :class: warning -This query has been replaced by the [Sparse vector](/reference/query-languages/query-dsl-sparse-vector-query.md) and will be removed in an upcoming release. +This query has been replaced by the [Sparse vector](/reference/query-languages/query-dsl/query-dsl-sparse-vector-query.md) and will be removed in an upcoming release. :::: diff --git a/docs/reference/query-languages/query-dsl-wildcard-query.md b/docs/reference/query-languages/query-dsl/query-dsl-wildcard-query.md similarity index 91% rename from docs/reference/query-languages/query-dsl-wildcard-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-wildcard-query.md index dab51cd9de0e..b94ca4fc2e0f 100644 --- a/docs/reference/query-languages/query-dsl-wildcard-query.md +++ b/docs/reference/query-languages/query-dsl/query-dsl-wildcard-query.md @@ -40,7 +40,7 @@ GET /_search ## Parameters for `` [wildcard-query-field-params] `boost` -: (Optional, float) Floating point number used to decrease or increase the [relevance scores](/reference/query-languages/query-filter-context.md#relevance-scores) of a query. Defaults to `1.0`. +: (Optional, float) Floating point number used to decrease or increase the [relevance scores](/reference/query-languages/query-dsl/query-filter-context.md#relevance-scores) of a query. Defaults to `1.0`. You can use the `boost` parameter to adjust relevance scores for searches containing two or more queries. @@ -51,7 +51,7 @@ GET /_search : (Optional, Boolean) Allows case insensitive matching of the pattern with the indexed field values when set to true. Default is false which means the case sensitivity of matching depends on the underlying field’s mapping. `rewrite` -: (Optional, string) Method used to rewrite the query. For valid values and more information, see the [`rewrite` parameter](/reference/query-languages/query-dsl-multi-term-rewrite.md). +: (Optional, string) Method used to rewrite the query. For valid values and more information, see the [`rewrite` parameter](/reference/query-languages/query-dsl/query-dsl-multi-term-rewrite.md). `value` : (Required, string) Wildcard pattern for terms you wish to find in the provided ``. @@ -72,7 +72,7 @@ GET /_search ## Notes [wildcard-query-notes] -Wildcard queries using `*` can be resource-intensive, particularly with leading wildcards. To improve performance, minimize their use and consider alternatives like the [n-gram tokenizer](/reference/data-analysis/text-analysis/analysis-ngram-tokenizer.md). While this allows for more efficient searching, it may increase index size. For better performance and accuracy, combine wildcard queries with other query types like [`match`](/reference/query-languages/query-dsl-match-query.md) or [`bool`](/reference/query-languages/query-dsl-bool-query.md) to first narrow down results. +Wildcard queries using `*` can be resource-intensive, particularly with leading wildcards. To improve performance, minimize their use and consider alternatives like the [n-gram tokenizer](/reference/data-analysis/text-analysis/analysis-ngram-tokenizer.md). While this allows for more efficient searching, it may increase index size. For better performance and accuracy, combine wildcard queries with other query types like [`match`](/reference/query-languages/query-dsl/query-dsl-match-query.md) or [`bool`](/reference/query-languages/query-dsl/query-dsl-bool-query.md) to first narrow down results. ### Allow expensive queries [_allow_expensive_queries_7] diff --git a/docs/reference/query-languages/query-dsl-wrapper-query.md b/docs/reference/query-languages/query-dsl/query-dsl-wrapper-query.md similarity index 100% rename from docs/reference/query-languages/query-dsl-wrapper-query.md rename to docs/reference/query-languages/query-dsl/query-dsl-wrapper-query.md diff --git a/docs/reference/query-languages/query-filter-context.md b/docs/reference/query-languages/query-dsl/query-filter-context.md similarity index 97% rename from docs/reference/query-languages/query-filter-context.md rename to docs/reference/query-languages/query-dsl/query-filter-context.md index e805b3681237..67c7c0883fc2 100644 --- a/docs/reference/query-languages/query-filter-context.md +++ b/docs/reference/query-languages/query-dsl/query-filter-context.md @@ -49,8 +49,8 @@ Common filter applications include: Filter context applies when a query clause is passed to a `filter` parameter, such as: -* `filter` or `must_not` parameters in [`bool`](/reference/query-languages/query-dsl-bool-query.md) queries -* `filter` parameter in [`constant_score`](/reference/query-languages/query-dsl-constant-score-query.md) queries +* `filter` or `must_not` parameters in [`bool`](/reference/query-languages/query-dsl/query-dsl-bool-query.md) queries +* `filter` parameter in [`constant_score`](/reference/query-languages/query-dsl/query-dsl-constant-score-query.md) queries * [`filter`](/reference/data-analysis/aggregations/search-aggregations-bucket-filter-aggregation.md) aggregations Filters optimize query performance and efficiency, especially for structured data queries and when combined with full-text searches. diff --git a/docs/reference/query-languages/regexp-syntax.md b/docs/reference/query-languages/query-dsl/regexp-syntax.md similarity index 97% rename from docs/reference/query-languages/regexp-syntax.md rename to docs/reference/query-languages/query-dsl/regexp-syntax.md index 20d469f57629..5335c8cc0066 100644 --- a/docs/reference/query-languages/regexp-syntax.md +++ b/docs/reference/query-languages/query-dsl/regexp-syntax.md @@ -9,8 +9,8 @@ A [regular expression](https://en.wikipedia.org/wiki/Regular_expression) is a wa {{es}} supports regular expressions in the following queries: -* [`regexp`](/reference/query-languages/query-dsl-regexp-query.md) -* [`query_string`](/reference/query-languages/query-dsl-query-string-query.md) +* [`regexp`](/reference/query-languages/query-dsl/query-dsl-regexp-query.md) +* [`query_string`](/reference/query-languages/query-dsl/query-dsl-query-string-query.md) {{es}} uses [Apache Lucene](https://lucene.apache.org/core/)'s regular expression engine to parse these queries. diff --git a/docs/reference/query-languages/shape-queries.md b/docs/reference/query-languages/query-dsl/shape-queries.md similarity index 92% rename from docs/reference/query-languages/shape-queries.md rename to docs/reference/query-languages/query-dsl/shape-queries.md index b8020c680dc2..f0d284b0b684 100644 --- a/docs/reference/query-languages/shape-queries.md +++ b/docs/reference/query-languages/query-dsl/shape-queries.md @@ -11,7 +11,7 @@ Elasticsearch supports two types of cartesian data: [`point`](/reference/elastic The queries in this group are: -[`shape`](/reference/query-languages/query-dsl-shape-query.md) query +[`shape`](/reference/query-languages/query-dsl/query-dsl-shape-query.md) query : Finds documents with: * `shapes` which either intersect, are contained by, are within or do not intersect with the specified shape diff --git a/docs/reference/query-languages/span-queries.md b/docs/reference/query-languages/query-dsl/span-queries.md similarity index 57% rename from docs/reference/query-languages/span-queries.md rename to docs/reference/query-languages/query-dsl/span-queries.md index 69eb50ca523e..b5bcbd130c2f 100644 --- a/docs/reference/query-languages/span-queries.md +++ b/docs/reference/query-languages/query-dsl/span-queries.md @@ -13,31 +13,31 @@ Span queries cannot be mixed with non-span queries (with the exception of the `s The queries in this group are: -[`span_containing` query](/reference/query-languages/query-dsl-span-containing-query.md) +[`span_containing` query](/reference/query-languages/query-dsl/query-dsl-span-containing-query.md) : Accepts a list of span queries, but only returns those spans which also match a second span query. -[`span_field_masking` query](/reference/query-languages/query-dsl-span-field-masking-query.md) +[`span_field_masking` query](/reference/query-languages/query-dsl/query-dsl-span-field-masking-query.md) : Allows queries like `span-near` or `span-or` across different fields. -[`span_first` query](/reference/query-languages/query-dsl-span-first-query.md) +[`span_first` query](/reference/query-languages/query-dsl/query-dsl-span-first-query.md) : Accepts another span query whose matches must appear within the first N positions of the field. -[`span_multi` query](/reference/query-languages/query-dsl-span-multi-term-query.md) -: Wraps a [`term`](/reference/query-languages/query-dsl-term-query.md), [`range`](/reference/query-languages/query-dsl-range-query.md), [`prefix`](/reference/query-languages/query-dsl-prefix-query.md), [`wildcard`](/reference/query-languages/query-dsl-wildcard-query.md), [`regexp`](/reference/query-languages/query-dsl-regexp-query.md), or [`fuzzy`](/reference/query-languages/query-dsl-fuzzy-query.md) query. +[`span_multi` query](/reference/query-languages/query-dsl/query-dsl-span-multi-term-query.md) +: Wraps a [`term`](/reference/query-languages/query-dsl/query-dsl-term-query.md), [`range`](/reference/query-languages/query-dsl/query-dsl-range-query.md), [`prefix`](/reference/query-languages/query-dsl/query-dsl-prefix-query.md), [`wildcard`](/reference/query-languages/query-dsl/query-dsl-wildcard-query.md), [`regexp`](/reference/query-languages/query-dsl/query-dsl-regexp-query.md), or [`fuzzy`](/reference/query-languages/query-dsl/query-dsl-fuzzy-query.md) query. -[`span_near` query](/reference/query-languages/query-dsl-span-near-query.md) +[`span_near` query](/reference/query-languages/query-dsl/query-dsl-span-near-query.md) : Accepts multiple span queries whose matches must be within the specified distance of each other, and possibly in the same order. -[`span_not` query](/reference/query-languages/query-dsl-span-not-query.md) +[`span_not` query](/reference/query-languages/query-dsl/query-dsl-span-not-query.md) : Wraps another span query, and excludes any documents which match that query. -[`span_or` query](/reference/query-languages/query-dsl-span-query.md) +[`span_or` query](/reference/query-languages/query-dsl/query-dsl-span-query.md) : Combines multiple span queries — returns documents which match any of the specified queries. -[`span_term` query](/reference/query-languages/query-dsl-span-term-query.md) -: The equivalent of the [`term` query](/reference/query-languages/query-dsl-term-query.md) but for use with other span queries. +[`span_term` query](/reference/query-languages/query-dsl/query-dsl-span-term-query.md) +: The equivalent of the [`term` query](/reference/query-languages/query-dsl/query-dsl-term-query.md) but for use with other span queries. -[`span_within` query](/reference/query-languages/query-dsl-span-within-query.md) +[`span_within` query](/reference/query-languages/query-dsl/query-dsl-span-within-query.md) : The result from a single span query is returned as long is its span falls within the spans returned by a list of other span queries. diff --git a/docs/reference/query-languages/specialized-queries.md b/docs/reference/query-languages/query-dsl/specialized-queries.md similarity index 59% rename from docs/reference/query-languages/specialized-queries.md rename to docs/reference/query-languages/query-dsl/specialized-queries.md index 769c9598e0a1..f8b842a83d9b 100644 --- a/docs/reference/query-languages/specialized-queries.md +++ b/docs/reference/query-languages/query-dsl/specialized-queries.md @@ -7,31 +7,31 @@ mapped_pages: This group contains queries which do not fit into the other groups: -[`distance_feature` query](/reference/query-languages/query-dsl-distance-feature-query.md) +[`distance_feature` query](/reference/query-languages/query-dsl/query-dsl-distance-feature-query.md) : A query that computes scores based on the dynamically computed distances between the origin and documents' `date`, `date_nanos`, and `geo_point` fields. It is able to efficiently skip non-competitive hits. -[`more_like_this` query](/reference/query-languages/query-dsl-mlt-query.md) +[`more_like_this` query](/reference/query-languages/query-dsl/query-dsl-mlt-query.md) : This query finds documents which are similar to the specified text, document, or collection of documents. -[`percolate` query](/reference/query-languages/query-dsl-percolate-query.md) +[`percolate` query](/reference/query-languages/query-dsl/query-dsl-percolate-query.md) : This query finds queries that are stored as documents that match with the specified document. -[`rank_feature` query](/reference/query-languages/query-dsl-rank-feature-query.md) +[`rank_feature` query](/reference/query-languages/query-dsl/query-dsl-rank-feature-query.md) : A query that computes scores based on the values of numeric features and is able to efficiently skip non-competitive hits. -[`script` query](/reference/query-languages/query-dsl-script-query.md) -: This query allows a script to act as a filter. Also see the [`function_score` query](/reference/query-languages/query-dsl-function-score-query.md). +[`script` query](/reference/query-languages/query-dsl/query-dsl-script-query.md) +: This query allows a script to act as a filter. Also see the [`function_score` query](/reference/query-languages/query-dsl/query-dsl-function-score-query.md). -[`script_score` query](/reference/query-languages/query-dsl-script-score-query.md) +[`script_score` query](/reference/query-languages/query-dsl/query-dsl-script-score-query.md) : A query that allows to modify the score of a sub-query with a script. -[`wrapper` query](/reference/query-languages/query-dsl-wrapper-query.md) +[`wrapper` query](/reference/query-languages/query-dsl/query-dsl-wrapper-query.md) : A query that accepts other queries as json or yaml string. -[`pinned` query](/reference/query-languages/query-dsl-pinned-query.md) +[`pinned` query](/reference/query-languages/query-dsl/query-dsl-pinned-query.md) : A query that promotes selected documents over others matching a given query. -[`rule` query](/reference/query-languages/query-dsl-rule-query.md) +[`rule` query](/reference/query-languages/query-dsl/query-dsl-rule-query.md) : A query that supports applying query-based contextual rules, defined using the [Query Rules API](https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-query_rules), to a given query. diff --git a/docs/reference/query-languages/term-level-queries.md b/docs/reference/query-languages/query-dsl/term-level-queries.md similarity index 62% rename from docs/reference/query-languages/term-level-queries.md rename to docs/reference/query-languages/query-dsl/term-level-queries.md index 12986bc43ee2..563f3ebae266 100644 --- a/docs/reference/query-languages/term-level-queries.md +++ b/docs/reference/query-languages/query-dsl/term-level-queries.md @@ -7,7 +7,7 @@ mapped_pages: You can use **term-level queries** to find documents based on precise values in structured data. Examples of structured data include date ranges, IP addresses, prices, or product IDs. -Unlike [full-text queries](/reference/query-languages/full-text-queries.md), term-level queries do not analyze search terms. Instead, term-level queries match the exact terms stored in a field. +Unlike [full-text queries](/reference/query-languages/query-dsl/full-text-queries.md), term-level queries do not analyze search terms. Instead, term-level queries match the exact terms stored in a field. ::::{note} Term-level queries still normalize search terms for `keyword` fields with the `normalizer` property. For more details, see [`normalizer`](/reference/elasticsearch/mapping-reference/normalizer.md). @@ -18,32 +18,32 @@ Term-level queries still normalize search terms for `keyword` fields with the `n ## Types of term-level queries [term-level-query-types] -[`exists` query](/reference/query-languages/query-dsl-exists-query.md) +[`exists` query](/reference/query-languages/query-dsl/query-dsl-exists-query.md) : Returns documents that contain any indexed value for a field. -[`fuzzy` query](/reference/query-languages/query-dsl-fuzzy-query.md) +[`fuzzy` query](/reference/query-languages/query-dsl/query-dsl-fuzzy-query.md) : Returns documents that contain terms similar to the search term. {{es}} measures similarity, or fuzziness, using a [Levenshtein edit distance](https://en.wikipedia.org/wiki/Levenshtein_distance). -[`ids` query](/reference/query-languages/query-dsl-ids-query.md) +[`ids` query](/reference/query-languages/query-dsl/query-dsl-ids-query.md) : Returns documents based on their [document IDs](/reference/elasticsearch/mapping-reference/mapping-id-field.md). -[`prefix` query](/reference/query-languages/query-dsl-prefix-query.md) +[`prefix` query](/reference/query-languages/query-dsl/query-dsl-prefix-query.md) : Returns documents that contain a specific prefix in a provided field. -[`range` query](/reference/query-languages/query-dsl-range-query.md) +[`range` query](/reference/query-languages/query-dsl/query-dsl-range-query.md) : Returns documents that contain terms within a provided range. -[`regexp` query](/reference/query-languages/query-dsl-regexp-query.md) +[`regexp` query](/reference/query-languages/query-dsl/query-dsl-regexp-query.md) : Returns documents that contain terms matching a [regular expression](https://en.wikipedia.org/wiki/Regular_expression). -[`term` query](/reference/query-languages/query-dsl-term-query.md) +[`term` query](/reference/query-languages/query-dsl/query-dsl-term-query.md) : Returns documents that contain an exact term in a provided field. -[`terms` query](/reference/query-languages/query-dsl-terms-query.md) +[`terms` query](/reference/query-languages/query-dsl/query-dsl-terms-query.md) : Returns documents that contain one or more exact terms in a provided field. -[`terms_set` query](/reference/query-languages/query-dsl-terms-set-query.md) +[`terms_set` query](/reference/query-languages/query-dsl/query-dsl-terms-set-query.md) : Returns documents that contain a minimum number of exact terms in a provided field. You can define the minimum number of matching terms using a field or script. -[`wildcard` query](/reference/query-languages/query-dsl-wildcard-query.md) +[`wildcard` query](/reference/query-languages/query-dsl/query-dsl-wildcard-query.md) : Returns documents that contain terms matching a wildcard pattern. diff --git a/docs/reference/query-languages/vector-queries.md b/docs/reference/query-languages/query-dsl/vector-queries.md similarity index 71% rename from docs/reference/query-languages/vector-queries.md rename to docs/reference/query-languages/query-dsl/vector-queries.md index 00c3264e70ff..faa32fa32ff8 100644 --- a/docs/reference/query-languages/vector-queries.md +++ b/docs/reference/query-languages/query-dsl/vector-queries.md @@ -7,24 +7,24 @@ mapped_pages: Vector queries are specialized queries that work on vector fields to efficiently perform [semantic search](docs-content://solutions/search/semantic-search.md). -[`knn` query](/reference/query-languages/query-dsl-knn-query.md) +[`knn` query](/reference/query-languages/query-dsl/query-dsl-knn-query.md) : A query that finds the *k* nearest vectors to a query vector for [`dense_vector`](/reference/elasticsearch/mapping-reference/dense-vector.md) fields, as measured by a similarity metric. -[`sparse_vector` query](/reference/query-languages/query-dsl-sparse-vector-query.md) +[`sparse_vector` query](/reference/query-languages/query-dsl/query-dsl-sparse-vector-query.md) : A query used to search [`sparse_vector`](/reference/elasticsearch/mapping-reference/sparse-vector.md) field types. -[`semantic` query](/reference/query-languages/query-dsl-semantic-query.md) +[`semantic` query](/reference/query-languages/query-dsl/query-dsl-semantic-query.md) : A query that allows you to perform semantic search on [`semantic_text`](/reference/elasticsearch/mapping-reference/semantic-text.md) fields. ## Deprecated vector queries [_deprecated_vector_queries] -The following queries have been deprecated and will be removed in the near future. Use the [`sparse_vector` query](/reference/query-languages/query-dsl-sparse-vector-query.md) query instead. +The following queries have been deprecated and will be removed in the near future. Use the [`sparse_vector` query](/reference/query-languages/query-dsl/query-dsl-sparse-vector-query.md) query instead. -[`text_expansion` query](/reference/query-languages/query-dsl-text-expansion-query.md) +[`text_expansion` query](/reference/query-languages/query-dsl/query-dsl-text-expansion-query.md) : A query that allows you to perform sparse vector search on [`sparse_vector`](/reference/elasticsearch/mapping-reference/sparse-vector.md) or [`rank_features`](/reference/elasticsearch/mapping-reference/rank-features.md) fields. -[`weighted_tokens` query](/reference/query-languages/query-dsl-weighted-tokens-query.md) +[`weighted_tokens` query](/reference/query-languages/query-dsl/query-dsl-weighted-tokens-query.md) : Allows to perform text expansion queries optimizing for performance. diff --git a/docs/reference/query-languages/querydsl.md b/docs/reference/query-languages/querydsl.md index a686b9d83426..7737d0966532 100644 --- a/docs/reference/query-languages/querydsl.md +++ b/docs/reference/query-languages/querydsl.md @@ -14,12 +14,12 @@ Refer to the [Query DSL overview](docs-content://explore-analyze/query-filter/la Elasticsearch provides a full Query DSL (Domain Specific Language) based on JSON to define queries. Think of the Query DSL as an AST (Abstract Syntax Tree) of queries, consisting of two types of clauses: Leaf query clauses -: Leaf query clauses look for a particular value in a particular field, such as the [`match`](/reference/query-languages/query-dsl-match-query.md), [`term`](/reference/query-languages/query-dsl-term-query.md) or [`range`](/reference/query-languages/query-dsl-range-query.md) queries. These queries can be used by themselves. +: Leaf query clauses look for a particular value in a particular field, such as the [`match`](/reference/query-languages/query-dsl/query-dsl-match-query.md), [`term`](/reference/query-languages/query-dsl/query-dsl-term-query.md) or [`range`](/reference/query-languages/query-dsl/query-dsl-range-query.md) queries. These queries can be used by themselves. Compound query clauses -: Compound query clauses wrap other leaf **or** compound queries and are used to combine multiple queries in a logical fashion (such as the [`bool`](/reference/query-languages/query-dsl-bool-query.md) or [`dis_max`](/reference/query-languages/query-dsl-dis-max-query.md) query), or to alter their behaviour (such as the [`constant_score`](/reference/query-languages/query-dsl-constant-score-query.md) query). +: Compound query clauses wrap other leaf **or** compound queries and are used to combine multiple queries in a logical fashion (such as the [`bool`](/reference/query-languages/query-dsl/query-dsl-bool-query.md) or [`dis_max`](/reference/query-languages/query-dsl/query-dsl-dis-max-query.md) query), or to alter their behaviour (such as the [`constant_score`](/reference/query-languages/query-dsl/query-dsl-constant-score-query.md) query). -Query clauses behave differently depending on whether they are used in [query context or filter context](/reference/query-languages/query-filter-context.md). +Query clauses behave differently depending on whether they are used in [query context or filter context](/reference/query-languages/query-dsl/query-filter-context.md). $$$query-dsl-allow-expensive-queries$$$ @@ -27,20 +27,20 @@ Allow expensive queries : Certain types of queries will generally execute slowly due to the way they are implemented, which can affect the stability of the cluster. Those queries can be categorised as follows: * Queries that need to do linear scans to identify matches: - * [`script` queries](/reference/query-languages/query-dsl-script-query.md) + * [`script` queries](/reference/query-languages/query-dsl/query-dsl-script-query.md) * queries on [numeric](/reference/elasticsearch/mapping-reference/number.md), [date](/reference/elasticsearch/mapping-reference/date.md), [boolean](/reference/elasticsearch/mapping-reference/boolean.md), [ip](/reference/elasticsearch/mapping-reference/ip.md), [geo_point](/reference/elasticsearch/mapping-reference/geo-point.md) or [keyword](/reference/elasticsearch/mapping-reference/keyword.md) fields that are not indexed but have [doc values](/reference/elasticsearch/mapping-reference/doc-values.md) enabled * Queries that have a high up-front cost: - * [`fuzzy` queries](/reference/query-languages/query-dsl-fuzzy-query.md) (except on [`wildcard`](/reference/elasticsearch/mapping-reference/keyword.md#wildcard-field-type) fields) - * [`regexp` queries](/reference/query-languages/query-dsl-regexp-query.md) (except on [`wildcard`](/reference/elasticsearch/mapping-reference/keyword.md#wildcard-field-type) fields) - * [`prefix` queries](/reference/query-languages/query-dsl-prefix-query.md) (except on [`wildcard`](/reference/elasticsearch/mapping-reference/keyword.md#wildcard-field-type) fields or those without [`index_prefixes`](/reference/elasticsearch/mapping-reference/index-prefixes.md)) - * [`wildcard` queries](/reference/query-languages/query-dsl-wildcard-query.md) (except on [`wildcard`](/reference/elasticsearch/mapping-reference/keyword.md#wildcard-field-type) fields) - * [`range` queries](/reference/query-languages/query-dsl-range-query.md) on [`text`](/reference/elasticsearch/mapping-reference/text.md) and [`keyword`](/reference/elasticsearch/mapping-reference/keyword.md) fields + * [`fuzzy` queries](/reference/query-languages/query-dsl/query-dsl-fuzzy-query.md) (except on [`wildcard`](/reference/elasticsearch/mapping-reference/keyword.md#wildcard-field-type) fields) + * [`regexp` queries](/reference/query-languages/query-dsl/query-dsl-regexp-query.md) (except on [`wildcard`](/reference/elasticsearch/mapping-reference/keyword.md#wildcard-field-type) fields) + * [`prefix` queries](/reference/query-languages/query-dsl/query-dsl-prefix-query.md) (except on [`wildcard`](/reference/elasticsearch/mapping-reference/keyword.md#wildcard-field-type) fields or those without [`index_prefixes`](/reference/elasticsearch/mapping-reference/index-prefixes.md)) + * [`wildcard` queries](/reference/query-languages/query-dsl/query-dsl-wildcard-query.md) (except on [`wildcard`](/reference/elasticsearch/mapping-reference/keyword.md#wildcard-field-type) fields) + * [`range` queries](/reference/query-languages/query-dsl/query-dsl-range-query.md) on [`text`](/reference/elasticsearch/mapping-reference/text.md) and [`keyword`](/reference/elasticsearch/mapping-reference/keyword.md) fields - * [Joining queries](/reference/query-languages/joining-queries.md) + * [Joining queries](/reference/query-languages/query-dsl/joining-queries.md) * Queries that may have a high per-document cost: - * [`script_score` queries](/reference/query-languages/query-dsl-script-score-query.md) - * [`percolate` queries](/reference/query-languages/query-dsl-percolate-query.md) + * [`script_score` queries](/reference/query-languages/query-dsl/query-dsl-script-score-query.md) + * [`percolate` queries](/reference/query-languages/query-dsl/query-dsl-percolate-query.md) The execution of such queries can be prevented by setting the value of the `search.allow_expensive_queries` setting to `false` (defaults to `true`). diff --git a/docs/reference/query-languages/sql-commands.md b/docs/reference/query-languages/sql-commands.md deleted file mode 100644 index 713dd45a1899..000000000000 --- a/docs/reference/query-languages/sql-commands.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -mapped_pages: - - https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-commands.html ---- - -# SQL Commands [sql-commands] - -This section contains the list of SQL commands supported by Elasticsearch SQL along with their syntax: - -[DESCRIBE TABLE](/reference/query-languages/sql-syntax-describe-table.md) -: Describe a table. - -[SELECT](/reference/query-languages/sql-syntax-select.md) -: Retrieve rows from zero or more tables. - -[SHOW CATALOGS](/reference/query-languages/sql-syntax-show-catalogs.md) -: List available catalogs. - -[SHOW COLUMNS](/reference/query-languages/sql-syntax-show-columns.md) -: List columns in table. - -[SHOW FUNCTIONS](/reference/query-languages/sql-syntax-show-functions.md) -: List supported functions. - -[SHOW TABLES](/reference/query-languages/sql-syntax-show-tables.md) -: List tables available. - diff --git a/docs/reference/query-languages/sql-functions.md b/docs/reference/query-languages/sql-functions.md deleted file mode 100644 index 30124f635f41..000000000000 --- a/docs/reference/query-languages/sql-functions.md +++ /dev/null @@ -1,205 +0,0 @@ ---- -mapped_pages: - - https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-functions.html ---- - -# Functions and Operators [sql-functions] - -Elasticsearch SQL provides a comprehensive set of built-in operators and functions: - -* [Operators](/reference/query-languages/sql-operators.md) - - * [`Equality (=)`](/reference/query-languages/sql-operators.md#sql-operators-equality) - * [`Null safe Equality (<=>)`](/reference/query-languages/sql-operators.md#sql-operators-null-safe-equality) - * [`Inequality (<> or !=)`](/reference/query-languages/sql-operators.md#sql-operators-inequality) - * [`Comparison (<, <=, >, >=)`](/reference/query-languages/sql-operators.md#sql-operators-comparison) - * [`BETWEEN`](/reference/query-languages/sql-operators.md#sql-operators-between) - * [`IS NULL/IS NOT NULL`](/reference/query-languages/sql-operators.md#sql-operators-is-null) - * [`IN (, , ...)`](/reference/query-languages/sql-operators.md#sql-operators-in) - * [`AND`](/reference/query-languages/sql-operators-logical.md#sql-operators-and) - * [`OR`](/reference/query-languages/sql-operators-logical.md#sql-operators-or) - * [`NOT`](/reference/query-languages/sql-operators-logical.md#sql-operators-not) - * [`Add (+)`](/reference/query-languages/sql-operators-math.md#sql-operators-plus) - * [`Subtract (infix -)`](/reference/query-languages/sql-operators-math.md#sql-operators-subtract) - * [`Negate (unary -)`](/reference/query-languages/sql-operators-math.md#sql-operators-negate) - * [`Multiply (*)`](/reference/query-languages/sql-operators-math.md#sql-operators-multiply) - * [`Divide (/)`](/reference/query-languages/sql-operators-math.md#sql-operators-divide) - * [`Modulo or Remainder(%)`](/reference/query-languages/sql-operators-math.md#sql-operators-remainder) - * [`Cast (::)`](/reference/query-languages/sql-operators-cast.md#sql-operators-cast-cast) - -* [LIKE and RLIKE Operators](/reference/query-languages/sql-like-rlike-operators.md) - - * [`LIKE`](/reference/query-languages/sql-like-rlike-operators.md#sql-like-operator) - * [`RLIKE`](/reference/query-languages/sql-like-rlike-operators.md#sql-rlike-operator) - -* [Aggregate Functions](/reference/query-languages/sql-functions-aggs.md) - - * [`AVG`](/reference/query-languages/sql-functions-aggs.md#sql-functions-aggs-avg) - * [`COUNT`](/reference/query-languages/sql-functions-aggs.md#sql-functions-aggs-count) - * [`COUNT(ALL)`](/reference/query-languages/sql-functions-aggs.md#sql-functions-aggs-count-all) - * [`COUNT(DISTINCT)`](/reference/query-languages/sql-functions-aggs.md#sql-functions-aggs-count-distinct) - * [`FIRST/FIRST_VALUE`](/reference/query-languages/sql-functions-aggs.md#sql-functions-aggs-first) - * [`LAST/LAST_VALUE`](/reference/query-languages/sql-functions-aggs.md#sql-functions-aggs-last) - * [`MAX`](/reference/query-languages/sql-functions-aggs.md#sql-functions-aggs-max) - * [`MIN`](/reference/query-languages/sql-functions-aggs.md#sql-functions-aggs-min) - * [`SUM`](/reference/query-languages/sql-functions-aggs.md#sql-functions-aggs-sum) - * [`KURTOSIS`](/reference/query-languages/sql-functions-aggs.md#sql-functions-aggs-kurtosis) - * [`MAD`](/reference/query-languages/sql-functions-aggs.md#sql-functions-aggs-mad) - * [`PERCENTILE`](/reference/query-languages/sql-functions-aggs.md#sql-functions-aggs-percentile) - * [`PERCENTILE_RANK`](/reference/query-languages/sql-functions-aggs.md#sql-functions-aggs-percentile-rank) - * [`SKEWNESS`](/reference/query-languages/sql-functions-aggs.md#sql-functions-aggs-skewness) - * [`STDDEV_POP`](/reference/query-languages/sql-functions-aggs.md#sql-functions-aggs-stddev-pop) - * [`STDDEV_SAMP`](/reference/query-languages/sql-functions-aggs.md#sql-functions-aggs-stddev-samp) - * [`SUM_OF_SQUARES`](/reference/query-languages/sql-functions-aggs.md#sql-functions-aggs-sum-squares) - * [`VAR_POP`](/reference/query-languages/sql-functions-aggs.md#sql-functions-aggs-var-pop) - * [`VAR_SAMP`](/reference/query-languages/sql-functions-aggs.md#sql-functions-aggs-var-samp) - -* [Grouping Functions](/reference/query-languages/sql-functions-grouping.md) - - * [`HISTOGRAM`](/reference/query-languages/sql-functions-grouping.md#sql-functions-grouping-histogram) - -* [Date-Time Operators](/reference/query-languages/sql-functions-datetime.md#sql-functions-datetime-interval) -* [Date-Time Functions](/reference/query-languages/sql-functions-datetime.md#sql-functions-current-date) - - * [`CURRENT_DATE/CURDATE`](/reference/query-languages/sql-functions-datetime.md#sql-functions-current-date) - * [`CURRENT_TIME/CURTIME`](/reference/query-languages/sql-functions-datetime.md#sql-functions-current-time) - * [`CURRENT_TIMESTAMP`](/reference/query-languages/sql-functions-datetime.md#sql-functions-current-timestamp) - * [`DATE_ADD/DATEADD/TIMESTAMP_ADD/TIMESTAMPADD`](/reference/query-languages/sql-functions-datetime.md#sql-functions-datetime-add) - * [`DATE_DIFF/DATEDIFF/TIMESTAMP_DIFF/TIMESTAMPDIFF`](/reference/query-languages/sql-functions-datetime.md#sql-functions-datetime-diff) - * [`DATE_FORMAT`](/reference/query-languages/sql-functions-datetime.md#sql-functions-datetime-dateformat) - * [`DATE_PARSE`](/reference/query-languages/sql-functions-datetime.md#sql-functions-datetime-dateparse) - * [`DATETIME_FORMAT`](/reference/query-languages/sql-functions-datetime.md#sql-functions-datetime-datetimeformat) - * [`DATETIME_PARSE`](/reference/query-languages/sql-functions-datetime.md#sql-functions-datetime-datetimeparse) - * [`FORMAT`](/reference/query-languages/sql-functions-datetime.md#sql-functions-datetime-format) - * [`DATE_PART/DATEPART`](/reference/query-languages/sql-functions-datetime.md#sql-functions-datetime-part) - * [`DATE_TRUNC/DATETRUNC`](/reference/query-languages/sql-functions-datetime.md#sql-functions-datetime-trunc) - * [`DAY_OF_MONTH/DOM/DAY`](/reference/query-languages/sql-functions-datetime.md#sql-functions-datetime-day) - * [`DAY_OF_WEEK/DAYOFWEEK/DOW`](/reference/query-languages/sql-functions-datetime.md#sql-functions-datetime-dow) - * [`DAY_OF_YEAR/DOY`](/reference/query-languages/sql-functions-datetime.md#sql-functions-datetime-doy) - * [`DAY_NAME/DAYNAME`](/reference/query-languages/sql-functions-datetime.md#sql-functions-datetime-dayname) - * [`EXTRACT`](/reference/query-languages/sql-functions-datetime.md#sql-functions-datetime-extract) - * [`HOUR_OF_DAY/HOUR`](/reference/query-languages/sql-functions-datetime.md#sql-functions-datetime-hour) - * [`ISO_DAY_OF_WEEK/ISODAYOFWEEK/ISODOW/IDOW`](/reference/query-languages/sql-functions-datetime.md#sql-functions-datetime-isodow) - * [`ISO_WEEK_OF_YEAR/ISOWEEKOFYEAR/ISOWEEK/IWOY/IW`](/reference/query-languages/sql-functions-datetime.md#sql-functions-datetime-isoweek) - * [`MINUTE_OF_DAY`](/reference/query-languages/sql-functions-datetime.md#sql-functions-datetime-minuteofday) - * [`MINUTE_OF_HOUR/MINUTE`](/reference/query-languages/sql-functions-datetime.md#sql-functions-datetime-minute) - * [`MONTH_OF_YEAR/MONTH`](/reference/query-languages/sql-functions-datetime.md#sql-functions-datetime-month) - * [`MONTH_NAME/MONTHNAME`](/reference/query-languages/sql-functions-datetime.md#sql-functions-datetime-monthname) - * [`NOW`](/reference/query-languages/sql-functions-datetime.md#sql-functions-now) - * [`SECOND_OF_MINUTE/SECOND`](/reference/query-languages/sql-functions-datetime.md#sql-functions-datetime-second) - * [`QUARTER`](/reference/query-languages/sql-functions-datetime.md#sql-functions-datetime-quarter) - * [`TIME_PARSE`](/reference/query-languages/sql-functions-datetime.md#sql-functions-datetime-timeparse) - * [`TO_CHAR`](/reference/query-languages/sql-functions-datetime.md#sql-functions-datetime-to_char) - * [`TODAY`](/reference/query-languages/sql-functions-datetime.md#sql-functions-today) - * [`WEEK_OF_YEAR/WEEK`](/reference/query-languages/sql-functions-datetime.md#sql-functions-datetime-week) - * [`YEAR`](/reference/query-languages/sql-functions-datetime.md#sql-functions-datetime-year) - -* [Full-Text Search Functions](/reference/query-languages/sql-functions-search.md) - - * [`MATCH`](/reference/query-languages/sql-functions-search.md#sql-functions-search-match) - * [`QUERY`](/reference/query-languages/sql-functions-search.md#sql-functions-search-query) - * [`SCORE`](/reference/query-languages/sql-functions-search.md#sql-functions-search-score) - -* [Mathematical Functions](/reference/query-languages/sql-functions-math.md) - - * [`ABS`](/reference/query-languages/sql-functions-math.md#sql-functions-math-abs) - * [`CBRT`](/reference/query-languages/sql-functions-math.md#sql-functions-math-cbrt) - * [`CEIL/CEILING`](/reference/query-languages/sql-functions-math.md#sql-functions-math-ceil) - * [`E`](/reference/query-languages/sql-functions-math.md#sql-functions-math-e) - * [`EXP`](/reference/query-languages/sql-functions-math.md#sql-functions-math-exp) - * [`EXPM1`](/reference/query-languages/sql-functions-math.md#sql-functions-math-expm1) - * [`FLOOR`](/reference/query-languages/sql-functions-math.md#sql-functions-math-floor) - * [`LOG`](/reference/query-languages/sql-functions-math.md#sql-functions-math-log) - * [`LOG10`](/reference/query-languages/sql-functions-math.md#sql-functions-math-log10) - * [`PI`](/reference/query-languages/sql-functions-math.md#sql-functions-math-pi) - * [`POWER`](/reference/query-languages/sql-functions-math.md#sql-functions-math-power) - * [`RANDOM/RAND`](/reference/query-languages/sql-functions-math.md#sql-functions-math-random) - * [`ROUND`](/reference/query-languages/sql-functions-math.md#sql-functions-math-round) - * [`SIGN/SIGNUM`](/reference/query-languages/sql-functions-math.md#sql-functions-math-sign) - * [`SQRT`](/reference/query-languages/sql-functions-math.md#sql-functions-math-sqrt) - * [`TRUNCATE/TRUNC`](/reference/query-languages/sql-functions-math.md#sql-functions-math-truncate) - * [`ACOS`](/reference/query-languages/sql-functions-math.md#sql-functions-math-acos) - * [`ASIN`](/reference/query-languages/sql-functions-math.md#sql-functions-math-asin) - * [`ATAN`](/reference/query-languages/sql-functions-math.md#sql-functions-math-atan) - * [`ATAN2`](/reference/query-languages/sql-functions-math.md#sql-functions-math-atan2) - * [`COS`](/reference/query-languages/sql-functions-math.md#sql-functions-math-cos) - * [`COSH`](/reference/query-languages/sql-functions-math.md#sql-functions-math-cosh) - * [`COT`](/reference/query-languages/sql-functions-math.md#sql-functions-math-cot) - * [`DEGREES`](/reference/query-languages/sql-functions-math.md#sql-functions-math-degrees) - * [`RADIANS`](/reference/query-languages/sql-functions-math.md#sql-functions-math-radians) - * [`SIN`](/reference/query-languages/sql-functions-math.md#sql-functions-math-sin) - * [`SINH`](/reference/query-languages/sql-functions-math.md#sql-functions-math-sinh) - * [`TAN`](/reference/query-languages/sql-functions-math.md#sql-functions-math-tan) - -* [String Functions](/reference/query-languages/sql-functions-string.md) - - * [`ASCII`](/reference/query-languages/sql-functions-string.md#sql-functions-string-ascii) - * [`BIT_LENGTH`](/reference/query-languages/sql-functions-string.md#sql-functions-string-bit-length) - * [`CHAR`](/reference/query-languages/sql-functions-string.md#sql-functions-string-char) - * [`CHAR_LENGTH`](/reference/query-languages/sql-functions-string.md#sql-functions-string-char-length) - * [`CONCAT`](/reference/query-languages/sql-functions-string.md#sql-functions-string-concat) - * [`INSERT`](/reference/query-languages/sql-functions-string.md#sql-functions-string-insert) - * [`LCASE`](/reference/query-languages/sql-functions-string.md#sql-functions-string-lcase) - * [`LEFT`](/reference/query-languages/sql-functions-string.md#sql-functions-string-left) - * [`LENGTH`](/reference/query-languages/sql-functions-string.md#sql-functions-string-length) - * [`LOCATE`](/reference/query-languages/sql-functions-string.md#sql-functions-string-locate) - * [`LTRIM`](/reference/query-languages/sql-functions-string.md#sql-functions-string-ltrim) - * [`OCTET_LENGTH`](/reference/query-languages/sql-functions-string.md#sql-functions-string-octet-length) - * [`POSITION`](/reference/query-languages/sql-functions-string.md#sql-functions-string-position) - * [`REPEAT`](/reference/query-languages/sql-functions-string.md#sql-functions-string-repeat) - * [`REPLACE`](/reference/query-languages/sql-functions-string.md#sql-functions-string-replace) - * [`RIGHT`](/reference/query-languages/sql-functions-string.md#sql-functions-string-right) - * [`RTRIM`](/reference/query-languages/sql-functions-string.md#sql-functions-string-rtrim) - * [`SPACE`](/reference/query-languages/sql-functions-string.md#sql-functions-string-space) - * [`SUBSTRING`](/reference/query-languages/sql-functions-string.md#sql-functions-string-substring) - * [`TRIM`](/reference/query-languages/sql-functions-string.md#sql-functions-string-trim) - * [`UCASE`](/reference/query-languages/sql-functions-string.md#sql-functions-string-ucase) - -* [Type Conversion Functions](/reference/query-languages/sql-functions-type-conversion.md) - - * [`CAST`](/reference/query-languages/sql-functions-type-conversion.md#sql-functions-type-conversion-cast) - * [`CONVERT`](/reference/query-languages/sql-functions-type-conversion.md#sql-functions-type-conversion-convert) - -* [Conditional Functions And Expressions](/reference/query-languages/sql-functions-conditional.md) - - * [`CASE`](/reference/query-languages/sql-functions-conditional.md#sql-functions-conditional-case) - * [`COALESCE`](/reference/query-languages/sql-functions-conditional.md#sql-functions-conditional-coalesce) - * [`GREATEST`](/reference/query-languages/sql-functions-conditional.md#sql-functions-conditional-greatest) - * [`IFNULL`](/reference/query-languages/sql-functions-conditional.md#sql-functions-conditional-ifnull) - * [`IIF`](/reference/query-languages/sql-functions-conditional.md#sql-functions-conditional-iif) - * [`ISNULL`](/reference/query-languages/sql-functions-conditional.md#sql-functions-conditional-isnull) - * [`LEAST`](/reference/query-languages/sql-functions-conditional.md#sql-functions-conditional-least) - * [`NULLIF`](/reference/query-languages/sql-functions-conditional.md#sql-functions-conditional-nullif) - * [`NVL`](/reference/query-languages/sql-functions-conditional.md#sql-functions-conditional-nvl) - -* [Geo Functions](/reference/query-languages/sql-functions-geo.md) - - * [`ST_AsWKT`](/reference/query-languages/sql-functions-geo.md#sql-functions-geo-st-as-wkt) - * [`ST_Distance`](/reference/query-languages/sql-functions-geo.md#sql-functions-geo-st-distance) - * [`ST_GeometryType`](/reference/query-languages/sql-functions-geo.md#sql-functions-geo-st-geometrytype) - * [`ST_WKTToSQL`](/reference/query-languages/sql-functions-geo.md#sql-functions-geo-st-wkt-to-sql) - * [`ST_X`](/reference/query-languages/sql-functions-geo.md#sql-functions-geo-st-x) - * [`ST_Y`](/reference/query-languages/sql-functions-geo.md#sql-functions-geo-st-y) - * [`ST_Z`](/reference/query-languages/sql-functions-geo.md#sql-functions-geo-st-z) - -* [System Functions](/reference/query-languages/sql-functions-system.md) - - * [`DATABASE`](/reference/query-languages/sql-functions-system.md#sql-functions-system-database) - * [`USER`](/reference/query-languages/sql-functions-system.md#sql-functions-system-user) - - - - - - - - - - - - - - - - - diff --git a/docs/reference/query-languages/sql.md b/docs/reference/query-languages/sql.md index 13b4add83664..ef3b1381443c 100644 --- a/docs/reference/query-languages/sql.md +++ b/docs/reference/query-languages/sql.md @@ -7,14 +7,14 @@ Refer to [SQL overview](docs-content://explore-analyze/query-filter/languages/sq ::: -[SQL language](sql-spec.md) +[SQL language](sql/sql-spec.md) : SQL syntax and semantics -[Functions and operators](sql-functions.md) +[Functions and operators](sql/sql-functions.md) : Built-in functions and operators -[Reserved keywords](sql-syntax-reserved.md) +[Reserved keywords](sql/sql-syntax-reserved.md) : Keywords reserved for Elasticsearch SQL -[SQL limitations](sql-limitations.md) +[SQL limitations](sql/sql-limitations.md) : Limitations for Elasticsearch SQL \ No newline at end of file diff --git a/docs/reference/query-languages/sql/sql-commands.md b/docs/reference/query-languages/sql/sql-commands.md new file mode 100644 index 000000000000..d29663f73153 --- /dev/null +++ b/docs/reference/query-languages/sql/sql-commands.md @@ -0,0 +1,27 @@ +--- +mapped_pages: + - https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-commands.html +--- + +# SQL Commands [sql-commands] + +This section contains the list of SQL commands supported by Elasticsearch SQL along with their syntax: + +[DESCRIBE TABLE](/reference/query-languages/sql/sql-syntax-describe-table.md) +: Describe a table. + +[SELECT](/reference/query-languages/sql/sql-syntax-select.md) +: Retrieve rows from zero or more tables. + +[SHOW CATALOGS](/reference/query-languages/sql/sql-syntax-show-catalogs.md) +: List available catalogs. + +[SHOW COLUMNS](/reference/query-languages/sql/sql-syntax-show-columns.md) +: List columns in table. + +[SHOW FUNCTIONS](/reference/query-languages/sql/sql-syntax-show-functions.md) +: List supported functions. + +[SHOW TABLES](/reference/query-languages/sql/sql-syntax-show-tables.md) +: List tables available. + diff --git a/docs/reference/query-languages/sql-data-types.md b/docs/reference/query-languages/sql/sql-data-types.md similarity index 94% rename from docs/reference/query-languages/sql-data-types.md rename to docs/reference/query-languages/sql/sql-data-types.md index f7bee95267e9..fc6f04c9e785 100644 --- a/docs/reference/query-languages/sql-data-types.md +++ b/docs/reference/query-languages/sql/sql-data-types.md @@ -33,7 +33,7 @@ mapped_pages: | *types not mentioned above* | `unsupported` | OTHER | 0 | ::::{note} -Most of {{es}} [data types](/reference/elasticsearch/mapping-reference/field-data-types.md) are available in Elasticsearch SQL, as indicated above. As one can see, all of {{es}} [data types](/reference/elasticsearch/mapping-reference/field-data-types.md) are mapped to the data type with the same name in Elasticsearch SQL, with the exception of **date** data type which is mapped to **datetime*** in Elasticsearch SQL. This is to avoid confusion with the ANSI SQL types ***DATE** (date only) and **TIME** (time only), which are also supported by Elasticsearch SQL in queries (with the use of [`CAST`](/reference/query-languages/sql-functions-type-conversion.md#sql-functions-type-conversion-cast)/[`CONVERT`](/reference/query-languages/sql-functions-type-conversion.md#sql-functions-type-conversion-convert)), but don’t correspond to an actual mapping in {{es}} (see the [`table`](#es-sql-only-types) below). +Most of {{es}} [data types](/reference/elasticsearch/mapping-reference/field-data-types.md) are available in Elasticsearch SQL, as indicated above. As one can see, all of {{es}} [data types](/reference/elasticsearch/mapping-reference/field-data-types.md) are mapped to the data type with the same name in Elasticsearch SQL, with the exception of **date** data type which is mapped to **datetime*** in Elasticsearch SQL. This is to avoid confusion with the ANSI SQL types ***DATE** (date only) and **TIME** (time only), which are also supported by Elasticsearch SQL in queries (with the use of [`CAST`](/reference/query-languages/sql/sql-functions-type-conversion.md#sql-functions-type-conversion-cast)/[`CONVERT`](/reference/query-languages/sql/sql-functions-type-conversion.md#sql-functions-type-conversion-convert)), but don’t correspond to an actual mapping in {{es}} (see the [`table`](#es-sql-only-types) below). :::: diff --git a/docs/reference/query-languages/sql-functions-aggs.md b/docs/reference/query-languages/sql/sql-functions-aggs.md similarity index 99% rename from docs/reference/query-languages/sql-functions-aggs.md rename to docs/reference/query-languages/sql/sql-functions-aggs.md index 089f198fd0e0..b096962f6ba8 100644 --- a/docs/reference/query-languages/sql-functions-aggs.md +++ b/docs/reference/query-languages/sql/sql-functions-aggs.md @@ -5,7 +5,7 @@ mapped_pages: # Aggregate Functions [sql-functions-aggs] -Functions for computing a *single* result from a set of input values. Elasticsearch SQL supports aggregate functions only alongside [grouping](/reference/query-languages/sql-syntax-select.md#sql-syntax-group-by) (implicit or explicit). +Functions for computing a *single* result from a set of input values. Elasticsearch SQL supports aggregate functions only alongside [grouping](/reference/query-languages/sql/sql-syntax-select.md#sql-syntax-group-by) (implicit or explicit). ## General Purpose [sql-functions-aggs-general] diff --git a/docs/reference/query-languages/sql-functions-conditional.md b/docs/reference/query-languages/sql/sql-functions-conditional.md similarity index 100% rename from docs/reference/query-languages/sql-functions-conditional.md rename to docs/reference/query-languages/sql/sql-functions-conditional.md diff --git a/docs/reference/query-languages/sql-functions-datetime.md b/docs/reference/query-languages/sql/sql-functions-datetime.md similarity index 100% rename from docs/reference/query-languages/sql-functions-datetime.md rename to docs/reference/query-languages/sql/sql-functions-datetime.md diff --git a/docs/reference/query-languages/sql-functions-geo.md b/docs/reference/query-languages/sql/sql-functions-geo.md similarity index 100% rename from docs/reference/query-languages/sql-functions-geo.md rename to docs/reference/query-languages/sql/sql-functions-geo.md diff --git a/docs/reference/query-languages/sql-functions-grouping.md b/docs/reference/query-languages/sql/sql-functions-grouping.md similarity index 96% rename from docs/reference/query-languages/sql-functions-grouping.md rename to docs/reference/query-languages/sql/sql-functions-grouping.md index 9111477a1863..4467f020dd3d 100644 --- a/docs/reference/query-languages/sql-functions-grouping.md +++ b/docs/reference/query-languages/sql/sql-functions-grouping.md @@ -5,7 +5,7 @@ mapped_pages: # Grouping Functions [sql-functions-grouping] -Functions for creating special *grouping*s (also known as *bucketing*); as such these need to be used as part of the [grouping](/reference/query-languages/sql-syntax-select.md#sql-syntax-group-by). +Functions for creating special *grouping*s (also known as *bucketing*); as such these need to be used as part of the [grouping](/reference/query-languages/sql/sql-syntax-select.md#sql-syntax-group-by). ## `HISTOGRAM` [sql-functions-grouping-histogram] @@ -24,7 +24,7 @@ HISTOGRAM( 1. numeric expression (typically a field). If this field contains only `null` values, the function returns `null`. Otherwise, the function ignores `null` values in this field. 2. numeric interval. If `null`, the function returns `null`. 3. date/time expression (typically a field). If this field contains only `null` values, the function returns `null`. Otherwise, the function ignores `null` values in this field. -4. date/time [interval](/reference/query-languages/sql-functions-datetime.md#sql-functions-datetime-interval). If `null`, the function returns `null`. +4. date/time [interval](/reference/query-languages/sql/sql-functions-datetime.md#sql-functions-datetime-interval). If `null`, the function returns `null`. **Output**: non-empty buckets or groups of the given expression divided according to the given interval diff --git a/docs/reference/query-languages/sql-functions-math.md b/docs/reference/query-languages/sql/sql-functions-math.md similarity index 100% rename from docs/reference/query-languages/sql-functions-math.md rename to docs/reference/query-languages/sql/sql-functions-math.md diff --git a/docs/reference/query-languages/sql-functions-search.md b/docs/reference/query-languages/sql/sql-functions-search.md similarity index 92% rename from docs/reference/query-languages/sql-functions-search.md rename to docs/reference/query-languages/sql/sql-functions-search.md index 2c79234da741..771558bd70f7 100644 --- a/docs/reference/query-languages/sql-functions-search.md +++ b/docs/reference/query-languages/sql/sql-functions-search.md @@ -25,7 +25,7 @@ MATCH( 3. additional parameters; optional -**Description**: A full-text search option, in the form of a predicate, available in Elasticsearch SQL that gives the user control over powerful [match](/reference/query-languages/query-dsl-match-query.md) and [multi_match](/reference/query-languages/query-dsl-multi-match-query.md) {{es}} queries. +**Description**: A full-text search option, in the form of a predicate, available in Elasticsearch SQL that gives the user control over powerful [match](/reference/query-languages/query-dsl/query-dsl-match-query.md) and [multi_match](/reference/query-languages/query-dsl/query-dsl-multi-match-query.md) {{es}} queries. The first parameter is the field or fields to match against. In case it receives one value only, Elasticsearch SQL will use a `match` query to perform the search: @@ -54,7 +54,7 @@ Frank Herbert |God Emperor of Dune|7.0029488 ``` ::::{note} -The `multi_match` query in {{es}} has the option of [per-field boosting](/reference/query-languages/query-dsl-multi-match-query.md) that gives preferential weight (in terms of scoring) to fields being searched in, using the `^` character. In the example above, the `name` field has a greater weight in the final score than the `author` field when searching for `frank dune` text in both of them. +The `multi_match` query in {{es}} has the option of [per-field boosting](/reference/query-languages/query-dsl/query-dsl-multi-match-query.md) that gives preferential weight (in terms of scoring) to fields being searched in, using the `^` character. In the example above, the `name` field has a greater weight in the final score than the `author` field when searching for `frank dune` text in both of them. :::: @@ -95,7 +95,7 @@ QUERY( 2. additional parameters; optional -**Description**: Just like `MATCH`, `QUERY` is a full-text search predicate that gives the user control over the [query_string](/reference/query-languages/query-dsl-query-string-query.md) query in {{es}}. +**Description**: Just like `MATCH`, `QUERY` is a full-text search predicate that gives the user control over the [query_string](/reference/query-languages/query-dsl/query-dsl-query-string-query.md) query in {{es}}. The first parameter is basically the input that will be passed as is to the `query_string` query, which means that anything that `query_string` accepts in its `query` field can be used here as well: @@ -156,7 +156,7 @@ SCORE() **Description**: Returns the [relevance](https://www.elastic.co/guide/en/elasticsearch/guide/2.x/relevance-intro.html) of a given input to the executed query. The higher score, the more relevant the data. ::::{note} -When doing multiple text queries in the `WHERE` clause then, their scores will be combined using the same rules as {{es}}'s [bool query](/reference/query-languages/query-dsl-bool-query.md). +When doing multiple text queries in the `WHERE` clause then, their scores will be combined using the same rules as {{es}}'s [bool query](/reference/query-languages/query-dsl/query-dsl-bool-query.md). :::: diff --git a/docs/reference/query-languages/sql-functions-string.md b/docs/reference/query-languages/sql/sql-functions-string.md similarity index 100% rename from docs/reference/query-languages/sql-functions-string.md rename to docs/reference/query-languages/sql/sql-functions-string.md diff --git a/docs/reference/query-languages/sql-functions-system.md b/docs/reference/query-languages/sql/sql-functions-system.md similarity index 100% rename from docs/reference/query-languages/sql-functions-system.md rename to docs/reference/query-languages/sql/sql-functions-system.md diff --git a/docs/reference/query-languages/sql-functions-type-conversion.md b/docs/reference/query-languages/sql/sql-functions-type-conversion.md similarity index 77% rename from docs/reference/query-languages/sql-functions-type-conversion.md rename to docs/reference/query-languages/sql/sql-functions-type-conversion.md index 920b3c9cb79d..cbce6aa89fff 100644 --- a/docs/reference/query-languages/sql-functions-type-conversion.md +++ b/docs/reference/query-languages/sql/sql-functions-type-conversion.md @@ -19,7 +19,7 @@ CAST( 2. Target data type to cast to -**Description**: Casts the result of the given expression to the target [data type](/reference/query-languages/sql-data-types.md). If the cast is not possible (for example because of target type is too narrow or because the value itself cannot be converted), the query fails. +**Description**: Casts the result of the given expression to the target [data type](/reference/query-languages/sql/sql-data-types.md). If the cast is not possible (for example because of target type is too narrow or because the value itself cannot be converted), the query fails. ```sql SELECT CAST('123' AS INT) AS int; @@ -63,7 +63,7 @@ CONVERT( 2. Target data type to convert to -**Description**: Works exactly like [`CAST`](#sql-functions-type-conversion-cast) with slightly different syntax. Moreover, apart from the standard [data types](/reference/query-languages/sql-data-types.md) it supports the corresponding [ODBC data types](https://docs.microsoft.com/en-us/sql/odbc/reference/appendixes/explicit-data-type-conversion-function?view=sql-server-2017). +**Description**: Works exactly like [`CAST`](#sql-functions-type-conversion-cast) with slightly different syntax. Moreover, apart from the standard [data types](/reference/query-languages/sql/sql-data-types.md) it supports the corresponding [ODBC data types](https://docs.microsoft.com/en-us/sql/odbc/reference/appendixes/explicit-data-type-conversion-function?view=sql-server-2017). ```sql SELECT CONVERT('123', SQL_INTEGER) AS int; diff --git a/docs/reference/query-languages/sql/sql-functions.md b/docs/reference/query-languages/sql/sql-functions.md new file mode 100644 index 000000000000..e7a4fe98fed8 --- /dev/null +++ b/docs/reference/query-languages/sql/sql-functions.md @@ -0,0 +1,205 @@ +--- +mapped_pages: + - https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-functions.html +--- + +# Functions and Operators [sql-functions] + +Elasticsearch SQL provides a comprehensive set of built-in operators and functions: + +* [Operators](/reference/query-languages/sql/sql-operators.md) + + * [`Equality (=)`](/reference/query-languages/sql/sql-operators.md#sql-operators-equality) + * [`Null safe Equality (<=>)`](/reference/query-languages/sql/sql-operators.md#sql-operators-null-safe-equality) + * [`Inequality (<> or !=)`](/reference/query-languages/sql/sql-operators.md#sql-operators-inequality) + * [`Comparison (<, <=, >, >=)`](/reference/query-languages/sql/sql-operators.md#sql-operators-comparison) + * [`BETWEEN`](/reference/query-languages/sql/sql-operators.md#sql-operators-between) + * [`IS NULL/IS NOT NULL`](/reference/query-languages/sql/sql-operators.md#sql-operators-is-null) + * [`IN (, , ...)`](/reference/query-languages/sql/sql-operators.md#sql-operators-in) + * [`AND`](/reference/query-languages/sql/sql-operators-logical.md#sql-operators-and) + * [`OR`](/reference/query-languages/sql/sql-operators-logical.md#sql-operators-or) + * [`NOT`](/reference/query-languages/sql/sql-operators-logical.md#sql-operators-not) + * [`Add (+)`](/reference/query-languages/sql/sql-operators-math.md#sql-operators-plus) + * [`Subtract (infix -)`](/reference/query-languages/sql/sql-operators-math.md#sql-operators-subtract) + * [`Negate (unary -)`](/reference/query-languages/sql/sql-operators-math.md#sql-operators-negate) + * [`Multiply (*)`](/reference/query-languages/sql/sql-operators-math.md#sql-operators-multiply) + * [`Divide (/)`](/reference/query-languages/sql/sql-operators-math.md#sql-operators-divide) + * [`Modulo or Remainder(%)`](/reference/query-languages/sql/sql-operators-math.md#sql-operators-remainder) + * [`Cast (::)`](/reference/query-languages/sql/sql-operators-cast.md#sql-operators-cast-cast) + +* [LIKE and RLIKE Operators](/reference/query-languages/sql/sql-like-rlike-operators.md) + + * [`LIKE`](/reference/query-languages/sql/sql-like-rlike-operators.md#sql-like-operator) + * [`RLIKE`](/reference/query-languages/sql/sql-like-rlike-operators.md#sql-rlike-operator) + +* [Aggregate Functions](/reference/query-languages/sql/sql-functions-aggs.md) + + * [`AVG`](/reference/query-languages/sql/sql-functions-aggs.md#sql-functions-aggs-avg) + * [`COUNT`](/reference/query-languages/sql/sql-functions-aggs.md#sql-functions-aggs-count) + * [`COUNT(ALL)`](sql-functions-aggs.md#sql-functions-aggs-count-all) + * [`COUNT(DISTINCT)`](sql-functions-aggs.md#sql-functions-aggs-count-distinct) + * [`FIRST/FIRST_VALUE`](/reference/query-languages/sql/sql-functions-aggs.md#sql-functions-aggs-first) + * [`LAST/LAST_VALUE`](/reference/query-languages/sql/sql-functions-aggs.md#sql-functions-aggs-last) + * [`MAX`](/reference/query-languages/sql/sql-functions-aggs.md#sql-functions-aggs-max) + * [`MIN`](/reference/query-languages/sql/sql-functions-aggs.md#sql-functions-aggs-min) + * [`SUM`](/reference/query-languages/sql/sql-functions-aggs.md#sql-functions-aggs-sum) + * [`KURTOSIS`](/reference/query-languages/sql/sql-functions-aggs.md#sql-functions-aggs-kurtosis) + * [`MAD`](/reference/query-languages/sql/sql-functions-aggs.md#sql-functions-aggs-mad) + * [`PERCENTILE`](/reference/query-languages/sql/sql-functions-aggs.md#sql-functions-aggs-percentile) + * [`PERCENTILE_RANK`](/reference/query-languages/sql/sql-functions-aggs.md#sql-functions-aggs-percentile-rank) + * [`SKEWNESS`](/reference/query-languages/sql/sql-functions-aggs.md#sql-functions-aggs-skewness) + * [`STDDEV_POP`](/reference/query-languages/sql/sql-functions-aggs.md#sql-functions-aggs-stddev-pop) + * [`STDDEV_SAMP`](/reference/query-languages/sql/sql-functions-aggs.md#sql-functions-aggs-stddev-samp) + * [`SUM_OF_SQUARES`](/reference/query-languages/sql/sql-functions-aggs.md#sql-functions-aggs-sum-squares) + * [`VAR_POP`](/reference/query-languages/sql/sql-functions-aggs.md#sql-functions-aggs-var-pop) + * [`VAR_SAMP`](/reference/query-languages/sql/sql-functions-aggs.md#sql-functions-aggs-var-samp) + +* [Grouping Functions](/reference/query-languages/sql/sql-functions-grouping.md) + + * [`HISTOGRAM`](/reference/query-languages/sql/sql-functions-grouping.md#sql-functions-grouping-histogram) + +* [Date-Time Operators](/reference/query-languages/sql/sql-functions-datetime.md#sql-functions-datetime-interval) +* [Date-Time Functions](/reference/query-languages/sql/sql-functions-datetime.md#sql-functions-current-date) + + * [`CURRENT_DATE/CURDATE`](/reference/query-languages/sql/sql-functions-datetime.md#sql-functions-current-date) + * [`CURRENT_TIME/CURTIME`](/reference/query-languages/sql/sql-functions-datetime.md#sql-functions-current-time) + * [`CURRENT_TIMESTAMP`](/reference/query-languages/sql/sql-functions-datetime.md#sql-functions-current-timestamp) + * [`DATE_ADD/DATEADD/TIMESTAMP_ADD/TIMESTAMPADD`](/reference/query-languages/sql/sql-functions-datetime.md#sql-functions-datetime-add) + * [`DATE_DIFF/DATEDIFF/TIMESTAMP_DIFF/TIMESTAMPDIFF`](/reference/query-languages/sql/sql-functions-datetime.md#sql-functions-datetime-diff) + * [`DATE_FORMAT`](/reference/query-languages/sql/sql-functions-datetime.md#sql-functions-datetime-dateformat) + * [`DATE_PARSE`](/reference/query-languages/sql/sql-functions-datetime.md#sql-functions-datetime-dateparse) + * [`DATETIME_FORMAT`](/reference/query-languages/sql/sql-functions-datetime.md#sql-functions-datetime-datetimeformat) + * [`DATETIME_PARSE`](/reference/query-languages/sql/sql-functions-datetime.md#sql-functions-datetime-datetimeparse) + * [`FORMAT`](/reference/query-languages/sql/sql-functions-datetime.md#sql-functions-datetime-format) + * [`DATE_PART/DATEPART`](/reference/query-languages/sql/sql-functions-datetime.md#sql-functions-datetime-part) + * [`DATE_TRUNC/DATETRUNC`](/reference/query-languages/sql/sql-functions-datetime.md#sql-functions-datetime-trunc) + * [`DAY_OF_MONTH/DOM/DAY`](/reference/query-languages/sql/sql-functions-datetime.md#sql-functions-datetime-day) + * [`DAY_OF_WEEK/DAYOFWEEK/DOW`](/reference/query-languages/sql/sql-functions-datetime.md#sql-functions-datetime-dow) + * [`DAY_OF_YEAR/DOY`](/reference/query-languages/sql/sql-functions-datetime.md#sql-functions-datetime-doy) + * [`DAY_NAME/DAYNAME`](/reference/query-languages/sql/sql-functions-datetime.md#sql-functions-datetime-dayname) + * [`EXTRACT`](/reference/query-languages/sql/sql-functions-datetime.md#sql-functions-datetime-extract) + * [`HOUR_OF_DAY/HOUR`](/reference/query-languages/sql/sql-functions-datetime.md#sql-functions-datetime-hour) + * [`ISO_DAY_OF_WEEK/ISODAYOFWEEK/ISODOW/IDOW`](/reference/query-languages/sql/sql-functions-datetime.md#sql-functions-datetime-isodow) + * [`ISO_WEEK_OF_YEAR/ISOWEEKOFYEAR/ISOWEEK/IWOY/IW`](/reference/query-languages/sql/sql-functions-datetime.md#sql-functions-datetime-isoweek) + * [`MINUTE_OF_DAY`](/reference/query-languages/sql/sql-functions-datetime.md#sql-functions-datetime-minuteofday) + * [`MINUTE_OF_HOUR/MINUTE`](/reference/query-languages/sql/sql-functions-datetime.md#sql-functions-datetime-minute) + * [`MONTH_OF_YEAR/MONTH`](/reference/query-languages/sql/sql-functions-datetime.md#sql-functions-datetime-month) + * [`MONTH_NAME/MONTHNAME`](/reference/query-languages/sql/sql-functions-datetime.md#sql-functions-datetime-monthname) + * [`NOW`](/reference/query-languages/sql/sql-functions-datetime.md#sql-functions-now) + * [`SECOND_OF_MINUTE/SECOND`](/reference/query-languages/sql/sql-functions-datetime.md#sql-functions-datetime-second) + * [`QUARTER`](/reference/query-languages/sql/sql-functions-datetime.md#sql-functions-datetime-quarter) + * [`TIME_PARSE`](/reference/query-languages/sql/sql-functions-datetime.md#sql-functions-datetime-timeparse) + * [`TO_CHAR`](/reference/query-languages/sql/sql-functions-datetime.md#sql-functions-datetime-to_char) + * [`TODAY`](/reference/query-languages/sql/sql-functions-datetime.md#sql-functions-today) + * [`WEEK_OF_YEAR/WEEK`](/reference/query-languages/sql/sql-functions-datetime.md#sql-functions-datetime-week) + * [`YEAR`](/reference/query-languages/sql/sql-functions-datetime.md#sql-functions-datetime-year) + +* [Full-Text Search Functions](/reference/query-languages/sql/sql-functions-search.md) + + * [`MATCH`](/reference/query-languages/sql/sql-functions-search.md#sql-functions-search-match) + * [`QUERY`](/reference/query-languages/sql/sql-functions-search.md#sql-functions-search-query) + * [`SCORE`](/reference/query-languages/sql/sql-functions-search.md#sql-functions-search-score) + +* [Mathematical Functions](/reference/query-languages/sql/sql-functions-math.md) + + * [`ABS`](/reference/query-languages/sql/sql-functions-math.md#sql-functions-math-abs) + * [`CBRT`](/reference/query-languages/sql/sql-functions-math.md#sql-functions-math-cbrt) + * [`CEIL/CEILING`](/reference/query-languages/sql/sql-functions-math.md#sql-functions-math-ceil) + * [`E`](/reference/query-languages/sql/sql-functions-math.md#sql-functions-math-e) + * [`EXP`](/reference/query-languages/sql/sql-functions-math.md#sql-functions-math-exp) + * [`EXPM1`](/reference/query-languages/sql/sql-functions-math.md#sql-functions-math-expm1) + * [`FLOOR`](/reference/query-languages/sql/sql-functions-math.md#sql-functions-math-floor) + * [`LOG`](/reference/query-languages/sql/sql-functions-math.md#sql-functions-math-log) + * [`LOG10`](/reference/query-languages/sql/sql-functions-math.md#sql-functions-math-log10) + * [`PI`](/reference/query-languages/sql/sql-functions-math.md#sql-functions-math-pi) + * [`POWER`](/reference/query-languages/sql/sql-functions-math.md#sql-functions-math-power) + * [`RANDOM/RAND`](/reference/query-languages/sql/sql-functions-math.md#sql-functions-math-random) + * [`ROUND`](/reference/query-languages/sql/sql-functions-math.md#sql-functions-math-round) + * [`SIGN/SIGNUM`](/reference/query-languages/sql/sql-functions-math.md#sql-functions-math-sign) + * [`SQRT`](/reference/query-languages/sql/sql-functions-math.md#sql-functions-math-sqrt) + * [`TRUNCATE/TRUNC`](/reference/query-languages/sql/sql-functions-math.md#sql-functions-math-truncate) + * [`ACOS`](/reference/query-languages/sql/sql-functions-math.md#sql-functions-math-acos) + * [`ASIN`](/reference/query-languages/sql/sql-functions-math.md#sql-functions-math-asin) + * [`ATAN`](/reference/query-languages/sql/sql-functions-math.md#sql-functions-math-atan) + * [`ATAN2`](/reference/query-languages/sql/sql-functions-math.md#sql-functions-math-atan2) + * [`COS`](/reference/query-languages/sql/sql-functions-math.md#sql-functions-math-cos) + * [`COSH`](/reference/query-languages/sql/sql-functions-math.md#sql-functions-math-cosh) + * [`COT`](/reference/query-languages/sql/sql-functions-math.md#sql-functions-math-cot) + * [`DEGREES`](/reference/query-languages/sql/sql-functions-math.md#sql-functions-math-degrees) + * [`RADIANS`](/reference/query-languages/sql/sql-functions-math.md#sql-functions-math-radians) + * [`SIN`](/reference/query-languages/sql/sql-functions-math.md#sql-functions-math-sin) + * [`SINH`](/reference/query-languages/sql/sql-functions-math.md#sql-functions-math-sinh) + * [`TAN`](/reference/query-languages/sql/sql-functions-math.md#sql-functions-math-tan) + +* [String Functions](/reference/query-languages/sql/sql-functions-string.md) + + * [`ASCII`](/reference/query-languages/sql/sql-functions-string.md#sql-functions-string-ascii) + * [`BIT_LENGTH`](/reference/query-languages/sql/sql-functions-string.md#sql-functions-string-bit-length) + * [`CHAR`](/reference/query-languages/sql/sql-functions-string.md#sql-functions-string-char) + * [`CHAR_LENGTH`](/reference/query-languages/sql/sql-functions-string.md#sql-functions-string-char-length) + * [`CONCAT`](/reference/query-languages/sql/sql-functions-string.md#sql-functions-string-concat) + * [`INSERT`](/reference/query-languages/sql/sql-functions-string.md#sql-functions-string-insert) + * [`LCASE`](/reference/query-languages/sql/sql-functions-string.md#sql-functions-string-lcase) + * [`LEFT`](/reference/query-languages/sql/sql-functions-string.md#sql-functions-string-left) + * [`LENGTH`](/reference/query-languages/sql/sql-functions-string.md#sql-functions-string-length) + * [`LOCATE`](/reference/query-languages/sql/sql-functions-string.md#sql-functions-string-locate) + * [`LTRIM`](/reference/query-languages/sql/sql-functions-string.md#sql-functions-string-ltrim) + * [`OCTET_LENGTH`](/reference/query-languages/sql/sql-functions-string.md#sql-functions-string-octet-length) + * [`POSITION`](/reference/query-languages/sql/sql-functions-string.md#sql-functions-string-position) + * [`REPEAT`](/reference/query-languages/sql/sql-functions-string.md#sql-functions-string-repeat) + * [`REPLACE`](/reference/query-languages/sql/sql-functions-string.md#sql-functions-string-replace) + * [`RIGHT`](/reference/query-languages/sql/sql-functions-string.md#sql-functions-string-right) + * [`RTRIM`](/reference/query-languages/sql/sql-functions-string.md#sql-functions-string-rtrim) + * [`SPACE`](/reference/query-languages/sql/sql-functions-string.md#sql-functions-string-space) + * [`SUBSTRING`](/reference/query-languages/sql/sql-functions-string.md#sql-functions-string-substring) + * [`TRIM`](/reference/query-languages/sql/sql-functions-string.md#sql-functions-string-trim) + * [`UCASE`](/reference/query-languages/sql/sql-functions-string.md#sql-functions-string-ucase) + +* [Type Conversion Functions](/reference/query-languages/sql/sql-functions-type-conversion.md) + + * [`CAST`](/reference/query-languages/sql/sql-functions-type-conversion.md#sql-functions-type-conversion-cast) + * [`CONVERT`](/reference/query-languages/sql/sql-functions-type-conversion.md#sql-functions-type-conversion-convert) + +* [Conditional Functions And Expressions](/reference/query-languages/sql/sql-functions-conditional.md) + + * [`CASE`](/reference/query-languages/sql/sql-functions-conditional.md#sql-functions-conditional-case) + * [`COALESCE`](/reference/query-languages/sql/sql-functions-conditional.md#sql-functions-conditional-coalesce) + * [`GREATEST`](/reference/query-languages/sql/sql-functions-conditional.md#sql-functions-conditional-greatest) + * [`IFNULL`](/reference/query-languages/sql/sql-functions-conditional.md#sql-functions-conditional-ifnull) + * [`IIF`](/reference/query-languages/sql/sql-functions-conditional.md#sql-functions-conditional-iif) + * [`ISNULL`](/reference/query-languages/sql/sql-functions-conditional.md#sql-functions-conditional-isnull) + * [`LEAST`](/reference/query-languages/sql/sql-functions-conditional.md#sql-functions-conditional-least) + * [`NULLIF`](/reference/query-languages/sql/sql-functions-conditional.md#sql-functions-conditional-nullif) + * [`NVL`](/reference/query-languages/sql/sql-functions-conditional.md#sql-functions-conditional-nvl) + +* [Geo Functions](/reference/query-languages/sql/sql-functions-geo.md) + + * [`ST_AsWKT`](/reference/query-languages/sql/sql-functions-geo.md#sql-functions-geo-st-as-wkt) + * [`ST_Distance`](/reference/query-languages/sql/sql-functions-geo.md#sql-functions-geo-st-distance) + * [`ST_GeometryType`](/reference/query-languages/sql/sql-functions-geo.md#sql-functions-geo-st-geometrytype) + * [`ST_WKTToSQL`](/reference/query-languages/sql/sql-functions-geo.md#sql-functions-geo-st-wkt-to-sql) + * [`ST_X`](/reference/query-languages/sql/sql-functions-geo.md#sql-functions-geo-st-x) + * [`ST_Y`](/reference/query-languages/sql/sql-functions-geo.md#sql-functions-geo-st-y) + * [`ST_Z`](/reference/query-languages/sql/sql-functions-geo.md#sql-functions-geo-st-z) + +* [System Functions](/reference/query-languages/sql/sql-functions-system.md) + + * [`DATABASE`](/reference/query-languages/sql/sql-functions-system.md#sql-functions-system-database) + * [`USER`](/reference/query-languages/sql/sql-functions-system.md#sql-functions-system-user) + + + + + + + + + + + + + + + + + diff --git a/docs/reference/query-languages/sql-index-frozen.md b/docs/reference/query-languages/sql/sql-index-frozen.md similarity index 100% rename from docs/reference/query-languages/sql-index-frozen.md rename to docs/reference/query-languages/sql/sql-index-frozen.md diff --git a/docs/reference/query-languages/sql-index-patterns.md b/docs/reference/query-languages/sql/sql-index-patterns.md similarity index 100% rename from docs/reference/query-languages/sql-index-patterns.md rename to docs/reference/query-languages/sql/sql-index-patterns.md diff --git a/docs/reference/query-languages/sql-lexical-structure.md b/docs/reference/query-languages/sql/sql-lexical-structure.md similarity index 96% rename from docs/reference/query-languages/sql-lexical-structure.md rename to docs/reference/query-languages/sql/sql-lexical-structure.md index 723e37a64415..1879b7c7d757 100644 --- a/docs/reference/query-languages/sql-lexical-structure.md +++ b/docs/reference/query-languages/sql/sql-lexical-structure.md @@ -21,7 +21,7 @@ SELECT * FROM table This query has four tokens: `SELECT`, `*`, `FROM` and `table`. The first three, namely `SELECT`, `*` and `FROM` are *key words* meaning words that have a fixed meaning in SQL. The token `table` is an *identifier* meaning it identifies (by name) an entity inside SQL such as a table (in this case), a column, etc…​ -As one can see, both key words and identifiers have the *same* lexical structure and thus one cannot know whether a token is one or the other without knowing the SQL language; the complete list of key words is available in the [reserved appendix](/reference/query-languages/sql-syntax-reserved.md). Do note that key words are case-insensitive meaning the previous example can be written as: +As one can see, both key words and identifiers have the *same* lexical structure and thus one cannot know whether a token is one or the other without knowing the SQL language; the complete list of key words is available in the [reserved appendix](/reference/query-languages/sql/sql-syntax-reserved.md). Do note that key words are case-insensitive meaning the previous example can be written as: ```sql select * fRoM table; @@ -85,7 +85,7 @@ Numeric literals that contain a decimal point are always interpreted as being of #### Generic Literals [sql-syntax-generic-literals] -When dealing with arbitrary type literal, one creates the object by casting, typically, the string representation to the desired type. This can be achieved through the dedicated [cast operator](/reference/query-languages/sql-operators-cast.md) and [functions](/reference/query-languages/sql-functions-type-conversion.md): +When dealing with arbitrary type literal, one creates the object by casting, typically, the string representation to the desired type. This can be achieved through the dedicated [cast operator](/reference/query-languages/sql/sql-operators-cast.md) and [functions](/reference/query-languages/sql/sql-functions-type-conversion.md): ```sql 123::LONG -- cast 123 to a LONG diff --git a/docs/reference/query-languages/sql-like-rlike-operators.md b/docs/reference/query-languages/sql/sql-like-rlike-operators.md similarity index 77% rename from docs/reference/query-languages/sql-like-rlike-operators.md rename to docs/reference/query-languages/sql/sql-like-rlike-operators.md index 3f569548400f..652e08f38c3a 100644 --- a/docs/reference/query-languages/sql-like-rlike-operators.md +++ b/docs/reference/query-languages/sql/sql-like-rlike-operators.md @@ -5,10 +5,10 @@ mapped_pages: # LIKE and RLIKE Operators [sql-like-rlike-operators] -`LIKE` and `RLIKE` operators are commonly used to filter data based on string patterns. They usually act on a field placed on the left-hand side of the operator, but can also act on a constant (literal) expression. The right-hand side of the operator represents the pattern. Both can be used in the `WHERE` clause of the `SELECT` statement, but `LIKE` can also be used in other places, such as defining an [index pattern](/reference/query-languages/sql-index-patterns.md) or across various [SHOW commands](/reference/query-languages/sql-commands.md). This section covers only the `SELECT ... WHERE ...` usage. +`LIKE` and `RLIKE` operators are commonly used to filter data based on string patterns. They usually act on a field placed on the left-hand side of the operator, but can also act on a constant (literal) expression. The right-hand side of the operator represents the pattern. Both can be used in the `WHERE` clause of the `SELECT` statement, but `LIKE` can also be used in other places, such as defining an [index pattern](/reference/query-languages/sql/sql-index-patterns.md) or across various [SHOW commands](/reference/query-languages/sql/sql-commands.md). This section covers only the `SELECT ... WHERE ...` usage. ::::{note} -One significant difference between `LIKE`/`RLIKE` and the [full-text search predicates](/reference/query-languages/sql-functions-search.md) is that the former act on [exact fields](/reference/query-languages/sql-data-types.md#sql-multi-field) while the latter also work on [analyzed](/reference/elasticsearch/mapping-reference/text.md) fields. If the field used with `LIKE`/`RLIKE` doesn’t have an exact not-normalized sub-field (of [keyword](/reference/elasticsearch/mapping-reference/keyword.md) type) Elasticsearch SQL will not be able to run the query. If the field is either exact or has an exact sub-field, it will use it as is, or it will automatically use the exact sub-field even if it wasn’t explicitly specified in the statement. +One significant difference between `LIKE`/`RLIKE` and the [full-text search predicates](/reference/query-languages/sql/sql-functions-search.md) is that the former act on [exact fields](/reference/query-languages/sql/sql-data-types.md#sql-multi-field) while the latter also work on [analyzed](/reference/elasticsearch/mapping-reference/text.md) fields. If the field used with `LIKE`/`RLIKE` doesn’t have an exact not-normalized sub-field (of [keyword](/reference/elasticsearch/mapping-reference/keyword.md) type) Elasticsearch SQL will not be able to run the query. If the field is either exact or has an exact sub-field, it will use it as is, or it will automatically use the exact sub-field even if it wasn’t explicitly specified in the statement. :::: @@ -70,7 +70,7 @@ RLIKE constant_exp <2> **Description**: This operator is similar to `LIKE`, but the user is not limited to search for a string based on a fixed pattern with the percent sign (`%`) and underscore (`_`); the pattern in this case is a regular expression which allows the construction of more flexible patterns. -For supported syntax, see [*Regular expression syntax*](/reference/query-languages/regexp-syntax.md). +For supported syntax, see [*Regular expression syntax*](/reference/query-languages/query-dsl/regexp-syntax.md). ```sql SELECT author, name FROM library WHERE name RLIKE 'Child.* Dune'; @@ -88,7 +88,7 @@ Even though `RLIKE` is a valid option when searching or filtering in Elasticsear ## Prefer full-text search predicates [sql-like-prefer-full-text] -When using `LIKE`/`RLIKE`, do consider using [full-text search predicates](/reference/query-languages/sql-functions-search.md) which are faster, much more powerful and offer the option of sorting by relevancy (results can be returned based on how well they matched). +When using `LIKE`/`RLIKE`, do consider using [full-text search predicates](/reference/query-languages/sql/sql-functions-search.md) which are faster, much more powerful and offer the option of sorting by relevancy (results can be returned based on how well they matched). For example: diff --git a/docs/reference/query-languages/sql-limitations.md b/docs/reference/query-languages/sql/sql-limitations.md similarity index 88% rename from docs/reference/query-languages/sql-limitations.md rename to docs/reference/query-languages/sql/sql-limitations.md index 94a66d8eb8e8..26f3056ec44b 100644 --- a/docs/reference/query-languages/sql-limitations.md +++ b/docs/reference/query-languages/sql/sql-limitations.md @@ -116,7 +116,7 @@ SELECT age, MAX(salary) - MIN(salary) AS diff FROM test GROUP BY age ORDER BY di Using sub-selects (`SELECT X FROM (SELECT Y)`) is **supported to a small degree**: any sub-select that can be "flattened" into a single `SELECT` is possible with {{es-sql}}. For example: -```sql +```sql include-tagged::{sql-specs}/docs/docs.csv-spec[limitationSubSelect] ``` @@ -131,7 +131,7 @@ FROM (SELECT ...) WHERE [simple_condition]`, this is currently **un-supported**. ## Using `FIRST`/`LAST` aggregation functions in `HAVING` clause [first-last-agg-functions-having-clause] -Using [`FIRST`](/reference/query-languages/sql-functions-aggs.md#sql-functions-aggs-first) and [`LAST`](/reference/query-languages/sql-functions-aggs.md#sql-functions-aggs-last) in the `HAVING` clause is not supported. The same applies to [`MIN`](/reference/query-languages/sql-functions-aggs.md#sql-functions-aggs-min) and [`MAX`](/reference/query-languages/sql-functions-aggs.md#sql-functions-aggs-max) when their target column +Using [`FIRST`](/reference/query-languages/sql/sql-functions-aggs.md#sql-functions-aggs-first) and [`LAST`](/reference/query-languages/sql/sql-functions-aggs.md#sql-functions-aggs-last) in the `HAVING` clause is not supported. The same applies to [`MIN`](/reference/query-languages/sql/sql-functions-aggs.md#sql-functions-aggs-min) and [`MAX`](/reference/query-languages/sql/sql-functions-aggs.md#sql-functions-aggs-max) when their target column is of type [`keyword`](/reference/elasticsearch/mapping-reference/keyword.md) or [`number`](/reference/elasticsearch/mapping-reference/number.md) as they are internally translated to `FIRST` and `LAST`. ## Using TIME data type in GROUP BY or HISTOGRAM [group-by-time] @@ -149,7 +149,7 @@ for example: SELECT count(*) FROM test GROUP BY MINUTE((CAST(date_created AS TIME)); ``` -`TIME` data type is also currently not supported in the [`HISTOGRAM`](/reference/query-languages/sql-functions-grouping.md#sql-functions-grouping-histogram) grouping function. For example: +`TIME` data type is also currently not supported in the [`HISTOGRAM`](/reference/query-languages/sql/sql-functions-grouping.md#sql-functions-grouping-histogram) grouping function. For example: ```sql SELECT HISTOGRAM(CAST(birth_date AS TIME), INTERVAL '10' MINUTES) as h, COUNT(*) FROM t GROUP BY h @@ -174,12 +174,12 @@ for any of the returned fields or at index level, the values cannot be retrieved ## Aggregations in the `PIVOT` clause [aggs-in-pivot] -The aggregation expression in [`PIVOT`](/reference/query-languages/sql-syntax-select.md#sql-syntax-pivot) will currently accept only one aggregation. It is thus not possible to obtain multiple aggregations for any one pivoted column. +The aggregation expression in [`PIVOT`](/reference/query-languages/sql/sql-syntax-select.md#sql-syntax-pivot) will currently accept only one aggregation. It is thus not possible to obtain multiple aggregations for any one pivoted column. ## Using a subquery in `PIVOT`'s `IN`-subclause [subquery-in-pivot] -The values that the [`PIVOT`](/reference/query-languages/sql-syntax-select.md#sql-syntax-pivot) query could pivot must be provided in the query as a list of literals; providing a subquery instead to build this list is not currently supported. For example, in this query: +The values that the [`PIVOT`](/reference/query-languages/sql/sql-syntax-select.md#sql-syntax-pivot) query could pivot must be provided in the query as a list of literals; providing a subquery instead to build this list is not currently supported. For example, in this query: ```sql SELECT * FROM test_emp PIVOT (SUM(salary) FOR languages IN (1, 2)) diff --git a/docs/reference/query-languages/sql-operators-cast.md b/docs/reference/query-languages/sql/sql-operators-cast.md similarity index 77% rename from docs/reference/query-languages/sql-operators-cast.md rename to docs/reference/query-languages/sql/sql-operators-cast.md index 6c9c68a4da6f..d1ecb7da786c 100644 --- a/docs/reference/query-languages/sql-operators-cast.md +++ b/docs/reference/query-languages/sql/sql-operators-cast.md @@ -7,7 +7,7 @@ mapped_pages: ## `Cast (::)` [sql-operators-cast-cast] -`::` provides an alternative syntax to the [`CAST`](/reference/query-languages/sql-functions-type-conversion.md#sql-functions-type-conversion-cast) function. +`::` provides an alternative syntax to the [`CAST`](/reference/query-languages/sql/sql-functions-type-conversion.md#sql-functions-type-conversion-cast) function. ```sql SELECT '123'::long AS long; diff --git a/docs/reference/query-languages/sql-operators-logical.md b/docs/reference/query-languages/sql/sql-operators-logical.md similarity index 100% rename from docs/reference/query-languages/sql-operators-logical.md rename to docs/reference/query-languages/sql/sql-operators-logical.md diff --git a/docs/reference/query-languages/sql-operators-math.md b/docs/reference/query-languages/sql/sql-operators-math.md similarity index 100% rename from docs/reference/query-languages/sql-operators-math.md rename to docs/reference/query-languages/sql/sql-operators-math.md diff --git a/docs/reference/query-languages/sql-operators.md b/docs/reference/query-languages/sql/sql-operators.md similarity index 100% rename from docs/reference/query-languages/sql-operators.md rename to docs/reference/query-languages/sql/sql-operators.md diff --git a/docs/reference/query-languages/sql-spec.md b/docs/reference/query-languages/sql/sql-spec.md similarity index 51% rename from docs/reference/query-languages/sql-spec.md rename to docs/reference/query-languages/sql/sql-spec.md index 3c78faa8a3a0..18202790cf73 100644 --- a/docs/reference/query-languages/sql-spec.md +++ b/docs/reference/query-languages/sql/sql-spec.md @@ -7,16 +7,16 @@ mapped_pages: This chapter describes the SQL syntax and semantics supported namely: -[Lexical Structure](/reference/query-languages/sql-lexical-structure.md) +[Lexical Structure](/reference/query-languages/sql/sql-lexical-structure.md) : Lexical structure -[SQL Commands](/reference/query-languages/sql-commands.md) +[SQL Commands](/reference/query-languages/sql/sql-commands.md) : Commands -[Data Types](/reference/query-languages/sql-data-types.md) +[Data Types](/reference/query-languages/sql/sql-data-types.md) : Data types -[Index patterns](/reference/query-languages/sql-index-patterns.md) +[Index patterns](/reference/query-languages/sql/sql-index-patterns.md) : Index patterns diff --git a/docs/reference/query-languages/sql-syntax-describe-table.md b/docs/reference/query-languages/sql/sql-syntax-describe-table.md similarity index 95% rename from docs/reference/query-languages/sql-syntax-describe-table.md rename to docs/reference/query-languages/sql/sql-syntax-describe-table.md index ab2d60993b7f..289f6d317c96 100644 --- a/docs/reference/query-languages/sql-syntax-describe-table.md +++ b/docs/reference/query-languages/sql/sql-syntax-describe-table.md @@ -19,7 +19,7 @@ DESCRIBE | DESC 4. SQL LIKE pattern matching table names. -**Description**: `DESC` and `DESCRIBE` are aliases to [SHOW COLUMNS](/reference/query-languages/sql-syntax-show-columns.md). +**Description**: `DESC` and `DESCRIBE` are aliases to [SHOW COLUMNS](/reference/query-languages/sql/sql-syntax-show-columns.md). ```sql DESCRIBE emp; diff --git a/docs/reference/query-languages/sql-syntax-reserved.md b/docs/reference/query-languages/sql/sql-syntax-reserved.md similarity index 100% rename from docs/reference/query-languages/sql-syntax-reserved.md rename to docs/reference/query-languages/sql/sql-syntax-reserved.md diff --git a/docs/reference/query-languages/sql-syntax-select.md b/docs/reference/query-languages/sql/sql-syntax-select.md similarity index 97% rename from docs/reference/query-languages/sql-syntax-select.md rename to docs/reference/query-languages/sql/sql-syntax-select.md index 6bcaf63ddd23..f1d131c029a1 100644 --- a/docs/reference/query-languages/sql-syntax-select.md +++ b/docs/reference/query-languages/sql/sql-syntax-select.md @@ -140,7 +140,7 @@ SELECT emp_no FROM "e*p" LIMIT 1; 10001 ``` -[preview] To run a [{{ccs}}](docs-content://solutions/search/cross-cluster-search.md), specify a cluster name using the `:` syntax, where `` maps to a SQL catalog (cluster) and `` to a table (index or data stream). The `` supports wildcards (`*`) and `` can be an [index pattern](/reference/query-languages/sql-index-patterns.md). +[preview] To run a [{{ccs}}](docs-content://solutions/search/cross-cluster-search.md), specify a cluster name using the `:` syntax, where `` maps to a SQL catalog (cluster) and `` to a table (index or data stream). The `` supports wildcards (`*`) and `` can be an [index pattern](/reference/query-languages/sql/sql-index-patterns.md). ```sql SELECT emp_no FROM "my*cluster:*emp" LIMIT 1; @@ -312,7 +312,7 @@ M |2.280646181070106 |0.44302407229580243 ``` ::::{tip} -If custom bucketing is required, it can be achieved with the use of [`CASE`](/reference/query-languages/sql-functions-conditional.md#sql-functions-conditional-case), as shown [here](/reference/query-languages/sql-functions-conditional.md#sql-functions-conditional-case-groupby-custom-buckets). +If custom bucketing is required, it can be achieved with the use of [`CASE`](/reference/query-languages/sql/sql-functions-conditional.md#sql-functions-conditional-case), as shown [here](/reference/query-languages/sql/sql-functions-conditional.md#sql-functions-conditional-case-groupby-custom-buckets). :::: @@ -504,7 +504,7 @@ Ordering by aggregation is possible for up to **10000** entries for memory consu When doing full-text queries in the `WHERE` clause, results can be returned based on their [score](https://www.elastic.co/guide/en/elasticsearch/guide/2.x/relevance-intro.html) or *relevance* to the given query. ::::{note} -When doing multiple text queries in the `WHERE` clause then, their scores will be combined using the same rules as {{es}}'s [bool query](/reference/query-languages/query-dsl-bool-query.md). +When doing multiple text queries in the `WHERE` clause then, their scores will be combined using the same rules as {{es}}'s [bool query](/reference/query-languages/query-dsl/query-dsl-bool-query.md). :::: @@ -573,7 +573,7 @@ The `PIVOT` clause performs a cross tabulation on the results of the query: it a The clause can be broken down in three parts: the aggregation, the `FOR`- and the `IN`-subclause. -The `aggregation_expr` subclause specifies an expression containing an [aggregation function](/reference/query-languages/sql-functions-aggs.md) to be applied on one of the source columns. Only one aggregation can be provided, currently. +The `aggregation_expr` subclause specifies an expression containing an [aggregation function](/reference/query-languages/sql/sql-functions-aggs.md) to be applied on one of the source columns. Only one aggregation can be provided, currently. The `FOR`-subclause specifies the pivoting column: the distinct values of this column will become the candidate set of values to be rotated. diff --git a/docs/reference/query-languages/sql-syntax-show-catalogs.md b/docs/reference/query-languages/sql/sql-syntax-show-catalogs.md similarity index 100% rename from docs/reference/query-languages/sql-syntax-show-catalogs.md rename to docs/reference/query-languages/sql/sql-syntax-show-catalogs.md diff --git a/docs/reference/query-languages/sql-syntax-show-columns.md b/docs/reference/query-languages/sql/sql-syntax-show-columns.md similarity index 93% rename from docs/reference/query-languages/sql-syntax-show-columns.md rename to docs/reference/query-languages/sql/sql-syntax-show-columns.md index 0e197d0500db..df212e5b095f 100644 --- a/docs/reference/query-languages/sql-syntax-show-columns.md +++ b/docs/reference/query-languages/sql/sql-syntax-show-columns.md @@ -20,7 +20,7 @@ SHOW COLUMNS 4. SQL LIKE pattern matching table names. -See [index patterns](/reference/query-languages/sql-index-patterns.md) for more information about patterns. +See [index patterns](/reference/query-languages/sql/sql-index-patterns.md) for more information about patterns. **Description**: List the columns in table and their data type (and other attributes). diff --git a/docs/reference/query-languages/sql-syntax-show-functions.md b/docs/reference/query-languages/sql/sql-syntax-show-functions.md similarity index 100% rename from docs/reference/query-languages/sql-syntax-show-functions.md rename to docs/reference/query-languages/sql/sql-syntax-show-functions.md diff --git a/docs/reference/query-languages/sql-syntax-show-tables.md b/docs/reference/query-languages/sql/sql-syntax-show-tables.md similarity index 96% rename from docs/reference/query-languages/sql-syntax-show-tables.md rename to docs/reference/query-languages/sql/sql-syntax-show-tables.md index 421161d6a5d5..3c6624ff1489 100644 --- a/docs/reference/query-languages/sql-syntax-show-tables.md +++ b/docs/reference/query-languages/sql/sql-syntax-show-tables.md @@ -21,7 +21,7 @@ SHOW TABLES 5. SQL LIKE pattern matching table names. -See [index patterns](/reference/query-languages/sql-index-patterns.md) for more information about patterns. +See [index patterns](/reference/query-languages/sql/sql-index-patterns.md) for more information about patterns. **Description**: List the tables available to the current user and their type. diff --git a/docs/reference/query-languages/toc.yml b/docs/reference/query-languages/toc.yml index 3c75f07d37ee..2e19f29c2ac6 100644 --- a/docs/reference/query-languages/toc.yml +++ b/docs/reference/query-languages/toc.yml @@ -2,86 +2,86 @@ toc: - file: query-languages/index.md - file: query-languages/querydsl.md children: - - file: query-languages/query-filter-context.md - - file: query-languages/compound-queries.md + - file: query-languages/query-dsl/query-filter-context.md + - file: query-languages/query-dsl/compound-queries.md children: - - file: query-languages/query-dsl-bool-query.md - - file: query-languages/query-dsl-boosting-query.md - - file: query-languages/query-dsl-constant-score-query.md - - file: query-languages/query-dsl-dis-max-query.md - - file: query-languages/query-dsl-function-score-query.md - - file: query-languages/full-text-queries.md + - file: query-languages/query-dsl/query-dsl-bool-query.md + - file: query-languages/query-dsl/query-dsl-boosting-query.md + - file: query-languages/query-dsl/query-dsl-constant-score-query.md + - file: query-languages/query-dsl/query-dsl-dis-max-query.md + - file: query-languages/query-dsl/query-dsl-function-score-query.md + - file: query-languages/query-dsl/full-text-queries.md children: - - file: query-languages/query-dsl-intervals-query.md - - file: query-languages/query-dsl-match-query.md - - file: query-languages/query-dsl-match-bool-prefix-query.md - - file: query-languages/query-dsl-match-query-phrase.md - - file: query-languages/query-dsl-match-query-phrase-prefix.md - - file: query-languages/query-dsl-combined-fields-query.md - - file: query-languages/query-dsl-multi-match-query.md - - file: query-languages/query-dsl-query-string-query.md - - file: query-languages/query-dsl-simple-query-string-query.md - - file: query-languages/geo-queries.md + - file: query-languages/query-dsl/query-dsl-intervals-query.md + - file: query-languages/query-dsl/query-dsl-match-query.md + - file: query-languages/query-dsl/query-dsl-match-bool-prefix-query.md + - file: query-languages/query-dsl/query-dsl-match-query-phrase.md + - file: query-languages/query-dsl/query-dsl-match-query-phrase-prefix.md + - file: query-languages/query-dsl/query-dsl-combined-fields-query.md + - file: query-languages/query-dsl/query-dsl-multi-match-query.md + - file: query-languages/query-dsl/query-dsl-query-string-query.md + - file: query-languages/query-dsl/query-dsl-simple-query-string-query.md + - file: query-languages/query-dsl/geo-queries.md children: - - file: query-languages/query-dsl-geo-bounding-box-query.md - - file: query-languages/query-dsl-geo-distance-query.md - - file: query-languages/query-dsl-geo-grid-query.md - - file: query-languages/query-dsl-geo-polygon-query.md - - file: query-languages/query-dsl-geo-shape-query.md - - file: query-languages/shape-queries.md + - file: query-languages/query-dsl/query-dsl-geo-bounding-box-query.md + - file: query-languages/query-dsl/query-dsl-geo-distance-query.md + - file: query-languages/query-dsl/query-dsl-geo-grid-query.md + - file: query-languages/query-dsl/query-dsl-geo-polygon-query.md + - file: query-languages/query-dsl/query-dsl-geo-shape-query.md + - file: query-languages/query-dsl/shape-queries.md children: - - file: query-languages/query-dsl-shape-query.md - - file: query-languages/joining-queries.md + - file: query-languages/query-dsl/query-dsl-shape-query.md + - file: query-languages/query-dsl/joining-queries.md children: - - file: query-languages/query-dsl-nested-query.md - - file: query-languages/query-dsl-has-child-query.md - - file: query-languages/query-dsl-has-parent-query.md - - file: query-languages/query-dsl-parent-id-query.md - - file: query-languages/query-dsl-match-all-query.md - - file: query-languages/span-queries.md + - file: query-languages/query-dsl/query-dsl-nested-query.md + - file: query-languages/query-dsl/query-dsl-has-child-query.md + - file: query-languages/query-dsl/query-dsl-has-parent-query.md + - file: query-languages/query-dsl/query-dsl-parent-id-query.md + - file: query-languages/query-dsl/query-dsl-match-all-query.md + - file: query-languages/query-dsl/span-queries.md children: - - file: query-languages/query-dsl-span-containing-query.md - - file: query-languages/query-dsl-span-field-masking-query.md - - file: query-languages/query-dsl-span-first-query.md - - file: query-languages/query-dsl-span-multi-term-query.md - - file: query-languages/query-dsl-span-near-query.md - - file: query-languages/query-dsl-span-not-query.md - - file: query-languages/query-dsl-span-query.md - - file: query-languages/query-dsl-span-term-query.md - - file: query-languages/query-dsl-span-within-query.md - - file: query-languages/vector-queries.md + - file: query-languages/query-dsl/query-dsl-span-containing-query.md + - file: query-languages/query-dsl/query-dsl-span-field-masking-query.md + - file: query-languages/query-dsl/query-dsl-span-first-query.md + - file: query-languages/query-dsl/query-dsl-span-multi-term-query.md + - file: query-languages/query-dsl/query-dsl-span-near-query.md + - file: query-languages/query-dsl/query-dsl-span-not-query.md + - file: query-languages/query-dsl/query-dsl-span-query.md + - file: query-languages/query-dsl/query-dsl-span-term-query.md + - file: query-languages/query-dsl/query-dsl-span-within-query.md + - file: query-languages/query-dsl/vector-queries.md children: - - file: query-languages/query-dsl-knn-query.md - - file: query-languages/query-dsl-sparse-vector-query.md - - file: query-languages/query-dsl-semantic-query.md - - file: query-languages/query-dsl-text-expansion-query.md - - file: query-languages/query-dsl-weighted-tokens-query.md - - file: query-languages/specialized-queries.md + - file: query-languages/query-dsl/query-dsl-knn-query.md + - file: query-languages/query-dsl/query-dsl-sparse-vector-query.md + - file: query-languages/query-dsl/query-dsl-semantic-query.md + - file: query-languages/query-dsl/query-dsl-text-expansion-query.md + - file: query-languages/query-dsl/query-dsl-weighted-tokens-query.md + - file: query-languages/query-dsl/specialized-queries.md children: - - file: query-languages/query-dsl-distance-feature-query.md - - file: query-languages/query-dsl-mlt-query.md - - file: query-languages/query-dsl-percolate-query.md - - file: query-languages/query-dsl-rank-feature-query.md - - file: query-languages/query-dsl-script-query.md - - file: query-languages/query-dsl-script-score-query.md - - file: query-languages/query-dsl-wrapper-query.md - - file: query-languages/query-dsl-pinned-query.md - - file: query-languages/query-dsl-rule-query.md - - file: query-languages/term-level-queries.md + - file: query-languages/query-dsl/query-dsl-distance-feature-query.md + - file: query-languages/query-dsl/query-dsl-mlt-query.md + - file: query-languages/query-dsl/query-dsl-percolate-query.md + - file: query-languages/query-dsl/query-dsl-rank-feature-query.md + - file: query-languages/query-dsl/query-dsl-script-query.md + - file: query-languages/query-dsl/query-dsl-script-score-query.md + - file: query-languages/query-dsl/query-dsl-wrapper-query.md + - file: query-languages/query-dsl/query-dsl-pinned-query.md + - file: query-languages/query-dsl/query-dsl-rule-query.md + - file: query-languages/query-dsl/term-level-queries.md children: - - file: query-languages/query-dsl-exists-query.md - - file: query-languages/query-dsl-fuzzy-query.md - - file: query-languages/query-dsl-ids-query.md - - file: query-languages/query-dsl-prefix-query.md - - file: query-languages/query-dsl-range-query.md - - file: query-languages/query-dsl-regexp-query.md - - file: query-languages/query-dsl-term-query.md - - file: query-languages/query-dsl-terms-query.md - - file: query-languages/query-dsl-terms-set-query.md - - file: query-languages/query-dsl-wildcard-query.md - - file: query-languages/query-dsl-minimum-should-match.md - - file: query-languages/query-dsl-multi-term-rewrite.md - - file: query-languages/regexp-syntax.md + - file: query-languages/query-dsl/query-dsl-exists-query.md + - file: query-languages/query-dsl/query-dsl-fuzzy-query.md + - file: query-languages/query-dsl/query-dsl-ids-query.md + - file: query-languages/query-dsl/query-dsl-prefix-query.md + - file: query-languages/query-dsl/query-dsl-range-query.md + - file: query-languages/query-dsl/query-dsl-regexp-query.md + - file: query-languages/query-dsl/query-dsl-term-query.md + - file: query-languages/query-dsl/query-dsl-terms-query.md + - file: query-languages/query-dsl/query-dsl-terms-set-query.md + - file: query-languages/query-dsl/query-dsl-wildcard-query.md + - file: query-languages/query-dsl/query-dsl-minimum-should-match.md + - file: query-languages/query-dsl/query-dsl-multi-term-rewrite.md + - file: query-languages/query-dsl/regexp-syntax.md - file: query-languages/esql.md children: - file: query-languages/esql/esql-syntax.md @@ -98,42 +98,42 @@ toc: - file: query-languages/esql/esql-examples.md - file: query-languages/sql.md children: - - file: query-languages/sql-spec.md + - file: query-languages/sql/sql-spec.md children: - - file: query-languages/sql-lexical-structure.md - - file: query-languages/sql-commands.md - - file: query-languages/sql-syntax-describe-table.md - - file: query-languages/sql-syntax-select.md - - file: query-languages/sql-syntax-show-catalogs.md - - file: query-languages/sql-syntax-show-columns.md - - file: query-languages/sql-syntax-show-functions.md - - file: query-languages/sql-syntax-show-tables.md - - file: query-languages/sql-data-types.md - - file: query-languages/sql-index-patterns.md - - file: query-languages/sql-index-frozen.md - - file: query-languages/sql-functions.md + - file: query-languages/sql/sql-lexical-structure.md + - file: query-languages/sql/sql-commands.md + - file: query-languages/sql/sql-syntax-describe-table.md + - file: query-languages/sql/sql-syntax-select.md + - file: query-languages/sql/sql-syntax-show-catalogs.md + - file: query-languages/sql/sql-syntax-show-columns.md + - file: query-languages/sql/sql-syntax-show-functions.md + - file: query-languages/sql/sql-syntax-show-tables.md + - file: query-languages/sql/sql-data-types.md + - file: query-languages/sql/sql-index-patterns.md + - file: query-languages/sql/sql-index-frozen.md + - file: query-languages/sql/sql-functions.md children: - - file: query-languages/sql-operators.md - - file: query-languages/sql-operators-logical.md - - file: query-languages/sql-operators-math.md - - file: query-languages/sql-operators-cast.md - - file: query-languages/sql-like-rlike-operators.md - - file: query-languages/sql-functions-aggs.md - - file: query-languages/sql-functions-grouping.md - - file: query-languages/sql-functions-datetime.md - - file: query-languages/sql-functions-search.md - - file: query-languages/sql-functions-math.md - - file: query-languages/sql-functions-string.md - - file: query-languages/sql-functions-type-conversion.md - - file: query-languages/sql-functions-geo.md - - file: query-languages/sql-functions-conditional.md - - file: query-languages/sql-functions-system.md - - file: query-languages/sql-syntax-reserved.md - - file: query-languages/sql-limitations.md - - file: query-languages/eql.md + - file: query-languages/sql/sql-operators.md + - file: query-languages/sql/sql-operators-logical.md + - file: query-languages/sql/sql-operators-math.md + - file: query-languages/sql/sql-operators-cast.md + - file: query-languages/sql/sql-like-rlike-operators.md + - file: query-languages/sql/sql-functions-aggs.md + - file: query-languages/sql/sql-functions-grouping.md + - file: query-languages/sql/sql-functions-datetime.md + - file: query-languages/sql/sql-functions-search.md + - file: query-languages/sql/sql-functions-math.md + - file: query-languages/sql/sql-functions-string.md + - file: query-languages/sql/sql-functions-type-conversion.md + - file: query-languages/sql/sql-functions-geo.md + - file: query-languages/sql/sql-functions-conditional.md + - file: query-languages/sql/sql-functions-system.md + - file: query-languages/sql/sql-syntax-reserved.md + - file: query-languages/sql/sql-limitations.md + - file: query-languages/eql/eql.md children: - - file: query-languages/eql-syntax.md - - file: query-languages/eql-function-ref.md - - file: query-languages/eql-pipe-ref.md - - file: query-languages/eql-ex-threat-detection.md - - file: query-languages/kql.md \ No newline at end of file + - file: query-languages/eql/eql-syntax.md + - file: query-languages/eql/eql-function-ref.md + - file: query-languages/eql/eql-pipe-ref.md + - file: query-languages/eql/eql-ex-threat-detection.md + - file: query-languages/kql.md diff --git a/docs/reference/scripting-languages/painless/brief-painless-walkthrough.md b/docs/reference/scripting-languages/painless/brief-painless-walkthrough.md index 1da91fd0ed2d..f05a74acaed2 100644 --- a/docs/reference/scripting-languages/painless/brief-painless-walkthrough.md +++ b/docs/reference/scripting-languages/painless/brief-painless-walkthrough.md @@ -305,5 +305,5 @@ POST hockey/_update_by_query } ``` -Note: all of the `_update_by_query` examples above could really do with a `query` to limit the data that they pull back. While you **could** use a [script query](/reference/query-languages/query-dsl-script-query.md) it wouldn’t be as efficient as using any other query because script queries aren’t able to use the inverted index to limit the documents that they have to check. +Note: all of the `_update_by_query` examples above could really do with a `query` to limit the data that they pull back. While you **could** use a [script query](/reference/query-languages/query-dsl/query-dsl-script-query.md) it wouldn’t be as efficient as using any other query because script queries aren’t able to use the inverted index to limit the documents that they have to check. diff --git a/docs/reference/scripting-languages/painless/painless-api-examples.md b/docs/reference/scripting-languages/painless/painless-api-examples.md index caf531f47b0c..da08f372b72a 100644 --- a/docs/reference/scripting-languages/painless/painless-api-examples.md +++ b/docs/reference/scripting-languages/painless/painless-api-examples.md @@ -156,7 +156,7 @@ Wildcards are not accepted in the index expression for this endpoint. The expres :::: - Use this parameter to specify a query for computing a score. Besides deciding whether or not the document matches, the [query clause](/reference/query-languages/query-filter-context.md#query-context) also calculates a relevance score in the `_score` metadata field. + Use this parameter to specify a query for computing a score. Besides deciding whether or not the document matches, the [query clause](/reference/query-languages/query-dsl/query-filter-context.md#query-context) also calculates a relevance score in the `_score` metadata field. diff --git a/docs/reference/scripting-languages/painless/painless-contexts.md b/docs/reference/scripting-languages/painless/painless-contexts.md index 453170db46c5..4475b7bbea20 100644 --- a/docs/reference/scripting-languages/painless/painless-contexts.md +++ b/docs/reference/scripting-languages/painless/painless-contexts.md @@ -19,10 +19,10 @@ Painless scripts typically run within one of the contexts in the following table | Sort | [Painless Documentation](/reference/scripting-languages/painless/painless-sort-context.md) | [Elasticsearch Documentation](/reference/elasticsearch/rest-apis/sort-search-results.md) | | Similarity | [Painless Documentation](/reference/scripting-languages/painless/painless-similarity-context.md) | [Elasticsearch Documentation](/reference/elasticsearch/index-settings/similarity.md) | | Weight | [Painless Documentation](/reference/scripting-languages/painless/painless-weight-context.md) | [Elasticsearch Documentation](/reference/elasticsearch/index-settings/similarity.md) | -| Score | [Painless Documentation](/reference/scripting-languages/painless/painless-score-context.md) | [Elasticsearch Documentation](/reference/query-languages/query-dsl-function-score-query.md) | +| Score | [Painless Documentation](/reference/scripting-languages/painless/painless-score-context.md) | [Elasticsearch Documentation](/reference/query-languages/query-dsl/query-dsl-function-score-query.md) | | Field | [Painless Documentation](/reference/scripting-languages/painless/painless-field-context.md) | [Elasticsearch Documentation](/reference/elasticsearch/rest-apis/retrieve-selected-fields.md#script-fields) | -| Filter | [Painless Documentation](/reference/scripting-languages/painless/painless-filter-context.md) | [Elasticsearch Documentation](/reference/query-languages/query-dsl-script-query.md) | -| Minimum should match | [Painless Documentation](/reference/scripting-languages/painless/painless-min-should-match-context.md) | [Elasticsearch Documentation](/reference/query-languages/query-dsl-terms-set-query.md) | +| Filter | [Painless Documentation](/reference/scripting-languages/painless/painless-filter-context.md) | [Elasticsearch Documentation](/reference/query-languages/query-dsl/query-dsl-script-query.md) | +| Minimum should match | [Painless Documentation](/reference/scripting-languages/painless/painless-min-should-match-context.md) | [Elasticsearch Documentation](/reference/query-languages/query-dsl/query-dsl-terms-set-query.md) | | Metric aggregation initialization | [Painless Documentation](/reference/scripting-languages/painless/painless-metric-agg-init-context.md) | [Elasticsearch Documentation](/reference/data-analysis/aggregations/search-aggregations-metrics-scripted-metric-aggregation.md) | | Metric aggregation map | [Painless Documentation](/reference/scripting-languages/painless/painless-metric-agg-map-context.md) | [Elasticsearch Documentation](/reference/data-analysis/aggregations/search-aggregations-metrics-scripted-metric-aggregation.md) | | Metric aggregation combine | [Painless Documentation](/reference/scripting-languages/painless/painless-metric-agg-combine-context.md) | [Elasticsearch Documentation](/reference/data-analysis/aggregations/search-aggregations-metrics-scripted-metric-aggregation.md) | diff --git a/docs/reference/scripting-languages/painless/painless-debugging.md b/docs/reference/scripting-languages/painless/painless-debugging.md index 148ffa262ea1..e218559bedaa 100644 --- a/docs/reference/scripting-languages/painless/painless-debugging.md +++ b/docs/reference/scripting-languages/painless/painless-debugging.md @@ -7,7 +7,7 @@ mapped_pages: ## Debug.Explain [_debug_explain] -Painless doesn’t have a [REPL](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop) and while it’d be nice for it to have one day, it wouldn’t tell you the whole story around debugging painless scripts embedded in Elasticsearch because the data that the scripts have access to or "context" is so important. For now the best way to debug embedded scripts is by throwing exceptions at choice places. While you can throw your own exceptions (`throw new Exception('whatever')`), Painless’s sandbox prevents you from accessing useful information like the type of an object. So Painless has a utility method, `Debug.explain` which throws the exception for you. For example, you can use [`_explain`](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-explain) to explore the context available to a [script query](/reference/query-languages/query-dsl-script-query.md). +Painless doesn’t have a [REPL](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop) and while it’d be nice for it to have one day, it wouldn’t tell you the whole story around debugging painless scripts embedded in Elasticsearch because the data that the scripts have access to or "context" is so important. For now the best way to debug embedded scripts is by throwing exceptions at choice places. While you can throw your own exceptions (`throw new Exception('whatever')`), Painless’s sandbox prevents you from accessing useful information like the type of an object. So Painless has a utility method, `Debug.explain` which throws the exception for you. For example, you can use [`_explain`](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-explain) to explore the context available to a [script query](/reference/query-languages/query-dsl/query-dsl-script-query.md). ```console PUT /hockey/_doc/1?refresh diff --git a/docs/reference/scripting-languages/painless/painless-filter-context.md b/docs/reference/scripting-languages/painless/painless-filter-context.md index c9a25803e32f..54ba4baed4c5 100644 --- a/docs/reference/scripting-languages/painless/painless-filter-context.md +++ b/docs/reference/scripting-languages/painless/painless-filter-context.md @@ -5,7 +5,7 @@ mapped_pages: # Filter context [painless-filter-context] -Use a Painless script as a [filter](/reference/query-languages/query-dsl-script-query.md) in a query to include and exclude documents. +Use a Painless script as a [filter](/reference/query-languages/query-dsl/query-dsl-script-query.md) in a query to include and exclude documents. **Variables** diff --git a/docs/reference/scripting-languages/painless/painless-min-should-match-context.md b/docs/reference/scripting-languages/painless/painless-min-should-match-context.md index 7bc4db0c55ae..4343d74f3a97 100644 --- a/docs/reference/scripting-languages/painless/painless-min-should-match-context.md +++ b/docs/reference/scripting-languages/painless/painless-min-should-match-context.md @@ -5,7 +5,7 @@ mapped_pages: # Minimum should match context [painless-min-should-match-context] -Use a Painless script to specify the [minimum](/reference/query-languages/query-dsl-terms-set-query.md) number of terms that a specified field needs to match with for a document to be part of the query results. +Use a Painless script to specify the [minimum](/reference/query-languages/query-dsl/query-dsl-terms-set-query.md) number of terms that a specified field needs to match with for a document to be part of the query results. **Variables** diff --git a/docs/reference/scripting-languages/painless/painless-score-context.md b/docs/reference/scripting-languages/painless/painless-score-context.md index 36e4112075e7..80e00f2de0d1 100644 --- a/docs/reference/scripting-languages/painless/painless-score-context.md +++ b/docs/reference/scripting-languages/painless/painless-score-context.md @@ -5,7 +5,7 @@ mapped_pages: # Score context [painless-score-context] -Use a Painless script in a [function score](/reference/query-languages/query-dsl-function-score-query.md) to apply a new score to documents returned from a query. +Use a Painless script in a [function score](/reference/query-languages/query-dsl/query-dsl-function-score-query.md) to apply a new score to documents returned from a query. **Variables** diff --git a/docs/reference/toc.yml b/docs/reference/toc.yml index bcb50213e23f..75b74c996bb2 100644 --- a/docs/reference/toc.yml +++ b/docs/reference/toc.yml @@ -420,86 +420,86 @@ toc: children: - file: query-languages/querydsl.md children: - - file: query-languages/query-filter-context.md - - file: query-languages/compound-queries.md + - file: query-languages/query-dsl/query-filter-context.md + - file: query-languages/query-dsl/compound-queries.md children: - - file: query-languages/query-dsl-bool-query.md - - file: query-languages/query-dsl-boosting-query.md - - file: query-languages/query-dsl-constant-score-query.md - - file: query-languages/query-dsl-dis-max-query.md - - file: query-languages/query-dsl-function-score-query.md - - file: query-languages/full-text-queries.md + - file: query-languages/query-dsl/query-dsl-bool-query.md + - file: query-languages/query-dsl/query-dsl-boosting-query.md + - file: query-languages/query-dsl/query-dsl-constant-score-query.md + - file: query-languages/query-dsl/query-dsl-dis-max-query.md + - file: query-languages/query-dsl/query-dsl-function-score-query.md + - file: query-languages/query-dsl/full-text-queries.md children: - - file: query-languages/query-dsl-intervals-query.md - - file: query-languages/query-dsl-match-query.md - - file: query-languages/query-dsl-match-bool-prefix-query.md - - file: query-languages/query-dsl-match-query-phrase.md - - file: query-languages/query-dsl-match-query-phrase-prefix.md - - file: query-languages/query-dsl-combined-fields-query.md - - file: query-languages/query-dsl-multi-match-query.md - - file: query-languages/query-dsl-query-string-query.md - - file: query-languages/query-dsl-simple-query-string-query.md - - file: query-languages/geo-queries.md + - file: query-languages/query-dsl/query-dsl-intervals-query.md + - file: query-languages/query-dsl/query-dsl-match-query.md + - file: query-languages/query-dsl/query-dsl-match-bool-prefix-query.md + - file: query-languages/query-dsl/query-dsl-match-query-phrase.md + - file: query-languages/query-dsl/query-dsl-match-query-phrase-prefix.md + - file: query-languages/query-dsl/query-dsl-combined-fields-query.md + - file: query-languages/query-dsl/query-dsl-multi-match-query.md + - file: query-languages/query-dsl/query-dsl-query-string-query.md + - file: query-languages/query-dsl/query-dsl-simple-query-string-query.md + - file: query-languages/query-dsl/geo-queries.md children: - - file: query-languages/query-dsl-geo-bounding-box-query.md - - file: query-languages/query-dsl-geo-distance-query.md - - file: query-languages/query-dsl-geo-grid-query.md - - file: query-languages/query-dsl-geo-polygon-query.md - - file: query-languages/query-dsl-geo-shape-query.md - - file: query-languages/shape-queries.md + - file: query-languages/query-dsl/query-dsl-geo-bounding-box-query.md + - file: query-languages/query-dsl/query-dsl-geo-distance-query.md + - file: query-languages/query-dsl/query-dsl-geo-grid-query.md + - file: query-languages/query-dsl/query-dsl-geo-polygon-query.md + - file: query-languages/query-dsl/query-dsl-geo-shape-query.md + - file: query-languages/query-dsl/shape-queries.md children: - - file: query-languages/query-dsl-shape-query.md - - file: query-languages/joining-queries.md + - file: query-languages/query-dsl/query-dsl-shape-query.md + - file: query-languages/query-dsl/joining-queries.md children: - - file: query-languages/query-dsl-nested-query.md - - file: query-languages/query-dsl-has-child-query.md - - file: query-languages/query-dsl-has-parent-query.md - - file: query-languages/query-dsl-parent-id-query.md - - file: query-languages/query-dsl-match-all-query.md - - file: query-languages/span-queries.md + - file: query-languages/query-dsl/query-dsl-nested-query.md + - file: query-languages/query-dsl/query-dsl-has-child-query.md + - file: query-languages/query-dsl/query-dsl-has-parent-query.md + - file: query-languages/query-dsl/query-dsl-parent-id-query.md + - file: query-languages/query-dsl/query-dsl-match-all-query.md + - file: query-languages/query-dsl/span-queries.md children: - - file: query-languages/query-dsl-span-containing-query.md - - file: query-languages/query-dsl-span-field-masking-query.md - - file: query-languages/query-dsl-span-first-query.md - - file: query-languages/query-dsl-span-multi-term-query.md - - file: query-languages/query-dsl-span-near-query.md - - file: query-languages/query-dsl-span-not-query.md - - file: query-languages/query-dsl-span-query.md - - file: query-languages/query-dsl-span-term-query.md - - file: query-languages/query-dsl-span-within-query.md - - file: query-languages/vector-queries.md + - file: query-languages/query-dsl/query-dsl-span-containing-query.md + - file: query-languages/query-dsl/query-dsl-span-field-masking-query.md + - file: query-languages/query-dsl/query-dsl-span-first-query.md + - file: query-languages/query-dsl/query-dsl-span-multi-term-query.md + - file: query-languages/query-dsl/query-dsl-span-near-query.md + - file: query-languages/query-dsl/query-dsl-span-not-query.md + - file: query-languages/query-dsl/query-dsl-span-query.md + - file: query-languages/query-dsl/query-dsl-span-term-query.md + - file: query-languages/query-dsl/query-dsl-span-within-query.md + - file: query-languages/query-dsl/vector-queries.md children: - - file: query-languages/query-dsl-knn-query.md - - file: query-languages/query-dsl-sparse-vector-query.md - - file: query-languages/query-dsl-semantic-query.md - - file: query-languages/query-dsl-text-expansion-query.md - - file: query-languages/query-dsl-weighted-tokens-query.md - - file: query-languages/specialized-queries.md + - file: query-languages/query-dsl/query-dsl-knn-query.md + - file: query-languages/query-dsl/query-dsl-sparse-vector-query.md + - file: query-languages/query-dsl/query-dsl-semantic-query.md + - file: query-languages/query-dsl/query-dsl-text-expansion-query.md + - file: query-languages/query-dsl/query-dsl-weighted-tokens-query.md + - file: query-languages/query-dsl/specialized-queries.md children: - - file: query-languages/query-dsl-distance-feature-query.md - - file: query-languages/query-dsl-mlt-query.md - - file: query-languages/query-dsl-percolate-query.md - - file: query-languages/query-dsl-rank-feature-query.md - - file: query-languages/query-dsl-script-query.md - - file: query-languages/query-dsl-script-score-query.md - - file: query-languages/query-dsl-wrapper-query.md - - file: query-languages/query-dsl-pinned-query.md - - file: query-languages/query-dsl-rule-query.md - - file: query-languages/term-level-queries.md + - file: query-languages/query-dsl/query-dsl-distance-feature-query.md + - file: query-languages/query-dsl/query-dsl-mlt-query.md + - file: query-languages/query-dsl/query-dsl-percolate-query.md + - file: query-languages/query-dsl/query-dsl-rank-feature-query.md + - file: query-languages/query-dsl/query-dsl-script-query.md + - file: query-languages/query-dsl/query-dsl-script-score-query.md + - file: query-languages/query-dsl/query-dsl-wrapper-query.md + - file: query-languages/query-dsl/query-dsl-pinned-query.md + - file: query-languages/query-dsl/query-dsl-rule-query.md + - file: query-languages/query-dsl/term-level-queries.md children: - - file: query-languages/query-dsl-exists-query.md - - file: query-languages/query-dsl-fuzzy-query.md - - file: query-languages/query-dsl-ids-query.md - - file: query-languages/query-dsl-prefix-query.md - - file: query-languages/query-dsl-range-query.md - - file: query-languages/query-dsl-regexp-query.md - - file: query-languages/query-dsl-term-query.md - - file: query-languages/query-dsl-terms-query.md - - file: query-languages/query-dsl-terms-set-query.md - - file: query-languages/query-dsl-wildcard-query.md - - file: query-languages/query-dsl-minimum-should-match.md - - file: query-languages/query-dsl-multi-term-rewrite.md - - file: query-languages/regexp-syntax.md + - file: query-languages/query-dsl/query-dsl-exists-query.md + - file: query-languages/query-dsl/query-dsl-fuzzy-query.md + - file: query-languages/query-dsl/query-dsl-ids-query.md + - file: query-languages/query-dsl/query-dsl-prefix-query.md + - file: query-languages/query-dsl/query-dsl-range-query.md + - file: query-languages/query-dsl/query-dsl-regexp-query.md + - file: query-languages/query-dsl/query-dsl-term-query.md + - file: query-languages/query-dsl/query-dsl-terms-query.md + - file: query-languages/query-dsl/query-dsl-terms-set-query.md + - file: query-languages/query-dsl/query-dsl-wildcard-query.md + - file: query-languages/query-dsl/query-dsl-minimum-should-match.md + - file: query-languages/query-dsl/query-dsl-multi-term-rewrite.md + - file: query-languages/query-dsl/regexp-syntax.md - file: query-languages/esql.md children: - file: query-languages/esql/esql-syntax.md @@ -516,44 +516,44 @@ toc: - file: query-languages/esql/esql-examples.md - file: query-languages/sql.md children: - - file: query-languages/sql-spec.md + - file: query-languages/sql/sql-spec.md children: - - file: query-languages/sql-lexical-structure.md - - file: query-languages/sql-commands.md - - file: query-languages/sql-syntax-describe-table.md - - file: query-languages/sql-syntax-select.md - - file: query-languages/sql-syntax-show-catalogs.md - - file: query-languages/sql-syntax-show-columns.md - - file: query-languages/sql-syntax-show-functions.md - - file: query-languages/sql-syntax-show-tables.md - - file: query-languages/sql-data-types.md - - file: query-languages/sql-index-patterns.md - - file: query-languages/sql-index-frozen.md - - file: query-languages/sql-functions.md + - file: query-languages/sql/sql-lexical-structure.md + - file: query-languages/sql/sql-commands.md + - file: query-languages/sql/sql-syntax-describe-table.md + - file: query-languages/sql/sql-syntax-select.md + - file: query-languages/sql/sql-syntax-show-catalogs.md + - file: query-languages/sql/sql-syntax-show-columns.md + - file: query-languages/sql/sql-syntax-show-functions.md + - file: query-languages/sql/sql-syntax-show-tables.md + - file: query-languages/sql/sql-data-types.md + - file: query-languages/sql/sql-index-patterns.md + - file: query-languages/sql/sql-index-frozen.md + - file: query-languages/sql/sql-functions.md children: - - file: query-languages/sql-operators.md - - file: query-languages/sql-operators-logical.md - - file: query-languages/sql-operators-math.md - - file: query-languages/sql-operators-cast.md - - file: query-languages/sql-like-rlike-operators.md - - file: query-languages/sql-functions-aggs.md - - file: query-languages/sql-functions-grouping.md - - file: query-languages/sql-functions-datetime.md - - file: query-languages/sql-functions-search.md - - file: query-languages/sql-functions-math.md - - file: query-languages/sql-functions-string.md - - file: query-languages/sql-functions-type-conversion.md - - file: query-languages/sql-functions-geo.md - - file: query-languages/sql-functions-conditional.md - - file: query-languages/sql-functions-system.md - - file: query-languages/sql-syntax-reserved.md - - file: query-languages/sql-limitations.md + - file: query-languages/sql/sql-operators.md + - file: query-languages/sql/sql-operators-logical.md + - file: query-languages/sql/sql-operators-math.md + - file: query-languages/sql/sql-operators-cast.md + - file: query-languages/sql/sql-like-rlike-operators.md + - file: query-languages/sql/sql-functions-aggs.md + - file: query-languages/sql/sql-functions-grouping.md + - file: query-languages/sql/sql-functions-datetime.md + - file: query-languages/sql/sql-functions-search.md + - file: query-languages/sql/sql-functions-math.md + - file: query-languages/sql/sql-functions-string.md + - file: query-languages/sql/sql-functions-type-conversion.md + - file: query-languages/sql/sql-functions-geo.md + - file: query-languages/sql/sql-functions-conditional.md + - file: query-languages/sql/sql-functions-system.md + - file: query-languages/sql/sql-syntax-reserved.md + - file: query-languages/sql/sql-limitations.md - file: query-languages/eql.md children: - - file: query-languages/eql-syntax.md - - file: query-languages/eql-function-ref.md - - file: query-languages/eql-pipe-ref.md - - file: query-languages/eql-ex-threat-detection.md + - file: query-languages/eql/eql-syntax.md + - file: query-languages/eql/eql-function-ref.md + - file: query-languages/eql/eql-pipe-ref.md + - file: query-languages/eql/eql-ex-threat-detection.md - file: query-languages/kql.md - file: scripting-languages/index.md children: diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/DocsV3Support.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/DocsV3Support.java index 032b4394f993..7d4bf54b09b6 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/DocsV3Support.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/DocsV3Support.java @@ -142,7 +142,7 @@ public abstract class DocsV3Support { entry("esql-time-spans", "esql/esql-time-spans.md"), entry("esql-limitations", "esql/limitations.md"), entry("esql-function-named-params", "esql/esql-syntax.md"), - entry("query-dsl-query-string-query", "query-dsl-query-string-query.md") + entry("query-dsl-query-string-query", "query-dsl/query-dsl-query-string-query.md") ); // Static links to the commands file knownCommands = Map.ofEntries(entry("where", "where"), entry("stats-by", "stats")); @@ -300,8 +300,8 @@ public abstract class DocsV3Support { // Old-style links to Query DSL pages if (key.startsWith("query-dsl-")) { // <> - // [`match`](/reference/query-languages/query-dsl-match-query.md) - return makeLink(key, "query-dsl-", "/reference/query-languages/query-dsl-match-query.md"); + // [`match`](/reference/query-languages/query-dsl/query-dsl-match-query.md) + return makeLink(key, "query-dsl-", "/reference/query-languages/query-dsl/query-dsl-match-query.md"); } // Known links to mapping-reference if (knownMapping.containsKey(parts[0])) {