Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOCS] Move inner hits content to separate page #60840

Merged
merged 3 commits into from
Aug 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/reference/modules/cross-cluster-search.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,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 <<scroll-search-results, scroll>> or
<<request-body-search-inner-hits,inner hits>>.
<<inner-hits,inner hits>>.
+
See <<ccs-min-roundtrips>> to learn how this option works.

Expand Down
6 changes: 5 additions & 1 deletion docs/reference/redirects.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ See <<request-body-search-index-boost>>.

[role="exclude",id="search-request-inner-hits"]
=== Inner hits parameter for request body search API
See <<request-body-search-inner-hits>>.
See <<inner-hits>>.

[role="exclude",id="search-request-min-score"]
=== Minimum score parameter for request body search API
Expand Down Expand Up @@ -1016,6 +1016,10 @@ See <<highlighting>>.

See <<how-es-highlighters-work-internally>>.

[role="exclude",id="request-body-search-inner-hits"]
=== Inner hits
See <<inner-hits>>.

[role="exclude",id="request-body-search-queries-and-filters"]
=== Named queries

Expand Down
5 changes: 4 additions & 1 deletion docs/reference/search/request-body.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,10 @@ See <<highlighting>>.

include::request/index-boost.asciidoc[]

include::request/inner-hits.asciidoc[]
[[request-body-search-inner-hits]]
==== Inner hits

See <<inner-hits>>.

include::request/min-score.asciidoc[]

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/search/request/collapse.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<request-body-search-inner-hits, inner hits>> for the complete list of supported options and the format of the response.
See <<inner-hits, inner hits>> 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.
Expand Down
20 changes: 13 additions & 7 deletions docs/reference/search/request/inner-hits.asciidoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[[request-body-search-inner-hits]]
==== Inner hits
[[inner-hits]]
== Retrieve inner hits

The <<parent-join, parent-join>> and <<nested, nested>> 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
Expand Down Expand Up @@ -54,7 +54,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:

Expand All @@ -77,8 +79,9 @@ Inner hits also supports the following per document features:
* <<request-body-search-version,Include versions>>
* <<request-body-search-seq-no-primary-term,Include Sequence Numbers and Primary Terms>>

[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.

Expand Down Expand Up @@ -193,8 +196,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
Expand Down Expand Up @@ -307,8 +311,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
Expand Down Expand Up @@ -426,8 +431,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:

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/search/request/stored-fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<request-body-search-inner-hits, `inner_hits`>> block.
must be used within an <<inner-hits, `inner_hits`>> block.

[discrete]
[[disable-stored-fields]]
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/search/search-fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,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
<<request-body-search-inner-hits, `inner_hits`>> parameter's `docvalue_fields`
<<inner-hits, `inner_hits`>> parameter's `docvalue_fields`
property.

[discrete]
Expand Down
1 change: 1 addition & 0 deletions docs/reference/search/search-your-data.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,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[]