Skip to content

Commit 55e4300

Browse files
Apply suggestions from code review
Co-authored-by: andy-stark-redis <[email protected]>
1 parent 9b39088 commit 55e4300

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

content/commands/ft.search.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ Search for books with semantically similar title to _Planet Earth_. Return top 1
682682
<details open>
683683
<summary><b>Vector search with cluster optimization</b></summary>
684684

685-
Search for books with semantically similar title to _Planet Earth_ using cluster optimization. Each shard retrieves 60% of the requested results for improved performance in Redis cluster environments. See the [query attributes]({{< relref "/develop/ai/search-and-query/advanced-concepts/query_syntax#query-attributes" >}}) reference page for more information.
685+
Search for books with titles that are semantically similar to _Planet Earth_ using cluster optimization. Each shard retrieves 60% of the requested results for improved performance in Redis cluster environments. See the [query attributes]({{< relref "/develop/ai/search-and-query/advanced-concepts/query_syntax#query-attributes" >}}) reference page for more information.
686686

687687
{{< highlight bash >}}
688688
127.0.0.1:6379> FT.SEARCH books-idx "*=>[KNN 100 @title_embedding $query_vec]=>{$SHARD_K_RATIO: 0.6; $YIELD_DISTANCE_AS: title_score}" PARAMS 2 query_vec <"Planet Earth" embedding BLOB> SORTBY title_score DIALECT 2

content/develop/ai/search-and-query/advanced-concepts/query_syntax.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,8 @@ The supported attributes are:
389389

390390
As of v2.6.1, the query attributes syntax supports these additional attributes:
391391

392-
* **$yield_distance_as**: specifies the distance field name, used for later sorting and/or returning, for clauses that yield some distance metric. It is currently supported for vector queries only (both KNN and range).
393-
* **$shard_k_ratio**: controls how many results each shard retrieves relative to the requested top_k in cluster setups. Value range: 0.1 - 1.0 (default: 1.0). Only applicable to vector KNN queries in Redis cluster environments. See [cluster-specific query parameters]({{< relref "develop/ai/search-and-query/vectors#cluster-specific-query-parameters" >}}) for detailed information.
392+
* **$yield_distance_as**: specifies the distance field name for clauses that yield some distance metric. This is used for later sorting and/or returning. It is currently supported for vector queries only (both KNN and range).
393+
* **$shard_k_ratio**: controls how many results each shard retrieves relative to the requested top_k in cluster setups. Value range: 0.1 - 1.0 (default: 1.0). Only applicable to vector KNN queries in Redis cluster environments. See [Cluster-specific query parameters]({{< relref "develop/ai/search-and-query/vectors#cluster-specific-query-parameters" >}}) for detailed information.
394394
* **vector query params**: pass optional parameters for [vector queries]({{< relref "develop/ai/search-and-query/vectors#querying-vector-fields" >}}) in key-value format.
395395

396396
## A few query examples

content/develop/ai/search-and-query/vectors/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ In cases where some shards contain fewer documents than required to fulfill the
582582

583583
1. **Monitor shard distribution**: Ensure your data is relatively balanced across shards
584584
2. **Adjust ratio dynamically**: If you consistently get fewer results than expected, increase the ratio
585-
3. **Use higher ratios for critical queries**: When result completeness is more important than performance
585+
3. **Use higher ratios for critical queries**: Do this when result completeness is more important than performance
586586

587587
#### Performance vs accuracy trade-offs
588588

0 commit comments

Comments
 (0)