mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-25 15:47:23 -04:00
Support k parameter for knn query (#110233)
Introduce an optional k param for knn query If k is not set, knn query has the previous behaviour: - `num_candidates` docs is collected from each shard. This `num_candidates` docs are used for combining with results with other queries and aggregations on each shard. - docs from all shards are merged to produce the top global `size` results If k is set, the behaviour instead is following: - `k` docs is collected from each shard. This `k` docs are used for combining results with other queries and aggregations on each shard. - similarly, docs from all shards are merged to produce the top global `size` results. Having `k` param makes it more intuitive for users to address their needs. They also don't need to care and can skip `num_candidates` param for this query as it is of more internal details to tune how knn search operates. Closes #108473
This commit is contained in:
parent
9938c4adfd
commit
405e39660b
29 changed files with 523 additions and 116 deletions
|
@ -431,6 +431,7 @@ module org.elasticsearch.server {
|
|||
org.elasticsearch.indices.IndicesFeatures,
|
||||
org.elasticsearch.action.admin.cluster.allocation.AllocationStatsFeatures,
|
||||
org.elasticsearch.index.mapper.MapperFeatures,
|
||||
org.elasticsearch.search.SearchFeatures,
|
||||
org.elasticsearch.script.ScriptFeatures,
|
||||
org.elasticsearch.search.retriever.RetrieversFeatures,
|
||||
org.elasticsearch.reservedstate.service.FileSettingsFeatures;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue