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
Enhance collection and index creation with HNSW support and advanced options
- Added HNSW clause with payload_m parameter for collection creation.
- Updated CREATE INDEX to support advanced options for keyword, uuid, and text types.
- Enhanced error handling for unknown HNSW parameters and validation for payload_m.
- Updated documentation to reflect new features and usage examples.
- Added tests for HNSW and advanced index options.
When `USING MODEL` is omitted, the collection uses the **default embedding model's dimensions** (384 for `all-MiniLM-L6-v2`). If the collection already exists, the command succeeds with a message and does nothing.
123
129
130
+
### HNSW clause
131
+
132
+
QQL currently supports one explicit HNSW knob during collection creation:
133
+
134
+
-`payload_m` — enables payload-aware HNSW connectivity used by Qdrant for filtered / tenant-aware workloads
135
+
136
+
Example:
137
+
138
+
```sql
139
+
CREATE COLLECTION tenant_docs USING HYBRID HNSW {payload_m: 16}
140
+
```
141
+
124
142
---
125
143
126
144
## Quantization — QUANTIZE clause
@@ -239,6 +257,7 @@ Creates a payload index on a collection field. Payload indexes speed up `WHERE`
239
257
**Syntax:**
240
258
```
241
259
CREATE INDEX ON COLLECTION <collection_name> FOR <field_name> TYPE <schema_type>
260
+
CREATE INDEX ON COLLECTION <collection_name> FOR <field_name> TYPE <schema_type> WITH { ... }
242
261
```
243
262
244
263
**Supported schema types:**
@@ -252,19 +271,41 @@ CREATE INDEX ON COLLECTION <collection_name> FOR <field_name> TYPE <schema_type>
CREATEINDEXON COLLECTION articles FOR category TYPE keyword
280
+
CREATEINDEXON COLLECTION articles FOR tenant_id TYPE keyword WITH {is_tenant: true, on_disk: true, enable_hnsw: true}
260
281
CREATEINDEXON COLLECTION articles FOR year TYPE integer
282
+
CREATEINDEXON COLLECTION articles FOR doc_id TYPE uuid
261
283
CREATEINDEXON COLLECTION articles FOR title TYPE text
284
+
CREATEINDEXON COLLECTION articles FOR title TYPE text WITH {tokenizer: 'word', min_token_len: 2, max_token_len: 20, lowercase: true, phrase_matching: true}
262
285
CREATEINDEXON COLLECTION articles FOR meta.author TYPE keyword
|`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
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`|
194
194
|`Qdrant error during SCROLL: ...`| Qdrant rejected scroll request | Verify collection state, filter, and cursor (`AFTER`) value |
195
-
|`Unknown index type '...'`| Invalid schema type in CREATE INDEX | Use one of: `keyword`, `integer`, `float`, `bool`, `text`, `geo`, `datetime`|
195
+
|`Unknown index type '...'`| Invalid schema type in CREATE INDEX | Use one of: `keyword`, `integer`, `float`, `bool`, `text`, `geo`, `datetime`, `uuid`|
196
+
|`Unknown CREATE INDEX option '...'`| Unsupported advanced option for the chosen payload index type | Check which `WITH { ... }` keys are supported for `keyword`, `uuid`, or `text`|
196
197
|`Qdrant error during CREATE INDEX: ...`| Qdrant rejected the index creation | Check field name and collection state |
0 commit comments