add uuid index mentions (#1082)

This commit is contained in:
Andrey Vasnetsov
2024-08-13 13:46:16 +02:00
committed by GitHub
parent 250ab6dfa8
commit 520430a1c5
3 changed files with 70 additions and 0 deletions
@@ -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
#### Geo Bounding Box #### Geo Bounding Box
@@ -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. * `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). * `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. * `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. 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. 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.
@@ -173,6 +173,29 @@ Notes about the format:
[RFC 3339]: https://datatracker.ietf.org/doc/html/rfc3339#section-5.6 [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 ## Create point with payload
REST API ([Schema](https://api.qdrant.tech/api-reference/points/upsert-points)) REST API ([Schema](https://api.qdrant.tech/api-reference/points/upsert-points))