Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ POST my-image-index/_search

A sample query can look like below:

```js
```json
{
"query" : {
"nested" : {
Expand All @@ -226,6 +226,7 @@ A sample query can look like below:
}
```

Note that nested `knn` only supports `score_mode=max`.

## Knn query with aggregations [knn-query-aggregations]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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-dsl/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). Default is `avg`, but nested `knn` queries only support `score_mode=max`. Valid values are:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mind also putting a reference on query-dsl-knn-query.md There is a section there on Knn query inside a nested query

Also, it seems like we need to also now update: https://github.com/elastic/docs-content/blob/main/solutions/search/vector/knn.md in a separate PR.


`avg` (Default)
: Use the mean relevance score of all matching child objects.
Expand Down
Loading