mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-11 05:48:31 +02:00
Shortcode for rendering code snippets from separate markdown files (#1548)
* shortcode for rendering code snippets from separate markdown files * formatted code * fix and readme * semi-automatically extracts snippets from markdown * extract snippets from points.md * extract snippets from vectors.md * extract snippets from payload.md * extract snippets from search.md + fixes * extract snippets from explore.md * extract snippets from hybrid-queries.md + mode query by id into search * extract snippets from filtering.md * extract snippets from storage.md + update outdated info * extract snippets from indexing.md * extract snippets from snapshots.md * extract snippets from guides/optimize.md * extract snippets from guides/multiple-partitions.md + fix aside note * extract snippets from guides/quantization.md * use auto-generated descriptions * order json snippets first --------- Co-authored-by: generall <andrey@vasnetsov.com>
This commit is contained in:
+1
@@ -0,0 +1 @@
|
||||
Creates a payload index for a specified collection and field name with a keyword type that is stored on disk. Storing the payload index on disk allows for efficient access to payload values during search, especially for cases where the payload indexes are large or rarely used. However, it's important to note that storing payload indexes on disk may impact the latency of cold requests due to additional disk I/O operations.
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
```csharp
|
||||
using Qdrant.Client;
|
||||
using Qdrant.Client.Grpc;
|
||||
|
||||
var client = new QdrantClient("localhost", 6334);
|
||||
|
||||
await client.CreatePayloadIndexAsync(
|
||||
collectionName: "{collection_name}",
|
||||
fieldName: "payload_field_name",
|
||||
schemaType: PayloadSchemaType.Keyword,
|
||||
indexParams: new PayloadIndexParams
|
||||
{
|
||||
KeywordIndexParams = new KeywordIndexParams
|
||||
{
|
||||
OnDisk = true
|
||||
}
|
||||
}
|
||||
);
|
||||
```
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
```go
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/qdrant/go-client/qdrant"
|
||||
)
|
||||
|
||||
client, err := qdrant.NewClient(&qdrant.Config{
|
||||
Host: "localhost",
|
||||
Port: 6334,
|
||||
})
|
||||
|
||||
client.CreateFieldIndex(context.Background(), &qdrant.CreateFieldIndexCollection{
|
||||
CollectionName: "{collection_name}",
|
||||
FieldName: "name_of_the_field_to_index",
|
||||
FieldType: qdrant.FieldType_FieldTypeKeyword.Enum(),
|
||||
FieldIndexParams: qdrant.NewPayloadIndexParamsKeyword(
|
||||
&qdrant.KeywordIndexParams{
|
||||
OnDisk: qdrant.PtrOf(true),
|
||||
}),
|
||||
})
|
||||
```
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
```http
|
||||
PUT /collections/{collection_name}/index
|
||||
{
|
||||
"field_name": "payload_field_name",
|
||||
"field_schema": {
|
||||
"type": "keyword",
|
||||
"on_disk": true
|
||||
}
|
||||
}
|
||||
```
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
```java
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Collections.PayloadIndexParams;
|
||||
import io.qdrant.client.grpc.Collections.PayloadSchemaType;
|
||||
import io.qdrant.client.grpc.Collections.KeywordIndexParams;
|
||||
|
||||
QdrantClient client =
|
||||
new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build());
|
||||
|
||||
client
|
||||
.createPayloadIndexAsync(
|
||||
"{collection_name}",
|
||||
"payload_field_name",
|
||||
PayloadSchemaType.Keyword,
|
||||
PayloadIndexParams.newBuilder()
|
||||
.setKeywordIndexParams(
|
||||
KeywordIndexParams.newBuilder()
|
||||
.setOnDisk(true)
|
||||
.build())
|
||||
.build(),
|
||||
null,
|
||||
null,
|
||||
null)
|
||||
.get();
|
||||
```
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
```python
|
||||
client.create_payload_index(
|
||||
collection_name="{collection_name}",
|
||||
field_name="payload_field_name",
|
||||
field_schema=models.KeywordIndexParams(
|
||||
type=models.KeywordIndexType.KEYWORD,
|
||||
on_disk=True,
|
||||
),
|
||||
)
|
||||
```
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
```rust
|
||||
use qdrant_client::qdrant::{
|
||||
CreateFieldIndexCollectionBuilder,
|
||||
KeywordIndexParamsBuilder,
|
||||
FieldType
|
||||
};
|
||||
use qdrant_client::{Qdrant, QdrantError};
|
||||
|
||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
|
||||
client.create_field_index(
|
||||
CreateFieldIndexCollectionBuilder::new(
|
||||
"{collection_name}",
|
||||
"payload_field_name",
|
||||
FieldType::Keyword,
|
||||
)
|
||||
.field_index_params(
|
||||
KeywordIndexParamsBuilder::default()
|
||||
.on_disk(true),
|
||||
),
|
||||
);
|
||||
```
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
```typescript
|
||||
client.createPayloadIndex("{collection_name}", {
|
||||
field_name: "payload_field_name",
|
||||
field_schema: {
|
||||
type: "keyword",
|
||||
on_disk: true
|
||||
},
|
||||
});
|
||||
```
|
||||
Reference in New Issue
Block a user