Skip to content
Merged
Show file tree
Hide file tree
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
19 changes: 17 additions & 2 deletions site/content/3.12/aql/functions/vector.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,23 @@ be found depends on the data as well as the search effort (see the `nProbe` opti
{{< info >}}
- If there is more than one suitable vector index over the same attribute, it is
undefined which one is selected.
- You cannot have any `FILTER` operation between `FOR` and `LIMIT` for
pre-filtering.

- In v3.12.4 and v3.12.5, you cannot have any `FILTER` operation between `FOR`
and `LIMIT` for pre-filtering. From v3.12.6 onward, you can add `FILTER`
operations between `FOR` and `SORT` that are then applied during the lookup in
the vector index. Example:

```aql
FOR doc IN coll
FILTER doc.val > 3
SORT APPROX_NEAR_COSINE(doc.vector, @q) DESC
LIMIT 5
RETURN doc
```

Note that e.g. `LIMIT 5` does not ensure that you get 5 results by searching
as many neighboring Voronoi cells as necessary, but it rather considers only as
many as configured via the `nProbes` parameter.
{{< /info >}}

### APPROX_NEAR_COSINE()
Expand Down
14 changes: 14 additions & 0 deletions site/content/3.12/release-notes/version-3.12/whats-new-in-3-12.md
Original file line number Diff line number Diff line change
Expand Up @@ -1483,6 +1483,20 @@ has been added.

<small>Introduced in: v3.12.6</small>

Vector indexes now support filtering. You can add `FILTER` operations between
`FOR` and `SORT` that are then applied during the lookup in the vector index.
Note that e.g. `LIMIT 5` does not ensure that you get 5 results by searching
as many neighboring Voronoi cells as necessary, but it rather considers only as
many as configured via the `nProbes` parameter. Example:

```aql
FOR doc IN coll
FILTER doc.val > 3
SORT APPROX_NEAR_COSINE(doc.vector, @q) DESC
LIMIT 5
RETURN doc
```

Vector indexes can now be sparse to exclude documents with the embedding attribute
for indexing missing or set to `null`.

Expand Down
19 changes: 17 additions & 2 deletions site/content/3.13/aql/functions/vector.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,23 @@ be found depends on the data as well as the search effort (see the `nProbe` opti
{{< info >}}
- If there is more than one suitable vector index over the same attribute, it is
undefined which one is selected.
- You cannot have any `FILTER` operation between `FOR` and `LIMIT` for
pre-filtering.

- In v3.12.4 and v3.12.5, you cannot have any `FILTER` operation between `FOR`
and `LIMIT` for pre-filtering. From v3.12.6 onward, you can add `FILTER`
operations between `FOR` and `SORT` that are then applied during the lookup in
the vector index. Example:

```aql
FOR doc IN coll
FILTER doc.val > 3
SORT APPROX_NEAR_COSINE(doc.vector, @q) DESC
LIMIT 5
RETURN doc
```

Note that e.g. `LIMIT 5` does not ensure that you get 5 results by searching
as many neighboring Voronoi cells as necessary, but it rather considers only as
many as configured via the `nProbes` parameter.
{{< /info >}}

### APPROX_NEAR_COSINE()
Expand Down
14 changes: 14 additions & 0 deletions site/content/3.13/release-notes/version-3.12/whats-new-in-3-12.md
Original file line number Diff line number Diff line change
Expand Up @@ -1483,6 +1483,20 @@ has been added.

<small>Introduced in: v3.12.6</small>

Vector indexes now support filtering. You can add `FILTER` operations between
`FOR` and `SORT` that are then applied during the lookup in the vector index.
Note that e.g. `LIMIT 5` does not ensure that you get 5 results by searching
as many neighboring Voronoi cells as necessary, but it rather considers only as
many as configured via the `nProbes` parameter. Example:

```aql
FOR doc IN coll
FILTER doc.val > 3
SORT APPROX_NEAR_COSINE(doc.vector, @q) DESC
LIMIT 5
RETURN doc
```

Vector indexes can now be sparse to exclude documents with the embedding attribute
for indexing missing or set to `null`.

Expand Down