From 788778c13960fa8737572ca1df94625c2c2c1f5f Mon Sep 17 00:00:00 2001 From: James Rodewig <40268737+jrodewig@users.noreply.github.com> Date: Thu, 6 Aug 2020 14:06:01 -0400 Subject: [PATCH] [DOCS] Move inner hits content to separate page (#60840) (#60843) Moves inner hits content from the deprecated 'Request Body Search' chapter to a separate page. --- .../modules/cross-cluster-search.asciidoc | 2 +- docs/reference/redirects.asciidoc | 6 +++++- docs/reference/search/request-body.asciidoc | 5 ++++- .../search/request/collapse.asciidoc | 2 +- .../search/request/inner-hits.asciidoc | 20 ++++++++++++------- .../search/request/stored-fields.asciidoc | 2 +- docs/reference/search/search-fields.asciidoc | 2 +- .../search/search-your-data.asciidoc | 1 + 8 files changed, 27 insertions(+), 13 deletions(-) diff --git a/docs/reference/modules/cross-cluster-search.asciidoc b/docs/reference/modules/cross-cluster-search.asciidoc index 756effb3173..9020787cfa8 100644 --- a/docs/reference/modules/cross-cluster-search.asciidoc +++ b/docs/reference/modules/cross-cluster-search.asciidoc @@ -319,7 +319,7 @@ By default, {es} reduces the number of network roundtrips between remote clusters. This reduces the impact of network delays on search speed. However, {es} can't reduce network roundtrips for large search requests, such as those including a <> or -<>. +<>. + See <> to learn how this option works. diff --git a/docs/reference/redirects.asciidoc b/docs/reference/redirects.asciidoc index d146dc55919..5b8c1b317a7 100644 --- a/docs/reference/redirects.asciidoc +++ b/docs/reference/redirects.asciidoc @@ -79,7 +79,7 @@ See <>. [role="exclude",id="search-request-inner-hits"] === Inner hits parameter for request body search API -See <>. +See <>. [role="exclude",id="search-request-min-score"] === Minimum score parameter for request body search API @@ -1009,6 +1009,10 @@ See <>. See <>. +[role="exclude",id="request-body-search-inner-hits"] +=== Inner hits +See <>. + [role="exclude",id="request-body-search-queries-and-filters"] === Named queries diff --git a/docs/reference/search/request-body.asciidoc b/docs/reference/search/request-body.asciidoc index e48e2ca3d8c..98b06fede2b 100644 --- a/docs/reference/search/request-body.asciidoc +++ b/docs/reference/search/request-body.asciidoc @@ -125,7 +125,10 @@ See <>. include::request/index-boost.asciidoc[] -include::request/inner-hits.asciidoc[] +[[request-body-search-inner-hits]] +==== Inner hits + +See <>. include::request/min-score.asciidoc[] diff --git a/docs/reference/search/request/collapse.asciidoc b/docs/reference/search/request/collapse.asciidoc index 2aea669938f..4bf50104238 100644 --- a/docs/reference/search/request/collapse.asciidoc +++ b/docs/reference/search/request/collapse.asciidoc @@ -72,7 +72,7 @@ GET /my-index-000001/_search <4> how to sort the document inside each group <5> the number of concurrent requests allowed to retrieve the `inner_hits` per group -See <> for the complete list of supported options and the format of the response. +See <> for the complete list of supported options and the format of the response. It is also possible to request multiple `inner_hits` for each collapsed hit. This can be useful when you want to get multiple representations of the collapsed hits. diff --git a/docs/reference/search/request/inner-hits.asciidoc b/docs/reference/search/request/inner-hits.asciidoc index c2df5cf21c3..bd2235de8d6 100644 --- a/docs/reference/search/request/inner-hits.asciidoc +++ b/docs/reference/search/request/inner-hits.asciidoc @@ -1,5 +1,5 @@ -[[request-body-search-inner-hits]] -==== Inner hits +[[inner-hits]] +== Retrieve inner hits The <> and <> features allow the return of documents that have matches in a different scope. In the parent/child case, parent documents are returned based on matches in child @@ -55,7 +55,9 @@ If `inner_hits` is defined on a query that supports it then each search hit will -------------------------------------------------- // NOTCONSOLE -===== Options +[discrete] +[[inner-hits-options]] +=== Options Inner hits support the following options: @@ -78,8 +80,9 @@ Inner hits also supports the following per document features: * <> * <> +[discrete] [[nested-inner-hits]] -===== Nested inner hits +=== Nested inner hits The nested `inner_hits` can be used to include nested inner objects as inner hits to a search hit. @@ -196,8 +199,9 @@ An important default is that the `_source` returned in hits inside `inner_hits` So in the above example only the comment part is returned per nested hit and not the entire source of the top level document that contained the comment. +[discrete] [[nested-inner-hits-source]] -===== Nested inner hits and +_source+ +==== Nested inner hits and +_source+ Nested document don't have a `_source` field, because the entire source of document is stored with the root document under its `_source` field. To include the source of just the nested document, the source of the root document is parsed and just @@ -312,8 +316,9 @@ Response not included in text but tested for completeness sake. //// +[discrete] [[hierarchical-nested-inner-hits]] -===== Hierarchical levels of nested object fields and inner hits. +=== Hierarchical levels of nested object fields and inner hits. If a mapping has multiple levels of hierarchical nested object fields each level can be accessed via dot notated path. For example if there is a `comments` nested field that contains a `votes` nested field and votes should directly be returned @@ -433,8 +438,9 @@ Which would look like: This indirect referencing is only supported for nested inner hits. +[discrete] [[parent-child-inner-hits]] -===== Parent/child inner hits +=== Parent/child inner hits The parent/child `inner_hits` can be used to include parent or child: diff --git a/docs/reference/search/request/stored-fields.asciidoc b/docs/reference/search/request/stored-fields.asciidoc index 687ae78480a..4d3f5ae1c45 100644 --- a/docs/reference/search/request/stored-fields.asciidoc +++ b/docs/reference/search/request/stored-fields.asciidoc @@ -42,7 +42,7 @@ Also only leaf fields can be returned via the `stored_fields` option. If an obje NOTE: On its own, `stored_fields` cannot be used to load fields in nested objects -- if a field contains a nested object in its path, then no data will be returned for that stored field. To access nested fields, `stored_fields` -must be used within an <> block. +must be used within an <> block. [discrete] [[disable-stored-fields]] diff --git a/docs/reference/search/search-fields.asciidoc b/docs/reference/search/search-fields.asciidoc index de5a3243454..0fa4a89d567 100644 --- a/docs/reference/search/search-fields.asciidoc +++ b/docs/reference/search/search-fields.asciidoc @@ -220,7 +220,7 @@ GET my-index-000001/_search TIP: You cannot use the `docvalue_fields` parameter to retrieve doc values for nested objects. If you specify a nested object, the search returns an empty array (`[ ]`) for the field. To access nested fields, use the -<> parameter's `docvalue_fields` +<> parameter's `docvalue_fields` property. [discrete] diff --git a/docs/reference/search/search-your-data.asciidoc b/docs/reference/search/search-your-data.asciidoc index 8f6c7b3a6ca..529d46fb4d2 100644 --- a/docs/reference/search/search-your-data.asciidoc +++ b/docs/reference/search/search-your-data.asciidoc @@ -233,6 +233,7 @@ include::request/highlighting.asciidoc[] include::{es-repo-dir}/async-search.asciidoc[] include::{es-repo-dir}/search/near-real-time.asciidoc[] include::paginate-search-results.asciidoc[] +include::request/inner-hits.asciidoc[] include::search-fields.asciidoc[] include::{es-repo-dir}/modules/cross-cluster-search.asciidoc[] include::request/sort.asciidoc[]