Add k-NN Faiss filtering documentation (#4476)
* Add k-NN Faiss filtering documentation Signed-off-by: Fanit Kolchina <[email protected]> * Move the note Signed-off-by: Fanit Kolchina <[email protected]> * Add faiss and a filter table Signed-off-by: Fanit Kolchina <[email protected]> * Refactor boolean filtering section Signed-off-by: Fanit Kolchina <[email protected]> * Clarified that Faiss works with hnsw only Signed-off-by: Fanit Kolchina <[email protected]> * Add more Faiss filtering information Signed-off-by: Fanit Kolchina <[email protected]> * Apply suggestions from code review Co-authored-by: Melissa Vagi <[email protected]> Signed-off-by: kolchfa-aws <[email protected]> * Apply suggestions from code review Co-authored-by: Nathan Bower <[email protected]> Signed-off-by: kolchfa-aws <[email protected]> * Update _search-plugins/knn/filter-search-knn.md Co-authored-by: Nathan Bower <[email protected]> Signed-off-by: kolchfa-aws <[email protected]> * Implemented editorial comments Signed-off-by: Fanit Kolchina <[email protected]> * Implemented one more editorial comment Signed-off-by: Fanit Kolchina <[email protected]> --------- Signed-off-by: Fanit Kolchina <[email protected]> Signed-off-by: kolchfa-aws <[email protected]> Co-authored-by: Melissa Vagi <[email protected]> Co-authored-by: Nathan Bower <[email protected]>
This commit is contained in:
co-authored by
Melissa Vagi
Nathan Bower
parent
06665364fd
commit
6c83dfd87c
@@ -242,30 +242,8 @@ POST _bulk
|
||||
After data is ingested, it can be search just like any other `knn_vector` field!
|
||||
|
||||
### Using approximate k-NN with filters
|
||||
If you use the `knn` query alongside filters or other clauses (e.g. `bool`, `must`, `match`), you might receive fewer than `k` results. In this example, `post_filter` reduces the number of results from 2 to 1:
|
||||
|
||||
```json
|
||||
GET my-knn-index-1/_search
|
||||
{
|
||||
"size": 2,
|
||||
"query": {
|
||||
"knn": {
|
||||
"my_vector2": {
|
||||
"vector": [2, 3, 5, 6],
|
||||
"k": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"post_filter": {
|
||||
"range": {
|
||||
"price": {
|
||||
"gte": 5,
|
||||
"lte": 10
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
To learn about using filters with k-NN search, see [k-NN search with filters]({{site.url}}{{site.baseurl}}/search-plugins/knn/filter-search-knn/).
|
||||
|
||||
## Spaces
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
Reference in New Issue
Block a user