From 520430a1c5d7dcc30943aa281fde46117787008e Mon Sep 17 00:00:00 2001 From: Andrey Vasnetsov Date: Tue, 13 Aug 2024 13:46:16 +0200 Subject: [PATCH] add uuid index mentions (#1082) --- .../documentation/concepts/filtering.md | 45 +++++++++++++++++++ .../documentation/concepts/indexing.md | 2 + .../content/documentation/concepts/payload.md | 23 ++++++++++ 3 files changed, 70 insertions(+) diff --git a/qdrant-landing/content/documentation/concepts/filtering.md b/qdrant-landing/content/documentation/concepts/filtering.md index d93aa3dd1..ade70c526 100644 --- a/qdrant-landing/content/documentation/concepts/filtering.md +++ b/qdrant-landing/content/documentation/concepts/filtering.md @@ -1822,6 +1822,51 @@ Conditions.DatetimeRange( ); ``` + +### UUID Match + +_Available as of v1.11.0_ + +Matching of UUID values works similarly to the regular `match` condition for strings. +Functionally, it will work with `keyword` and `uuid` indexes exactly the same, but `uuid` index is more memory efficient. + +```json +{ + "key": "uuid", + "match": { + "uuid": "f47ac10b-58cc-4372-a567-0e02b2c3d479" + } +} +``` + +```python +models.FieldCondition( + key="uuid", + match=models.MatchValue(uuid="f47ac10b-58cc-4372-a567-0e02b2c3d479"), +) +``` + +```typescript +{ + key: 'uuid', + match: {uuid: 'f47ac10b-58cc-4372-a567-0e02b2c3d479'} +} +``` + +```rust +Condition::matches("uuid", "f47ac10b-58cc-4372-a567-0e02b2c3d479".to_string()) +``` + +```java +matchKeyword("uuid", "f47ac10b-58cc-4372-a567-0e02b2c3d479"); +``` + +```csharp +using static Qdrant.Client.Grpc.Conditions; + +MatchKeyword("uuid", "f47ac10b-58cc-4372-a567-0e02b2c3d479"); +``` + ### Geo #### Geo Bounding Box diff --git a/qdrant-landing/content/documentation/concepts/indexing.md b/qdrant-landing/content/documentation/concepts/indexing.md index f1b6a1f35..14f5ea658 100644 --- a/qdrant-landing/content/documentation/concepts/indexing.md +++ b/qdrant-landing/content/documentation/concepts/indexing.md @@ -111,6 +111,8 @@ Available field types are: * `geo` - for [geo](../payload/#geo) payload, affects [Geo Bounding Box](../filtering/#geo-bounding-box) and [Geo Radius](../filtering/#geo-radius) filtering conditions. * `datetime` - for [datetime](../payload/#datetime) payload, affects [Range](../filtering/#range) filtering conditions (available as of v1.8.0). * `text` - a special kind of index, available for [keyword](../payload/#keyword) / string payloads, affects [Full Text search](../filtering/#full-text-match) filtering conditions. +* `uuid` - a special type of index, similar to `keyword`, but optimized for [UUID values](../payload/#uuid). +Affects [Match](../filtering/#match) filtering conditions. (available as of v1.11.0) Payload index may occupy some additional memory, so it is recommended to only use index for those fields that are used in filtering conditions. If you need to filter by many fields and the memory limits does not allow to index all of them, it is recommended to choose the field that limits the search result the most. diff --git a/qdrant-landing/content/documentation/concepts/payload.md b/qdrant-landing/content/documentation/concepts/payload.md index a0014aff8..929dcd9ab 100644 --- a/qdrant-landing/content/documentation/concepts/payload.md +++ b/qdrant-landing/content/documentation/concepts/payload.md @@ -173,6 +173,29 @@ Notes about the format: [RFC 3339]: https://datatracker.ietf.org/doc/html/rfc3339#section-5.6 +### UUID + +*Available as of v1.11.0* + +In addition to the basic `keyword` type, Qdrant supports `uuid` type for storing UUID values. +Functionally, it works the same as `keyword`, internally stores parsed UUID values. + +```json +{ + "uuid": "550e8400-e29b-41d4-a716-446655440000", + "uuids": [ + "550e8400-e29b-41d4-a716-446655440000", + "550e8400-e29b-41d4-a716-446655440001" + ] +} +``` + +String representation of UUID (e.g. `550e8400-e29b-41d4-a716-446655440000`) occupies 36 bytes. +But when numeric representation is used, it is only 128 bits (16 bytes). + +Usage of `uuid` index type is recommended in payload-heavy collections to save RAM and improve search performance. + + ## Create point with payload REST API ([Schema](https://api.qdrant.tech/api-reference/points/upsert-points))