mirror of
https://github.com/qdrant/landing_page.git
synced 2026-09-26 14:38:30 +02:00
Document new strict_mode_config parameters (v1.18.0) (#2303)
* Document 7 missing strict_mode_config parameters Adds documentation sections and code snippets (Python, TypeScript, Rust, Go, Java, C#, HTTP, bash) for search_allow_exact, search_max_hnsw_ef, search_max_oversampling, search_max_batchsize, max_resident_memory_percent, multivector_config, and sparse_config. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Use title case for all headers * Update qdrant-landing/content/documentation/ops-configuration/administration.md Co-authored-by: Tim Visée <tim@visee.me> * Mention default strict mode on Cloud; Clarify behavior of only setting enabled=true * Apply suggestion from @timvisee Co-authored-by: Tim Visée <tim@visee.me> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Tim Visée <tim@visee.me>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
Tim Visée
parent
dc7d66545e
commit
ecd4887576
+1
@@ -0,0 +1 @@
|
||||
This code snippet sets `max_resident_memory_percent` on the strict mode configuration to reject memory-consuming write operations when resident memory exceeds the given percentage of total system memory.
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
curl -X PUT http://localhost:6333/collections/{collection_name} \
|
||||
-H 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"strict_mode_config": {
|
||||
"enabled": true,
|
||||
"max_resident_memory_percent": 90
|
||||
}
|
||||
}'
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
using Qdrant.Client;
|
||||
using Qdrant.Client.Grpc;
|
||||
|
||||
public class Snippet
|
||||
{
|
||||
public static async Task Run()
|
||||
{
|
||||
var client = new QdrantClient("localhost", 6334);
|
||||
|
||||
await client.CreateCollectionAsync(
|
||||
collectionName: "{collection_name}",
|
||||
strictModeConfig: new StrictModeConfig { Enabled = true, MaxResidentMemoryPercent = 90 }
|
||||
);
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
```bash
|
||||
curl -X PUT http://localhost:6333/collections/{collection_name} \
|
||||
-H 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"strict_mode_config": {
|
||||
"enabled": true,
|
||||
"max_resident_memory_percent": 90
|
||||
}
|
||||
}'
|
||||
```
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
```csharp
|
||||
using Qdrant.Client;
|
||||
using Qdrant.Client.Grpc;
|
||||
|
||||
var client = new QdrantClient("localhost", 6334);
|
||||
|
||||
await client.CreateCollectionAsync(
|
||||
collectionName: "{collection_name}",
|
||||
strictModeConfig: new StrictModeConfig { Enabled = true, MaxResidentMemoryPercent = 90 }
|
||||
);
|
||||
```
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
```go
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/qdrant/go-client/qdrant"
|
||||
)
|
||||
|
||||
client, err := qdrant.NewClient(&qdrant.Config{
|
||||
Host: "localhost",
|
||||
Port: 6334,
|
||||
})
|
||||
|
||||
client.CreateCollection(context.Background(), &qdrant.CreateCollection{
|
||||
CollectionName: "{collection_name}",
|
||||
StrictModeConfig: &qdrant.StrictModeConfig{
|
||||
Enabled: qdrant.PtrOf(true),
|
||||
MaxResidentMemoryPercent: qdrant.PtrOf(uint32(90)),
|
||||
},
|
||||
})
|
||||
```
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
```java
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Collections.CreateCollection;
|
||||
import io.qdrant.client.grpc.Collections.StrictModeConfig;
|
||||
|
||||
QdrantClient client =
|
||||
new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build());
|
||||
|
||||
client
|
||||
.createCollectionAsync(
|
||||
CreateCollection.newBuilder()
|
||||
.setCollectionName("{collection_name}")
|
||||
.setStrictModeConfig(
|
||||
StrictModeConfig.newBuilder().setEnabled(true).setMaxResidentMemoryPercent(90).build())
|
||||
.build())
|
||||
.get();
|
||||
```
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
```python
|
||||
from qdrant_client import QdrantClient, models
|
||||
|
||||
client = QdrantClient(url="http://localhost:6333")
|
||||
|
||||
client.create_collection(
|
||||
collection_name="{collection_name}",
|
||||
strict_mode_config=models.StrictModeConfig(enabled=True, max_resident_memory_percent=90),
|
||||
)
|
||||
```
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
```rust
|
||||
use qdrant_client::Qdrant;
|
||||
use qdrant_client::qdrant::{CreateCollectionBuilder, StrictModeConfigBuilder};
|
||||
|
||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
|
||||
client
|
||||
.create_collection(
|
||||
CreateCollectionBuilder::new("{collection_name}")
|
||||
.strict_mode_config(StrictModeConfigBuilder::default().enabled(true).max_resident_memory_percent(90u32)),
|
||||
)
|
||||
.await?;
|
||||
```
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
```typescript
|
||||
import { QdrantClient } from "@qdrant/js-client-rest";
|
||||
|
||||
const client = new QdrantClient({ host: "localhost", port: 6333 });
|
||||
|
||||
client.createCollection("{collection_name}", {
|
||||
strict_mode_config: {
|
||||
enabled: true,
|
||||
max_resident_memory_percent: 90,
|
||||
},
|
||||
});
|
||||
```
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package snippet
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/qdrant/go-client/qdrant"
|
||||
)
|
||||
|
||||
func Main() {
|
||||
client, err := qdrant.NewClient(&qdrant.Config{
|
||||
Host: "localhost",
|
||||
Port: 6334,
|
||||
})
|
||||
|
||||
if err != nil { panic(err) } // @hide
|
||||
|
||||
client.CreateCollection(context.Background(), &qdrant.CreateCollection{
|
||||
CollectionName: "{collection_name}",
|
||||
StrictModeConfig: &qdrant.StrictModeConfig{
|
||||
Enabled: qdrant.PtrOf(true),
|
||||
MaxResidentMemoryPercent: qdrant.PtrOf(uint32(90)),
|
||||
},
|
||||
})
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
```http
|
||||
PUT /collections/{collection_name}
|
||||
{
|
||||
"strict_mode_config": {
|
||||
"enabled": true,
|
||||
"max_resident_memory_percent": 90
|
||||
}
|
||||
}
|
||||
```
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.example.snippets_amalgamation;
|
||||
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Collections.CreateCollection;
|
||||
import io.qdrant.client.grpc.Collections.StrictModeConfig;
|
||||
|
||||
public class Snippet {
|
||||
public static void run() throws Exception {
|
||||
QdrantClient client =
|
||||
new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build());
|
||||
|
||||
client
|
||||
.createCollectionAsync(
|
||||
CreateCollection.newBuilder()
|
||||
.setCollectionName("{collection_name}")
|
||||
.setStrictModeConfig(
|
||||
StrictModeConfig.newBuilder().setEnabled(true).setMaxResidentMemoryPercent(90).build())
|
||||
.build())
|
||||
.get();
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
from qdrant_client import QdrantClient, models
|
||||
|
||||
client = QdrantClient(url="http://localhost:6333")
|
||||
|
||||
client.create_collection(
|
||||
collection_name="{collection_name}",
|
||||
strict_mode_config=models.StrictModeConfig(enabled=True, max_resident_memory_percent=90),
|
||||
)
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
use qdrant_client::Qdrant;
|
||||
use qdrant_client::qdrant::{CreateCollectionBuilder, StrictModeConfigBuilder};
|
||||
|
||||
pub async fn main() -> anyhow::Result<()> {
|
||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
|
||||
client
|
||||
.create_collection(
|
||||
CreateCollectionBuilder::new("{collection_name}")
|
||||
.strict_mode_config(StrictModeConfigBuilder::default().enabled(true).max_resident_memory_percent(90u32)),
|
||||
)
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
import { QdrantClient } from "@qdrant/js-client-rest";
|
||||
|
||||
const client = new QdrantClient({ host: "localhost", port: 6333 });
|
||||
|
||||
client.createCollection("{collection_name}", {
|
||||
strict_mode_config: {
|
||||
enabled: true,
|
||||
max_resident_memory_percent: 90,
|
||||
},
|
||||
});
|
||||
+1
@@ -0,0 +1 @@
|
||||
This code snippet sets `multivector_config` on the strict mode configuration to cap the maximum number of vectors per multivector for a named vector.
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
curl -X PUT http://localhost:6333/collections/{collection_name} \
|
||||
-H 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"strict_mode_config": {
|
||||
"enabled": true,
|
||||
"multivector_config": {
|
||||
"{vector_name}": {
|
||||
"max_vectors": 10
|
||||
}
|
||||
}
|
||||
}
|
||||
}'
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
using Qdrant.Client;
|
||||
using Qdrant.Client.Grpc;
|
||||
|
||||
public class Snippet
|
||||
{
|
||||
public static async Task Run()
|
||||
{
|
||||
var client = new QdrantClient("localhost", 6334);
|
||||
|
||||
await client.CreateCollectionAsync(
|
||||
collectionName: "{collection_name}",
|
||||
strictModeConfig: new StrictModeConfig
|
||||
{
|
||||
Enabled = true,
|
||||
MultivectorConfig = new StrictModeMultivectorConfig
|
||||
{
|
||||
MultivectorConfig = { ["{vector_name}"] = new StrictModeMultivector { MaxVectors = 10 } }
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
```bash
|
||||
curl -X PUT http://localhost:6333/collections/{collection_name} \
|
||||
-H 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"strict_mode_config": {
|
||||
"enabled": true,
|
||||
"multivector_config": {
|
||||
"{vector_name}": {
|
||||
"max_vectors": 10
|
||||
}
|
||||
}
|
||||
}
|
||||
}'
|
||||
```
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
```csharp
|
||||
using Qdrant.Client;
|
||||
using Qdrant.Client.Grpc;
|
||||
|
||||
var client = new QdrantClient("localhost", 6334);
|
||||
|
||||
await client.CreateCollectionAsync(
|
||||
collectionName: "{collection_name}",
|
||||
strictModeConfig: new StrictModeConfig
|
||||
{
|
||||
Enabled = true,
|
||||
MultivectorConfig = new StrictModeMultivectorConfig
|
||||
{
|
||||
MultivectorConfig = { ["{vector_name}"] = new StrictModeMultivector { MaxVectors = 10 } }
|
||||
}
|
||||
}
|
||||
);
|
||||
```
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
```go
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/qdrant/go-client/qdrant"
|
||||
)
|
||||
|
||||
client, err := qdrant.NewClient(&qdrant.Config{
|
||||
Host: "localhost",
|
||||
Port: 6334,
|
||||
})
|
||||
|
||||
client.CreateCollection(context.Background(), &qdrant.CreateCollection{
|
||||
CollectionName: "{collection_name}",
|
||||
StrictModeConfig: &qdrant.StrictModeConfig{
|
||||
Enabled: qdrant.PtrOf(true),
|
||||
MultivectorConfig: &qdrant.StrictModeMultivectorConfig{
|
||||
MultivectorConfig: map[string]*qdrant.StrictModeMultivector{
|
||||
"{vector_name}": {MaxVectors: qdrant.PtrOf(uint64(10))},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
```
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
```java
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Collections.CreateCollection;
|
||||
import io.qdrant.client.grpc.Collections.StrictModeConfig;
|
||||
import io.qdrant.client.grpc.Collections.StrictModeMultivector;
|
||||
import io.qdrant.client.grpc.Collections.StrictModeMultivectorConfig;
|
||||
|
||||
QdrantClient client =
|
||||
new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build());
|
||||
|
||||
client
|
||||
.createCollectionAsync(
|
||||
CreateCollection.newBuilder()
|
||||
.setCollectionName("{collection_name}")
|
||||
.setStrictModeConfig(
|
||||
StrictModeConfig.newBuilder()
|
||||
.setEnabled(true)
|
||||
.setMultivectorConfig(
|
||||
StrictModeMultivectorConfig.newBuilder()
|
||||
.putMultivectorConfig("{vector_name}", StrictModeMultivector.newBuilder().setMaxVectors(10).build())
|
||||
.build())
|
||||
.build())
|
||||
.build())
|
||||
.get();
|
||||
```
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
```python
|
||||
from qdrant_client import QdrantClient, models
|
||||
|
||||
client = QdrantClient(url="http://localhost:6333")
|
||||
|
||||
client.create_collection(
|
||||
collection_name="{collection_name}",
|
||||
strict_mode_config=models.StrictModeConfig(
|
||||
enabled=True,
|
||||
multivector_config={"{vector_name}": models.StrictModeMultivector(max_vectors=10)},
|
||||
),
|
||||
)
|
||||
```
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
```rust
|
||||
use std::collections::HashMap;
|
||||
|
||||
use qdrant_client::Qdrant;
|
||||
use qdrant_client::qdrant::{
|
||||
CreateCollectionBuilder, StrictModeConfigBuilder, StrictModeMultivector,
|
||||
StrictModeMultivectorConfig,
|
||||
};
|
||||
|
||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
|
||||
client
|
||||
.create_collection(
|
||||
CreateCollectionBuilder::new("{collection_name}").strict_mode_config(
|
||||
StrictModeConfigBuilder::default()
|
||||
.enabled(true)
|
||||
.multivector_config(StrictModeMultivectorConfig {
|
||||
multivector_config: HashMap::from([(
|
||||
"{vector_name}".to_string(),
|
||||
StrictModeMultivector {
|
||||
max_vectors: Some(10),
|
||||
},
|
||||
)]),
|
||||
}),
|
||||
),
|
||||
)
|
||||
.await?;
|
||||
```
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
```typescript
|
||||
import { QdrantClient } from "@qdrant/js-client-rest";
|
||||
|
||||
const client = new QdrantClient({ host: "localhost", port: 6333 });
|
||||
|
||||
client.createCollection("{collection_name}", {
|
||||
strict_mode_config: {
|
||||
enabled: true,
|
||||
multivector_config: {
|
||||
"{vector_name}": {
|
||||
max_vectors: 10,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
```
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package snippet
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/qdrant/go-client/qdrant"
|
||||
)
|
||||
|
||||
func Main() {
|
||||
client, err := qdrant.NewClient(&qdrant.Config{
|
||||
Host: "localhost",
|
||||
Port: 6334,
|
||||
})
|
||||
|
||||
if err != nil { panic(err) } // @hide
|
||||
|
||||
client.CreateCollection(context.Background(), &qdrant.CreateCollection{
|
||||
CollectionName: "{collection_name}",
|
||||
StrictModeConfig: &qdrant.StrictModeConfig{
|
||||
Enabled: qdrant.PtrOf(true),
|
||||
MultivectorConfig: &qdrant.StrictModeMultivectorConfig{
|
||||
MultivectorConfig: map[string]*qdrant.StrictModeMultivector{
|
||||
"{vector_name}": {MaxVectors: qdrant.PtrOf(uint64(10))},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
```http
|
||||
PUT /collections/{collection_name}
|
||||
{
|
||||
"strict_mode_config": {
|
||||
"enabled": true,
|
||||
"multivector_config": {
|
||||
"{vector_name}": {
|
||||
"max_vectors": 10
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.example.snippets_amalgamation;
|
||||
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Collections.CreateCollection;
|
||||
import io.qdrant.client.grpc.Collections.StrictModeConfig;
|
||||
import io.qdrant.client.grpc.Collections.StrictModeMultivector;
|
||||
import io.qdrant.client.grpc.Collections.StrictModeMultivectorConfig;
|
||||
|
||||
public class Snippet {
|
||||
public static void run() throws Exception {
|
||||
QdrantClient client =
|
||||
new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build());
|
||||
|
||||
client
|
||||
.createCollectionAsync(
|
||||
CreateCollection.newBuilder()
|
||||
.setCollectionName("{collection_name}")
|
||||
.setStrictModeConfig(
|
||||
StrictModeConfig.newBuilder()
|
||||
.setEnabled(true)
|
||||
.setMultivectorConfig(
|
||||
StrictModeMultivectorConfig.newBuilder()
|
||||
.putMultivectorConfig("{vector_name}", StrictModeMultivector.newBuilder().setMaxVectors(10).build())
|
||||
.build())
|
||||
.build())
|
||||
.build())
|
||||
.get();
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
from qdrant_client import QdrantClient, models
|
||||
|
||||
client = QdrantClient(url="http://localhost:6333")
|
||||
|
||||
client.create_collection(
|
||||
collection_name="{collection_name}",
|
||||
strict_mode_config=models.StrictModeConfig(
|
||||
enabled=True,
|
||||
multivector_config={"{vector_name}": models.StrictModeMultivector(max_vectors=10)},
|
||||
),
|
||||
)
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use qdrant_client::Qdrant;
|
||||
use qdrant_client::qdrant::{
|
||||
CreateCollectionBuilder, StrictModeConfigBuilder, StrictModeMultivector,
|
||||
StrictModeMultivectorConfig,
|
||||
};
|
||||
|
||||
pub async fn main() -> anyhow::Result<()> {
|
||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
|
||||
client
|
||||
.create_collection(
|
||||
CreateCollectionBuilder::new("{collection_name}").strict_mode_config(
|
||||
StrictModeConfigBuilder::default()
|
||||
.enabled(true)
|
||||
.multivector_config(StrictModeMultivectorConfig {
|
||||
multivector_config: HashMap::from([(
|
||||
"{vector_name}".to_string(),
|
||||
StrictModeMultivector {
|
||||
max_vectors: Some(10),
|
||||
},
|
||||
)]),
|
||||
}),
|
||||
),
|
||||
)
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
import { QdrantClient } from "@qdrant/js-client-rest";
|
||||
|
||||
const client = new QdrantClient({ host: "localhost", port: 6333 });
|
||||
|
||||
client.createCollection("{collection_name}", {
|
||||
strict_mode_config: {
|
||||
enabled: true,
|
||||
multivector_config: {
|
||||
"{vector_name}": {
|
||||
max_vectors: 10,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
+1
@@ -0,0 +1 @@
|
||||
This code snippet sets `search_allow_exact` to false on the strict mode configuration to prevent exact (brute-force) search, which can be very slow on large collections.
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
curl -X PUT http://localhost:6333/collections/{collection_name} \
|
||||
-H 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"strict_mode_config": {
|
||||
"enabled": true,
|
||||
"search_allow_exact": false
|
||||
}
|
||||
}'
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
using Qdrant.Client;
|
||||
using Qdrant.Client.Grpc;
|
||||
|
||||
public class Snippet
|
||||
{
|
||||
public static async Task Run()
|
||||
{
|
||||
var client = new QdrantClient("localhost", 6334);
|
||||
|
||||
await client.CreateCollectionAsync(
|
||||
collectionName: "{collection_name}",
|
||||
strictModeConfig: new StrictModeConfig { Enabled = true, SearchAllowExact = false }
|
||||
);
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
```bash
|
||||
curl -X PUT http://localhost:6333/collections/{collection_name} \
|
||||
-H 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"strict_mode_config": {
|
||||
"enabled": true,
|
||||
"search_allow_exact": false
|
||||
}
|
||||
}'
|
||||
```
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
```csharp
|
||||
using Qdrant.Client;
|
||||
using Qdrant.Client.Grpc;
|
||||
|
||||
var client = new QdrantClient("localhost", 6334);
|
||||
|
||||
await client.CreateCollectionAsync(
|
||||
collectionName: "{collection_name}",
|
||||
strictModeConfig: new StrictModeConfig { Enabled = true, SearchAllowExact = false }
|
||||
);
|
||||
```
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
```go
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/qdrant/go-client/qdrant"
|
||||
)
|
||||
|
||||
client, err := qdrant.NewClient(&qdrant.Config{
|
||||
Host: "localhost",
|
||||
Port: 6334,
|
||||
})
|
||||
|
||||
client.CreateCollection(context.Background(), &qdrant.CreateCollection{
|
||||
CollectionName: "{collection_name}",
|
||||
StrictModeConfig: &qdrant.StrictModeConfig{
|
||||
Enabled: qdrant.PtrOf(true),
|
||||
SearchAllowExact: qdrant.PtrOf(false),
|
||||
},
|
||||
})
|
||||
```
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
```java
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Collections.CreateCollection;
|
||||
import io.qdrant.client.grpc.Collections.StrictModeConfig;
|
||||
|
||||
QdrantClient client =
|
||||
new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build());
|
||||
|
||||
client
|
||||
.createCollectionAsync(
|
||||
CreateCollection.newBuilder()
|
||||
.setCollectionName("{collection_name}")
|
||||
.setStrictModeConfig(
|
||||
StrictModeConfig.newBuilder().setEnabled(true).setSearchAllowExact(false).build())
|
||||
.build())
|
||||
.get();
|
||||
```
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
```python
|
||||
from qdrant_client import QdrantClient, models
|
||||
|
||||
client = QdrantClient(url="http://localhost:6333")
|
||||
|
||||
client.create_collection(
|
||||
collection_name="{collection_name}",
|
||||
strict_mode_config=models.StrictModeConfig(enabled=True, search_allow_exact=False),
|
||||
)
|
||||
```
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
```rust
|
||||
use qdrant_client::Qdrant;
|
||||
use qdrant_client::qdrant::{CreateCollectionBuilder, StrictModeConfigBuilder};
|
||||
|
||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
|
||||
client
|
||||
.create_collection(
|
||||
CreateCollectionBuilder::new("{collection_name}")
|
||||
.strict_mode_config(StrictModeConfigBuilder::default().enabled(true).search_allow_exact(false)),
|
||||
)
|
||||
.await?;
|
||||
```
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
```typescript
|
||||
import { QdrantClient } from "@qdrant/js-client-rest";
|
||||
|
||||
const client = new QdrantClient({ host: "localhost", port: 6333 });
|
||||
|
||||
client.createCollection("{collection_name}", {
|
||||
strict_mode_config: {
|
||||
enabled: true,
|
||||
search_allow_exact: false,
|
||||
},
|
||||
});
|
||||
```
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package snippet
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/qdrant/go-client/qdrant"
|
||||
)
|
||||
|
||||
func Main() {
|
||||
client, err := qdrant.NewClient(&qdrant.Config{
|
||||
Host: "localhost",
|
||||
Port: 6334,
|
||||
})
|
||||
|
||||
if err != nil { panic(err) } // @hide
|
||||
|
||||
client.CreateCollection(context.Background(), &qdrant.CreateCollection{
|
||||
CollectionName: "{collection_name}",
|
||||
StrictModeConfig: &qdrant.StrictModeConfig{
|
||||
Enabled: qdrant.PtrOf(true),
|
||||
SearchAllowExact: qdrant.PtrOf(false),
|
||||
},
|
||||
})
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
```http
|
||||
PUT /collections/{collection_name}
|
||||
{
|
||||
"strict_mode_config": {
|
||||
"enabled": true,
|
||||
"search_allow_exact": false
|
||||
}
|
||||
}
|
||||
```
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.example.snippets_amalgamation;
|
||||
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Collections.CreateCollection;
|
||||
import io.qdrant.client.grpc.Collections.StrictModeConfig;
|
||||
|
||||
public class Snippet {
|
||||
public static void run() throws Exception {
|
||||
QdrantClient client =
|
||||
new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build());
|
||||
|
||||
client
|
||||
.createCollectionAsync(
|
||||
CreateCollection.newBuilder()
|
||||
.setCollectionName("{collection_name}")
|
||||
.setStrictModeConfig(
|
||||
StrictModeConfig.newBuilder().setEnabled(true).setSearchAllowExact(false).build())
|
||||
.build())
|
||||
.get();
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
from qdrant_client import QdrantClient, models
|
||||
|
||||
client = QdrantClient(url="http://localhost:6333")
|
||||
|
||||
client.create_collection(
|
||||
collection_name="{collection_name}",
|
||||
strict_mode_config=models.StrictModeConfig(enabled=True, search_allow_exact=False),
|
||||
)
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
use qdrant_client::Qdrant;
|
||||
use qdrant_client::qdrant::{CreateCollectionBuilder, StrictModeConfigBuilder};
|
||||
|
||||
pub async fn main() -> anyhow::Result<()> {
|
||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
|
||||
client
|
||||
.create_collection(
|
||||
CreateCollectionBuilder::new("{collection_name}")
|
||||
.strict_mode_config(StrictModeConfigBuilder::default().enabled(true).search_allow_exact(false)),
|
||||
)
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
import { QdrantClient } from "@qdrant/js-client-rest";
|
||||
|
||||
const client = new QdrantClient({ host: "localhost", port: 6333 });
|
||||
|
||||
client.createCollection("{collection_name}", {
|
||||
strict_mode_config: {
|
||||
enabled: true,
|
||||
search_allow_exact: false,
|
||||
},
|
||||
});
|
||||
+1
@@ -0,0 +1 @@
|
||||
This code snippet sets `search_max_batchsize` on the strict mode configuration to cap the maximum number of searches in a single batch request.
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
curl -X PUT http://localhost:6333/collections/{collection_name} \
|
||||
-H 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"strict_mode_config": {
|
||||
"enabled": true,
|
||||
"search_max_batchsize": 1000
|
||||
}
|
||||
}'
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
using Qdrant.Client;
|
||||
using Qdrant.Client.Grpc;
|
||||
|
||||
public class Snippet
|
||||
{
|
||||
public static async Task Run()
|
||||
{
|
||||
var client = new QdrantClient("localhost", 6334);
|
||||
|
||||
await client.CreateCollectionAsync(
|
||||
collectionName: "{collection_name}",
|
||||
strictModeConfig: new StrictModeConfig { Enabled = true, SearchMaxBatchsize = 1000 }
|
||||
);
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
```bash
|
||||
curl -X PUT http://localhost:6333/collections/{collection_name} \
|
||||
-H 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"strict_mode_config": {
|
||||
"enabled": true,
|
||||
"search_max_batchsize": 1000
|
||||
}
|
||||
}'
|
||||
```
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
```csharp
|
||||
using Qdrant.Client;
|
||||
using Qdrant.Client.Grpc;
|
||||
|
||||
var client = new QdrantClient("localhost", 6334);
|
||||
|
||||
await client.CreateCollectionAsync(
|
||||
collectionName: "{collection_name}",
|
||||
strictModeConfig: new StrictModeConfig { Enabled = true, SearchMaxBatchsize = 1000 }
|
||||
);
|
||||
```
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
```go
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/qdrant/go-client/qdrant"
|
||||
)
|
||||
|
||||
client, err := qdrant.NewClient(&qdrant.Config{
|
||||
Host: "localhost",
|
||||
Port: 6334,
|
||||
})
|
||||
|
||||
client.CreateCollection(context.Background(), &qdrant.CreateCollection{
|
||||
CollectionName: "{collection_name}",
|
||||
StrictModeConfig: &qdrant.StrictModeConfig{
|
||||
Enabled: qdrant.PtrOf(true),
|
||||
SearchMaxBatchsize: qdrant.PtrOf(uint64(1000)),
|
||||
},
|
||||
})
|
||||
```
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
```java
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Collections.CreateCollection;
|
||||
import io.qdrant.client.grpc.Collections.StrictModeConfig;
|
||||
|
||||
QdrantClient client =
|
||||
new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build());
|
||||
|
||||
client
|
||||
.createCollectionAsync(
|
||||
CreateCollection.newBuilder()
|
||||
.setCollectionName("{collection_name}")
|
||||
.setStrictModeConfig(
|
||||
StrictModeConfig.newBuilder().setEnabled(true).setSearchMaxBatchsize(1000).build())
|
||||
.build())
|
||||
.get();
|
||||
```
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
```python
|
||||
from qdrant_client import QdrantClient, models
|
||||
|
||||
client = QdrantClient(url="http://localhost:6333")
|
||||
|
||||
client.create_collection(
|
||||
collection_name="{collection_name}",
|
||||
strict_mode_config=models.StrictModeConfig(enabled=True, search_max_batchsize=1000),
|
||||
)
|
||||
```
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
```rust
|
||||
use qdrant_client::Qdrant;
|
||||
use qdrant_client::qdrant::{CreateCollectionBuilder, StrictModeConfigBuilder};
|
||||
|
||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
|
||||
client
|
||||
.create_collection(
|
||||
CreateCollectionBuilder::new("{collection_name}")
|
||||
.strict_mode_config(StrictModeConfigBuilder::default().enabled(true).search_max_batchsize(1000u64)),
|
||||
)
|
||||
.await?;
|
||||
```
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
```typescript
|
||||
import { QdrantClient } from "@qdrant/js-client-rest";
|
||||
|
||||
const client = new QdrantClient({ host: "localhost", port: 6333 });
|
||||
|
||||
client.createCollection("{collection_name}", {
|
||||
strict_mode_config: {
|
||||
enabled: true,
|
||||
search_max_batchsize: 1000,
|
||||
},
|
||||
});
|
||||
```
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package snippet
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/qdrant/go-client/qdrant"
|
||||
)
|
||||
|
||||
func Main() {
|
||||
client, err := qdrant.NewClient(&qdrant.Config{
|
||||
Host: "localhost",
|
||||
Port: 6334,
|
||||
})
|
||||
|
||||
if err != nil { panic(err) } // @hide
|
||||
|
||||
client.CreateCollection(context.Background(), &qdrant.CreateCollection{
|
||||
CollectionName: "{collection_name}",
|
||||
StrictModeConfig: &qdrant.StrictModeConfig{
|
||||
Enabled: qdrant.PtrOf(true),
|
||||
SearchMaxBatchsize: qdrant.PtrOf(uint64(1000)),
|
||||
},
|
||||
})
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
```http
|
||||
PUT /collections/{collection_name}
|
||||
{
|
||||
"strict_mode_config": {
|
||||
"enabled": true,
|
||||
"search_max_batchsize": 1000
|
||||
}
|
||||
}
|
||||
```
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.example.snippets_amalgamation;
|
||||
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Collections.CreateCollection;
|
||||
import io.qdrant.client.grpc.Collections.StrictModeConfig;
|
||||
|
||||
public class Snippet {
|
||||
public static void run() throws Exception {
|
||||
QdrantClient client =
|
||||
new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build());
|
||||
|
||||
client
|
||||
.createCollectionAsync(
|
||||
CreateCollection.newBuilder()
|
||||
.setCollectionName("{collection_name}")
|
||||
.setStrictModeConfig(
|
||||
StrictModeConfig.newBuilder().setEnabled(true).setSearchMaxBatchsize(1000).build())
|
||||
.build())
|
||||
.get();
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
from qdrant_client import QdrantClient, models
|
||||
|
||||
client = QdrantClient(url="http://localhost:6333")
|
||||
|
||||
client.create_collection(
|
||||
collection_name="{collection_name}",
|
||||
strict_mode_config=models.StrictModeConfig(enabled=True, search_max_batchsize=1000),
|
||||
)
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
use qdrant_client::Qdrant;
|
||||
use qdrant_client::qdrant::{CreateCollectionBuilder, StrictModeConfigBuilder};
|
||||
|
||||
pub async fn main() -> anyhow::Result<()> {
|
||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
|
||||
client
|
||||
.create_collection(
|
||||
CreateCollectionBuilder::new("{collection_name}")
|
||||
.strict_mode_config(StrictModeConfigBuilder::default().enabled(true).search_max_batchsize(1000u64)),
|
||||
)
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
import { QdrantClient } from "@qdrant/js-client-rest";
|
||||
|
||||
const client = new QdrantClient({ host: "localhost", port: 6333 });
|
||||
|
||||
client.createCollection("{collection_name}", {
|
||||
strict_mode_config: {
|
||||
enabled: true,
|
||||
search_max_batchsize: 1000,
|
||||
},
|
||||
});
|
||||
+1
@@ -0,0 +1 @@
|
||||
This code snippet sets `search_max_hnsw_ef` on the strict mode configuration to cap the maximum HNSW ef value allowed in search parameters.
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
curl -X PUT http://localhost:6333/collections/{collection_name} \
|
||||
-H 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"strict_mode_config": {
|
||||
"enabled": true,
|
||||
"search_max_hnsw_ef": 128
|
||||
}
|
||||
}'
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
using Qdrant.Client;
|
||||
using Qdrant.Client.Grpc;
|
||||
|
||||
public class Snippet
|
||||
{
|
||||
public static async Task Run()
|
||||
{
|
||||
var client = new QdrantClient("localhost", 6334);
|
||||
|
||||
await client.CreateCollectionAsync(
|
||||
collectionName: "{collection_name}",
|
||||
strictModeConfig: new StrictModeConfig { Enabled = true, SearchMaxHnswEf = 128 }
|
||||
);
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
```bash
|
||||
curl -X PUT http://localhost:6333/collections/{collection_name} \
|
||||
-H 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"strict_mode_config": {
|
||||
"enabled": true,
|
||||
"search_max_hnsw_ef": 128
|
||||
}
|
||||
}'
|
||||
```
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
```csharp
|
||||
using Qdrant.Client;
|
||||
using Qdrant.Client.Grpc;
|
||||
|
||||
var client = new QdrantClient("localhost", 6334);
|
||||
|
||||
await client.CreateCollectionAsync(
|
||||
collectionName: "{collection_name}",
|
||||
strictModeConfig: new StrictModeConfig { Enabled = true, SearchMaxHnswEf = 128 }
|
||||
);
|
||||
```
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
```go
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/qdrant/go-client/qdrant"
|
||||
)
|
||||
|
||||
client, err := qdrant.NewClient(&qdrant.Config{
|
||||
Host: "localhost",
|
||||
Port: 6334,
|
||||
})
|
||||
|
||||
client.CreateCollection(context.Background(), &qdrant.CreateCollection{
|
||||
CollectionName: "{collection_name}",
|
||||
StrictModeConfig: &qdrant.StrictModeConfig{
|
||||
Enabled: qdrant.PtrOf(true),
|
||||
SearchMaxHnswEf: qdrant.PtrOf(uint32(128)),
|
||||
},
|
||||
})
|
||||
```
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
```java
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Collections.CreateCollection;
|
||||
import io.qdrant.client.grpc.Collections.StrictModeConfig;
|
||||
|
||||
QdrantClient client =
|
||||
new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build());
|
||||
|
||||
client
|
||||
.createCollectionAsync(
|
||||
CreateCollection.newBuilder()
|
||||
.setCollectionName("{collection_name}")
|
||||
.setStrictModeConfig(
|
||||
StrictModeConfig.newBuilder().setEnabled(true).setSearchMaxHnswEf(128).build())
|
||||
.build())
|
||||
.get();
|
||||
```
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
```python
|
||||
from qdrant_client import QdrantClient, models
|
||||
|
||||
client = QdrantClient(url="http://localhost:6333")
|
||||
|
||||
client.create_collection(
|
||||
collection_name="{collection_name}",
|
||||
strict_mode_config=models.StrictModeConfig(enabled=True, search_max_hnsw_ef=128),
|
||||
)
|
||||
```
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
```rust
|
||||
use qdrant_client::Qdrant;
|
||||
use qdrant_client::qdrant::{CreateCollectionBuilder, StrictModeConfigBuilder};
|
||||
|
||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
|
||||
client
|
||||
.create_collection(
|
||||
CreateCollectionBuilder::new("{collection_name}")
|
||||
.strict_mode_config(StrictModeConfigBuilder::default().enabled(true).search_max_hnsw_ef(128u32)),
|
||||
)
|
||||
.await?;
|
||||
```
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
```typescript
|
||||
import { QdrantClient } from "@qdrant/js-client-rest";
|
||||
|
||||
const client = new QdrantClient({ host: "localhost", port: 6333 });
|
||||
|
||||
client.createCollection("{collection_name}", {
|
||||
strict_mode_config: {
|
||||
enabled: true,
|
||||
search_max_hnsw_ef: 128,
|
||||
},
|
||||
});
|
||||
```
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package snippet
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/qdrant/go-client/qdrant"
|
||||
)
|
||||
|
||||
func Main() {
|
||||
client, err := qdrant.NewClient(&qdrant.Config{
|
||||
Host: "localhost",
|
||||
Port: 6334,
|
||||
})
|
||||
|
||||
if err != nil { panic(err) } // @hide
|
||||
|
||||
client.CreateCollection(context.Background(), &qdrant.CreateCollection{
|
||||
CollectionName: "{collection_name}",
|
||||
StrictModeConfig: &qdrant.StrictModeConfig{
|
||||
Enabled: qdrant.PtrOf(true),
|
||||
SearchMaxHnswEf: qdrant.PtrOf(uint32(128)),
|
||||
},
|
||||
})
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
```http
|
||||
PUT /collections/{collection_name}
|
||||
{
|
||||
"strict_mode_config": {
|
||||
"enabled": true,
|
||||
"search_max_hnsw_ef": 128
|
||||
}
|
||||
}
|
||||
```
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.example.snippets_amalgamation;
|
||||
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Collections.CreateCollection;
|
||||
import io.qdrant.client.grpc.Collections.StrictModeConfig;
|
||||
|
||||
public class Snippet {
|
||||
public static void run() throws Exception {
|
||||
QdrantClient client =
|
||||
new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build());
|
||||
|
||||
client
|
||||
.createCollectionAsync(
|
||||
CreateCollection.newBuilder()
|
||||
.setCollectionName("{collection_name}")
|
||||
.setStrictModeConfig(
|
||||
StrictModeConfig.newBuilder().setEnabled(true).setSearchMaxHnswEf(128).build())
|
||||
.build())
|
||||
.get();
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
from qdrant_client import QdrantClient, models
|
||||
|
||||
client = QdrantClient(url="http://localhost:6333")
|
||||
|
||||
client.create_collection(
|
||||
collection_name="{collection_name}",
|
||||
strict_mode_config=models.StrictModeConfig(enabled=True, search_max_hnsw_ef=128),
|
||||
)
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
use qdrant_client::Qdrant;
|
||||
use qdrant_client::qdrant::{CreateCollectionBuilder, StrictModeConfigBuilder};
|
||||
|
||||
pub async fn main() -> anyhow::Result<()> {
|
||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
|
||||
client
|
||||
.create_collection(
|
||||
CreateCollectionBuilder::new("{collection_name}")
|
||||
.strict_mode_config(StrictModeConfigBuilder::default().enabled(true).search_max_hnsw_ef(128u32)),
|
||||
)
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
import { QdrantClient } from "@qdrant/js-client-rest";
|
||||
|
||||
const client = new QdrantClient({ host: "localhost", port: 6333 });
|
||||
|
||||
client.createCollection("{collection_name}", {
|
||||
strict_mode_config: {
|
||||
enabled: true,
|
||||
search_max_hnsw_ef: 128,
|
||||
},
|
||||
});
|
||||
+1
@@ -0,0 +1 @@
|
||||
This code snippet sets `search_max_oversampling` on the strict mode configuration to cap the maximum oversampling factor allowed in search parameters.
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
curl -X PUT http://localhost:6333/collections/{collection_name} \
|
||||
-H 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"strict_mode_config": {
|
||||
"enabled": true,
|
||||
"search_max_oversampling": 2.0
|
||||
}
|
||||
}'
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
using Qdrant.Client;
|
||||
using Qdrant.Client.Grpc;
|
||||
|
||||
public class Snippet
|
||||
{
|
||||
public static async Task Run()
|
||||
{
|
||||
var client = new QdrantClient("localhost", 6334);
|
||||
|
||||
await client.CreateCollectionAsync(
|
||||
collectionName: "{collection_name}",
|
||||
strictModeConfig: new StrictModeConfig { Enabled = true, SearchMaxOversampling = 2.0f }
|
||||
);
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
```bash
|
||||
curl -X PUT http://localhost:6333/collections/{collection_name} \
|
||||
-H 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"strict_mode_config": {
|
||||
"enabled": true,
|
||||
"search_max_oversampling": 2.0
|
||||
}
|
||||
}'
|
||||
```
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
```csharp
|
||||
using Qdrant.Client;
|
||||
using Qdrant.Client.Grpc;
|
||||
|
||||
var client = new QdrantClient("localhost", 6334);
|
||||
|
||||
await client.CreateCollectionAsync(
|
||||
collectionName: "{collection_name}",
|
||||
strictModeConfig: new StrictModeConfig { Enabled = true, SearchMaxOversampling = 2.0f }
|
||||
);
|
||||
```
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
```go
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/qdrant/go-client/qdrant"
|
||||
)
|
||||
|
||||
client, err := qdrant.NewClient(&qdrant.Config{
|
||||
Host: "localhost",
|
||||
Port: 6334,
|
||||
})
|
||||
|
||||
client.CreateCollection(context.Background(), &qdrant.CreateCollection{
|
||||
CollectionName: "{collection_name}",
|
||||
StrictModeConfig: &qdrant.StrictModeConfig{
|
||||
Enabled: qdrant.PtrOf(true),
|
||||
SearchMaxOversampling: qdrant.PtrOf(float32(2.0)),
|
||||
},
|
||||
})
|
||||
```
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
```java
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Collections.CreateCollection;
|
||||
import io.qdrant.client.grpc.Collections.StrictModeConfig;
|
||||
|
||||
QdrantClient client =
|
||||
new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build());
|
||||
|
||||
client
|
||||
.createCollectionAsync(
|
||||
CreateCollection.newBuilder()
|
||||
.setCollectionName("{collection_name}")
|
||||
.setStrictModeConfig(
|
||||
StrictModeConfig.newBuilder().setEnabled(true).setSearchMaxOversampling(2.0f).build())
|
||||
.build())
|
||||
.get();
|
||||
```
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
```python
|
||||
from qdrant_client import QdrantClient, models
|
||||
|
||||
client = QdrantClient(url="http://localhost:6333")
|
||||
|
||||
client.create_collection(
|
||||
collection_name="{collection_name}",
|
||||
strict_mode_config=models.StrictModeConfig(enabled=True, search_max_oversampling=2.0),
|
||||
)
|
||||
```
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
```rust
|
||||
use qdrant_client::Qdrant;
|
||||
use qdrant_client::qdrant::{CreateCollectionBuilder, StrictModeConfigBuilder};
|
||||
|
||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
|
||||
client
|
||||
.create_collection(
|
||||
CreateCollectionBuilder::new("{collection_name}")
|
||||
.strict_mode_config(StrictModeConfigBuilder::default().enabled(true).search_max_oversampling(2.0f32)),
|
||||
)
|
||||
.await?;
|
||||
```
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
```typescript
|
||||
import { QdrantClient } from "@qdrant/js-client-rest";
|
||||
|
||||
const client = new QdrantClient({ host: "localhost", port: 6333 });
|
||||
|
||||
client.createCollection("{collection_name}", {
|
||||
strict_mode_config: {
|
||||
enabled: true,
|
||||
search_max_oversampling: 2.0,
|
||||
},
|
||||
});
|
||||
```
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package snippet
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/qdrant/go-client/qdrant"
|
||||
)
|
||||
|
||||
func Main() {
|
||||
client, err := qdrant.NewClient(&qdrant.Config{
|
||||
Host: "localhost",
|
||||
Port: 6334,
|
||||
})
|
||||
|
||||
if err != nil { panic(err) } // @hide
|
||||
|
||||
client.CreateCollection(context.Background(), &qdrant.CreateCollection{
|
||||
CollectionName: "{collection_name}",
|
||||
StrictModeConfig: &qdrant.StrictModeConfig{
|
||||
Enabled: qdrant.PtrOf(true),
|
||||
SearchMaxOversampling: qdrant.PtrOf(float32(2.0)),
|
||||
},
|
||||
})
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
```http
|
||||
PUT /collections/{collection_name}
|
||||
{
|
||||
"strict_mode_config": {
|
||||
"enabled": true,
|
||||
"search_max_oversampling": 2.0
|
||||
}
|
||||
}
|
||||
```
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.example.snippets_amalgamation;
|
||||
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Collections.CreateCollection;
|
||||
import io.qdrant.client.grpc.Collections.StrictModeConfig;
|
||||
|
||||
public class Snippet {
|
||||
public static void run() throws Exception {
|
||||
QdrantClient client =
|
||||
new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build());
|
||||
|
||||
client
|
||||
.createCollectionAsync(
|
||||
CreateCollection.newBuilder()
|
||||
.setCollectionName("{collection_name}")
|
||||
.setStrictModeConfig(
|
||||
StrictModeConfig.newBuilder().setEnabled(true).setSearchMaxOversampling(2.0f).build())
|
||||
.build())
|
||||
.get();
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
from qdrant_client import QdrantClient, models
|
||||
|
||||
client = QdrantClient(url="http://localhost:6333")
|
||||
|
||||
client.create_collection(
|
||||
collection_name="{collection_name}",
|
||||
strict_mode_config=models.StrictModeConfig(enabled=True, search_max_oversampling=2.0),
|
||||
)
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
use qdrant_client::Qdrant;
|
||||
use qdrant_client::qdrant::{CreateCollectionBuilder, StrictModeConfigBuilder};
|
||||
|
||||
pub async fn main() -> anyhow::Result<()> {
|
||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
|
||||
client
|
||||
.create_collection(
|
||||
CreateCollectionBuilder::new("{collection_name}")
|
||||
.strict_mode_config(StrictModeConfigBuilder::default().enabled(true).search_max_oversampling(2.0f32)),
|
||||
)
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
import { QdrantClient } from "@qdrant/js-client-rest";
|
||||
|
||||
const client = new QdrantClient({ host: "localhost", port: 6333 });
|
||||
|
||||
client.createCollection("{collection_name}", {
|
||||
strict_mode_config: {
|
||||
enabled: true,
|
||||
search_max_oversampling: 2.0,
|
||||
},
|
||||
});
|
||||
+1
@@ -0,0 +1 @@
|
||||
This code snippet sets `sparse_config` on the strict mode configuration to cap the maximum length of sparse vectors for a named vector.
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
curl -X PUT http://localhost:6333/collections/{collection_name} \
|
||||
-H 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"strict_mode_config": {
|
||||
"enabled": true,
|
||||
"sparse_config": {
|
||||
"{vector_name}": {
|
||||
"max_length": 1000
|
||||
}
|
||||
}
|
||||
}
|
||||
}'
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
using Qdrant.Client;
|
||||
using Qdrant.Client.Grpc;
|
||||
|
||||
public class Snippet
|
||||
{
|
||||
public static async Task Run()
|
||||
{
|
||||
var client = new QdrantClient("localhost", 6334);
|
||||
|
||||
await client.CreateCollectionAsync(
|
||||
collectionName: "{collection_name}",
|
||||
strictModeConfig: new StrictModeConfig
|
||||
{
|
||||
Enabled = true,
|
||||
SparseConfig = new StrictModeSparseConfig
|
||||
{
|
||||
SparseConfig = { ["{vector_name}"] = new StrictModeSparse { MaxLength = 1000 } }
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
```bash
|
||||
curl -X PUT http://localhost:6333/collections/{collection_name} \
|
||||
-H 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"strict_mode_config": {
|
||||
"enabled": true,
|
||||
"sparse_config": {
|
||||
"{vector_name}": {
|
||||
"max_length": 1000
|
||||
}
|
||||
}
|
||||
}
|
||||
}'
|
||||
```
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user