You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/vectorize/reference/metadata-filtering.mdx
+29-8Lines changed: 29 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,19 +31,26 @@ Vectors upserted before a metadata index was created won't have their metadata c
31
31
32
32
## Supported operations
33
33
34
-
Optional `filter` property on `query()` method specifies metadata filter:
35
-
36
-
| Operator | Description |
37
-
| -------- | ----------- |
38
-
|`$eq`| Equals |
39
-
|`$ne`| Not equals |
40
-
|`$in`| In |
41
-
|`$nin`| Not in |
34
+
An optional `filter` property on `query()` method specifies metadata filters:
35
+
36
+
| Operator | Description |
37
+
| -------- | ------------------------ |
38
+
|`$eq`| Equals |
39
+
|`$ne`| Not equals |
40
+
|`$in`| In |
41
+
|`$nin`| Not in |
42
+
|`$lt`| Less than |
43
+
|`$lte`| Less than or equal to |
44
+
|`$gt`| Greater than |
45
+
|`$gte`| Greater than or equal to |
42
46
43
47
-`filter` must be non-empty object whose compact JSON representation must be less than 2048 bytes.
44
48
-`filter` object keys cannot be empty, contain `" | .` (dot is reserved for nesting), start with `$`, or be longer than 512 characters.
45
49
- For `$eq` and `$ne`, `filter` object non-nested values can be `string`, `number`, `boolean`, or `null` values.
46
50
- For `$in` and `$nin`, `filter` object values can be arrays of `string`, `number`, `boolean`, or `null` values.
51
+
- Upper-bound range queries (i.e. `$lt` and `$lte`) can be combined with lower-bound range queries (i.e. `$gt` and `$gte`) within the same filter. Other combinations are not allowed.
52
+
- For range queries (i.e. `$lt`, `$lte`, `$gt`, `$gte`), `filter` object non-nested values can be `string` or `number` values. Strings are ordered lexicographically.
53
+
- Range queries involving a large number of vectors (~10M and above) may experience reduced accuracy.
47
54
48
55
### Namespace versus metadata filtering
49
56
@@ -78,6 +85,20 @@ Both [namespaces](/vectorize/best-practices/insert-vectors/#namespaces) and meta
0 commit comments