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: docs/collections.md
+65Lines changed: 65 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -310,3 +310,68 @@ DELETE FROM articles WHERE year < 2020 AND status = 'draft'
310
310
**Notes:**
311
311
- If no points match the filter or ID, the operation succeeds silently with a count of 0.
312
312
- The collection itself must exist; deleting from a non-existent collection raises an error.
313
+
314
+
---
315
+
316
+
## UPDATE SET VECTOR — replace a point's dense vector
317
+
318
+
Replaces the stored dense vector for a **single point** identified by its ID. The point must already exist in the collection. Use this when you want to refresh an embedding without changing the payload.
319
+
320
+
**Syntax:**
321
+
```
322
+
UPDATE <collection> SET VECTOR WHERE id = '<point_id>' [<vector>]
323
+
UPDATE <collection> SET VECTOR WHERE id = <integer_id> [<vector>]
324
+
```
325
+
326
+
The vector is provided as a JSON-style float array `[v1, v2, ..., vN]`. The array length must match the collection's configured vector dimensions.
327
+
328
+
**Examples:**
329
+
330
+
```sql
331
+
-- Replace vector by UUID
332
+
UPDATE articles SET VECTOR WHERE id ='3f2e1a4b-8c91-4d0e-b123-abc123def456' [0.1, 0.2, 0.3, 0.4]
333
+
334
+
-- Replace vector by integer ID
335
+
UPDATE articles SET VECTOR WHERE id =42 [0.1, 0.2, 0.3, 0.4]
336
+
```
337
+
338
+
**Notes:**
339
+
- Only single-point updates are supported (by ID). Bulk or filter-based vector updates are not supported.
340
+
- The point must already exist; this operation does not create new points.
341
+
- The collection must exist; updating from a non-existent collection raises an error.
342
+
- For hybrid collections, the dense vector named `"dense"` is updated. Sparse vectors are managed separately.
343
+
344
+
---
345
+
346
+
## UPDATE SET PAYLOAD — merge fields into a point's payload
347
+
348
+
Merges new key/value pairs into the payload of one or more points. **Existing fields not mentioned in the update are preserved** (additive merge, not a full replace). Use a `WHERE` filter to update multiple points at once.
349
+
350
+
**Syntax:**
351
+
```
352
+
UPDATE <collection> SET PAYLOAD WHERE id = '<point_id>' {<payload>}
353
+
UPDATE <collection> SET PAYLOAD WHERE id = <integer_id> {<payload>}
354
+
UPDATE <collection> SET PAYLOAD WHERE <filter> {<payload>}
355
+
```
356
+
357
+
**Examples:**
358
+
359
+
```sql
360
+
-- Update a single point by UUID
361
+
UPDATE articles SET PAYLOAD WHERE id ='3f2e1a4b-8c91-4d0e-b123-abc123def456' {'year': 2025, 'status': 'active'}
362
+
363
+
-- Update a single point by integer ID
364
+
UPDATE articles SET PAYLOAD WHERE id =42 {'category': 'tech'}
365
+
366
+
-- Update all points matching a filter
367
+
UPDATE articles SET PAYLOAD WHERE category ='draft' {'status': 'published'}
368
+
369
+
-- Compound filter update
370
+
UPDATE articles SET PAYLOAD WHERE year <2020AND status ='draft' {'archived': true}
371
+
```
372
+
373
+
**Notes:**
374
+
-**Merge semantics:** only the fields in `{…}` are written; all other existing payload fields are preserved.
375
+
- If no points match the filter, the operation succeeds silently with no changes.
376
+
- The collection must exist; updating from a non-existent collection raises an error.
377
+
- All `WHERE` filter operators supported by `DELETE` are also supported here (see [WHERE Filters](filters.md)).
|`Connection failed: ...`| Qdrant unreachable at given URL | Check that Qdrant is running and the URL is correct |
175
175
|`INSERT requires a 'text' field in VALUES`|`text` key missing from the VALUES dict | Add `'text': '...'` to your dict |
176
176
|`Vector dimension mismatch: collection '...' expects X dims, but model produces Y dims`| Model used in INSERT differs from the one used to create the collection | Use `USING MODEL` to specify the same model as the collection was created with |
177
-
|`Collection '...' does not exist`| SEARCH / SCROLL / SELECT / DROP / DELETE on a non-existent collection | Check name spelling or run `SHOW COLLECTIONS`|
177
+
|`Collection '...' does not exist`| SEARCH / SCROLL / SELECT / DROP / DELETE / UPDATE on a non-existent collection | Check name spelling or run `SHOW COLLECTIONS`|
178
178
|`Unexpected token '...'; expected a QQL statement keyword`| Unrecognized statement | Check the query syntax and supported statement list |
179
179
|`SELECT requires a string or integer point id, got '...'`|`SELECT` used with a non-ID filter value | Use `SELECT * FROM <collection> WHERE id = '<id>'` or an integer ID |
180
180
|`Unterminated string literal (at position N)`| A string is missing its closing quote | Close the string with a matching `'` or `"`|
181
181
|`Unexpected character '@' (at position N)`| A character not part of QQL syntax | Remove or quote the offending character |
182
182
|`Expected a filter operator after field '...'`| Unknown operator in WHERE clause | Use one of: `=`, `!=`, `>`, `>=`, `<`, `<=`, `IN`, `NOT IN`, `BETWEEN`, `IS NULL`, `IS NOT NULL`, `IS EMPTY`, `IS NOT EMPTY`, `MATCH`|
183
183
|`Expected ')' ...`| Unclosed parenthesis in WHERE clause | Add the missing `)` to close the group |
184
184
|`Qdrant error during SEARCH: ...`| Hybrid search on a non-hybrid collection, or wrong vector names | Ensure the collection was created with `HYBRID` before using `USING HYBRID` in INSERT/SEARCH |
185
+
|`Qdrant error during GROUP BY SEARCH: ...`| GROUP BY on an unindexed field, or unsupported field type | Ensure the group-by field is indexed as `keyword` or `integer` via `CREATE INDEX`|
186
+
|`GROUP BY and RERANK cannot be combined ...`| Both GROUP BY and RERANK specified in the same SEARCH | Remove one of the two clauses |
187
+
|`Expected VECTOR or PAYLOAD after SET, got '...'`| Unknown keyword after SET in UPDATE | Use `UPDATE ... SET VECTOR ...` or `UPDATE ... SET PAYLOAD ...`|
188
+
|`Expected a vector list [...] after point ID in UPDATE SET VECTOR`| UPDATE SET VECTOR missing the `[...]` float array | Add the vector array: `UPDATE ... SET VECTOR WHERE id = '...' [0.1, 0.2, ...]`|
189
+
|`Qdrant error during UPDATE VECTOR: ...`| Point does not exist, or vector dimensions mismatch | Verify the point ID exists and the vector length matches the collection's dimensions |
190
+
|`Qdrant error during UPDATE PAYLOAD: ...`| Qdrant rejected the payload update | Check field values and collection state |
191
+
|`Vector elements must be numeric floats; boolean values are not allowed`| A boolean (`true` or `false`) was present in the vector array for `UPDATE SET VECTOR` — `float(True)` silently equals `1.0` in Python, so this is caught explicitly | Replace booleans with numeric floats: `UPDATE … [0.1, 0.2, …, 0.N]`|
192
+
|`Vector elements must be numeric; got invalid value: ...`| A non-numeric value (string or null) was present in the vector array for `UPDATE SET VECTOR`| Ensure all vector elements are floats: `UPDATE … [0.1, 0.2, …, 0.N]`|
193
+
|`GROUP_SIZE must be a positive integer, got N`|`GROUP_SIZE 0` or a negative value was specified | Use a positive integer: `GROUP_SIZE 3`|
185
194
|`Qdrant error during SCROLL: ...`| Qdrant rejected scroll request | Verify collection state, filter, and cursor (`AFTER`) value |
186
195
|`Unknown index type '...'`| Invalid schema type in CREATE INDEX | Use one of: `keyword`, `integer`, `float`, `bool`, `text`, `geo`, `datetime`|
187
196
|`Qdrant error during CREATE INDEX: ...`| Qdrant rejected the index creation | Check field name and collection state |
Copy file name to clipboardExpand all lines: docs/search.md
+65Lines changed: 65 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -343,3 +343,68 @@ SEARCH articles SIMILAR TO 'semantic search' LIMIT 5
343
343
| Large collections with keyword-heavy queries |`USING HYBRID RERANK`|
344
344
345
345
> **Note on scores:** After reranking, the `score` column shows the cross-encoder's raw logit (can be any real number, unbounded). Do not compare reranked scores to non-reranked cosine similarity scores.
346
+
347
+
---
348
+
349
+
## SEARCH … GROUP BY — grouped results
350
+
351
+
Returns the top-scoring points **grouped by a payload field value**. Instead of a single flat ranked list, results are organised into groups — each group contains the top-scoring points that share the same value for the specified field.
352
+
353
+
Useful for **result diversification**: e.g. "return the 3 best articles from each category", or "show the top 2 papers per author".
354
+
355
+
**Syntax:**
356
+
```
357
+
SEARCH <collection> SIMILAR TO '<query>' LIMIT <n> GROUP BY <field>
358
+
SEARCH <collection> SIMILAR TO '<query>' LIMIT <n> GROUP BY <field> GROUP_SIZE <m>
359
+
SEARCH <collection> SIMILAR TO '<query>' LIMIT <n> [WHERE <filter>] GROUP BY <field> [GROUP_SIZE <m>]
360
+
SEARCH <collection> SIMILAR TO '<query>' LIMIT <n> USING HYBRID GROUP BY <field> [GROUP_SIZE <m>]
361
+
```
362
+
363
+
-**`LIMIT <n>`** — maximum number of **groups** to return.
364
+
-**`GROUP_SIZE <m>`** — maximum number of points per group (default: **3**).
365
+
-**`GROUP BY <field>`** — the payload field whose values define the groups. **Must be a string (keyword) or number (integer) field** — this is enforced by Qdrant. Dot-notation is supported (e.g. `meta.author`). Array-valued fields are allowed: a point with multiple values for the field can appear in multiple groups. The field should be indexed as `keyword` or `integer` for best performance (see [CREATE INDEX](collections.md)).
366
+
-`WHERE` filters, `USING HYBRID`, and `USING MODEL` are all compatible with GROUP BY.
367
+
-**`GROUP BY` and `RERANK` cannot be combined** in the same statement — this raises a syntax error.
368
+
369
+
**Examples:**
370
+
371
+
Top 5 categories, up to 3 articles each (default group_size):
372
+
```sql
373
+
SEARCH articles SIMILAR TO 'machine learning'LIMIT5GROUP BY category
374
+
```
375
+
376
+
Top 3 authors, up to 2 papers each:
377
+
```sql
378
+
SEARCH papers SIMILAR TO 'neural networks'LIMIT3GROUP BY author GROUP_SIZE 2
379
+
```
380
+
381
+
Grouped search with a payload filter:
382
+
```sql
383
+
SEARCH articles SIMILAR TO 'deep learning'LIMIT5WHERE year >=2022GROUP BY category GROUP_SIZE 4
384
+
```
385
+
386
+
Grouped hybrid search:
387
+
```sql
388
+
SEARCH articles SIMILAR TO 'vector databases'LIMIT4 USING HYBRID GROUP BY category GROUP_SIZE 3
0 commit comments