Skip to content

Commit fb3d545

Browse files
authored
Update nested knn search documentation about inner-hits (#104154) (#104202)
Adding a link tag for inner hits behavior and kNN search. Additionally adding a note that if you are using multiple knn clauses, that the inner hit name should be provided.
1 parent d0fb429 commit fb3d545

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

docs/reference/search/search-your-data/knn-search.asciidoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -814,12 +814,19 @@ Now we have filtered based on the top level `"creation_time"` and only one docum
814814
----
815815
// TESTRESPONSE[s/"took": 4/"took" : "$body.took"/]
816816

817+
[discrete]
818+
[[nested-knn-search-inner-hits]]
819+
==== Nested kNN Search with Inner hits
820+
817821
Additionally, if you wanted to extract the nearest passage for a matched document, you can supply <<inner-hits, inner_hits>>
818822
to the `knn` clause.
819823

820824
NOTE: `inner_hits` for kNN will only ever return a single hit, the nearest passage vector.
821825
Setting `"size"` to any value greater than `1` will have no effect on the results.
822826

827+
NOTE: When using `inner_hits` and multiple `knn` clauses, be sure to specify the <<inner-hits-options,`inner_hits.name`>>
828+
field. Otherwise, a naming clash can occur and fail the search request.
829+
823830
[source,console]
824831
----
825832
POST passage_vectors/_search

0 commit comments

Comments
 (0)