Skip to content

Commit 7d6ed21

Browse files
Add vector filters (#3341)
* add vector filters * Update code samples [skip ci] --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 8444d28 commit 7d6ed21

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

learn/filtering_and_sorting/filter_expression_reference.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,19 @@ release_date NOT EXISTS
108108
NOT release_date EXISTS
109109
```
110110

111+
#### Vector filters
112+
113+
When using AI-powered search, you may also use `EXISTS` to filter documents containing vector data:
114+
115+
- `_vectors EXISTS`: matches all documents with an embedding
116+
- `_vectors.{embedder_name} EXISTS`: matches all documents with an embedding for the given embedder
117+
- `_vectors.{embedder_name}.userProvided EXISTS`: matches all documents with a user-provided embedding on the given embedder
118+
- `_vectors.{embedder_name}.documentTemplate EXISTS`: matches all documents with an embedding generated from a document template. Excludes user-provided embeddings
119+
- `_vectors.{embedder_name}.regenerate EXISTS`: matches all documents with an embedding scheduled for regeneration
120+
- `_vectors.{embedder_name}.fragments.{fragment_name} EXISTS`: matches all documents with an embedding generated from the given multimodal fragment. Excludes user-provided embeddings
121+
122+
`_vectors` is only compatible with the `EXISTS` operator.
123+
111124
### `IS EMPTY`
112125

113126
The `IS EMPTY` operator selects documents in which the specified attribute exists but contains empty values. The following expression only returns documents with an empty `overview` field:

learn/resources/telemetry.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ This list is liable to change with every new version of Meilisearch. It's not be
147147
| `filter.with_geoBoundingBox` | `true` if the filter rule `_geoBoundingBox` is specified | false
148148
| `filter.with_geoRadius` | `true` if the filter rule `_geoRadius` is specified | false
149149
| `filter.most_used_syntax` | Most used filter syntax among all search requests containing the `filter` parameter | string
150+
| `filter.on_vectors` | `true` if the filter rule includes `_vector` | false
150151
| `q.max_terms_number` | Highest number of terms given for the `q` parameter | 5
151152
| `pagination.max_limit` | Highest value given for the `limit` parameter | 60
152153
| `pagination.max_offset` | Highest value given for the `offset` parameter | 1000
@@ -273,3 +274,4 @@ This list is liable to change with every new version of Meilisearch. It's not be
273274
| `export.avg_payload_size` | Average payload size per export | `512`
274275
| `webhooks_created` | Number of webhooks created in an instance | `2`
275276
| `webhooks.updated` | Number of times all webhooks in an instance have been updated | `5`
277+
| `with_vector_filter` | `true` when a document fetch request used a vector filter | `false`

0 commit comments

Comments
 (0)