Skip to content

Commit 6eecbd2

Browse files
authored
Add the 'filters' property to KnnSearchRequest
1 parent 00b6e32 commit 6eecbd2

File tree

3 files changed

+38
-1
lines changed

3 files changed

+38
-1
lines changed

output/schema/schema.json

Lines changed: 29 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/typescript/types.ts

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/_global/knn_search/KnnSearchRequest.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import { RequestBase } from '@_types/Base'
2121
import { Fields, Indices, Routing } from '@_types/common'
2222
import { Query } from './_types/Knn'
23+
import { QueryContainer } from '@_types/query_dsl/abstractions'
2324
import { SourceConfig } from '@global/search/_types/SourceFilter'
2425
import { FieldAndFormat } from '@_types/query_dsl/abstractions'
2526

@@ -65,6 +66,13 @@ export interface Request extends RequestBase {
6566
* in the hits.fields property of the response. Accepts wildcard (*) patterns.
6667
*/
6768
fields?: Fields
69+
/**
70+
* Query to filter the documents that can match. The kNN search will return the top
71+
* `k` documents that also match this filter. The value can be a single query or a
72+
* list of queries. If `filter` isn't provided, all documents are allowed to match.
73+
* @since 8.2.0
74+
*/
75+
filter?: QueryContainer | QueryContainer[]
6876
/** kNN query to execute */
6977
knn: Query
7078
}

0 commit comments

Comments
 (0)