Skip to content
This repository was archived by the owner on Aug 16, 2022. It is now read-only.

Commit 08749a5

Browse files
committed
Update index.md
1 parent ed9b000 commit 08749a5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/knn/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ In this case, `k` is the number of neighbors you want the query to return, but y
9191

9292
## Mixing queries
9393

94-
If you mix the `knn` query with filters or other queries, you might receive fewer than `k` results. In this example, `post_filter` reduces the number of results from 2 to 1:
94+
If you use the `knn` query alongside filters, you might receive fewer than `k` results. In this example, `post_filter` reduces the number of results from 2 to 1:
9595

9696
```json
9797
GET my-knn-index-1/_search
@@ -207,6 +207,6 @@ All options are required.
207207

208208
## Performance considerations
209209

210-
The standard KNN query and custom scoring option have performance tradeoffs. You should test both using a representative set of documents to see if the search results and latencies match your expectations.
210+
The standard KNN query and custom scoring option perform differently. Test using a representative set of documents to see if the search results and latencies match your expectations.
211211

212-
In general, larger `k` values benefit from the standard KNN query. If you have a smaller `k` value and expect the initial pre-filter to reduce the number of documents to the thousands (not millions), custom scoring can work well.
212+
Custom scoring works best if the initial filter reduces the number of documents to no more than 20,000. Increasing shard count can improve latencies, but be sure to keep shard size within [the recommended guidelines](../elasticsearch/#primary-and-replica-shards).

0 commit comments

Comments
 (0)