Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions content/develop/interact/search-and-query/query/vector-search.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ You can read more about the `PARAMS` argument in the [FT.SEARCH]({{< baseurl >}}

The following example shows you how to query for three bikes based on their description embeddings, and by using the field alias `vector`. The result is returned in ascending order based on the distance. You can see that the query only returns the fields `__vector_score` and `description`. The field `__vector_score` is present by default. Because you can have multiple vector fields in your schema, the vector score field name depends on the name of the vector field. If you change the field name `@vector` to `@foo`, the score field name changes to `__foo_score`.

```
{{< clients-example query_vector vector1 >}}
FT.SEARCH idx:bikes_vss "(*)=>[KNN 3 @vector $query_vector]" PARAMS 2 "query_vector" "Z\xf8\x15:\xf23\xa1\xbfZ\x1dI>\r\xca9..." SORTBY "__vector_score" ASC RETURN 2 "__vector_score" "description" DIALECT 2
```
{{< /clients-example >}}

<!-- Python query>
query = (
Expand All @@ -60,7 +60,7 @@ query = (
</!-->

{{% alert title="Note" color="warning" %}}
The binary value of the query vector is significantly shortened in this example.
The binary value of the query vector is significantly shortened in the CLI example above.
{{% /alert %}}


Expand Down Expand Up @@ -93,9 +93,9 @@ By default, [`FT.SEARCH`]({{< baseurl >}}/commands/ft.search/) returns only the

The example below shows a radius query that returns the description and the distance within a radius of `0.5`. The result is sorted by the distance.

```
{{< clients-example query_vector vector2 >}}
FT.SEARCH idx:bikes_vss "@vector:[VECTOR_RANGE 0.5 $query_vector]=>{$YIELD_DISTANCE_AS: vector_dist}" PARAMS 2 "query_vector" "Z\xf8\x15:\xf23\xa1\xbfZ\x1dI>\r\xca9..." SORTBY vector_dist ASC RETURN 2 vector_dist description DIALECT 2
```
{{< /clients-example >}}

<!-- Python query>
query = (
Expand Down
Loading