1- [[request-body-search- inner-hits]]
2- ==== Inner hits
1+ [[inner-hits]]
2+ == Retrieve inner hits
33
44The <<parent-join, parent-join>> and <<nested, nested>> features allow the return of documents that
55have 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
5555--------------------------------------------------
5656// NOTCONSOLE
5757
58- ===== Options
58+ [discrete]
59+ [[inner-hits-options]]
60+ === Options
5961
6062Inner hits support the following options:
6163
@@ -78,8 +80,9 @@ Inner hits also supports the following per document features:
7880* <<request-body-search-version,Include versions>>
7981* <<request-body-search-seq-no-primary-term,Include Sequence Numbers and Primary Terms>>
8082
83+ [discrete]
8184[[nested-inner-hits]]
82- ===== Nested inner hits
85+ === Nested inner hits
8386
8487The nested `inner_hits` can be used to include nested inner objects as inner hits to a search hit.
8588
@@ -196,8 +199,9 @@ An important default is that the `_source` returned in hits inside `inner_hits`
196199So in the above example only the comment part is returned per nested hit and not the entire source of the top level
197200document that contained the comment.
198201
202+ [discrete]
199203[[nested-inner-hits-source]]
200- ===== Nested inner hits and +_source+
204+ ==== Nested inner hits and +_source+
201205
202206Nested document don't have a `_source` field, because the entire source of document is stored with the root document under
203207its `_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.
312316
313317////
314318
319+ [discrete]
315320[[hierarchical-nested-inner-hits]]
316- ===== Hierarchical levels of nested object fields and inner hits.
321+ === Hierarchical levels of nested object fields and inner hits.
317322
318323If a mapping has multiple levels of hierarchical nested object fields each level can be accessed via dot notated path.
319324For 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:
433438
434439This indirect referencing is only supported for nested inner hits.
435440
441+ [discrete]
436442[[parent-child-inner-hits]]
437- ===== Parent/child inner hits
443+ === Parent/child inner hits
438444
439445The parent/child `inner_hits` can be used to include parent or child:
440446
0 commit comments