diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/_description.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/_description.md new file mode 100644 index 000000000..0482a8c35 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/_description.md @@ -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. \ No newline at end of file diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/bash.sh b/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/bash.sh new file mode 100644 index 000000000..05f8bfe71 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/bash.sh @@ -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 + } + }' diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/csharp.cs b/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/csharp.cs new file mode 100644 index 000000000..88d3439ba --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/csharp.cs @@ -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 } + ); + } +} diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/generated/bash.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/generated/bash.md new file mode 100644 index 000000000..7d5473310 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/generated/bash.md @@ -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 + } + }' +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/generated/csharp.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/generated/csharp.md new file mode 100644 index 000000000..68ddc35ef --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/generated/csharp.md @@ -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 } +); +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/generated/go.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/generated/go.md new file mode 100644 index 000000000..37371f03b --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/generated/go.md @@ -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)), + }, +}) +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/generated/java.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/generated/java.md new file mode 100644 index 000000000..a69c99c6a --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/generated/java.md @@ -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(); +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/generated/python.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/generated/python.md new file mode 100644 index 000000000..4a443dbf2 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/generated/python.md @@ -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), +) +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/generated/rust.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/generated/rust.md new file mode 100644 index 000000000..fbbf29679 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/generated/rust.md @@ -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?; +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/generated/typescript.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/generated/typescript.md new file mode 100644 index 000000000..991c3cef5 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/generated/typescript.md @@ -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, + }, +}); +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/go.go b/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/go.go new file mode 100644 index 000000000..d2f8372b8 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/go.go @@ -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)), + }, + }) +} diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/http.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/http.md new file mode 100644 index 000000000..5c8671a5e --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/http.md @@ -0,0 +1,9 @@ +```http +PUT /collections/{collection_name} +{ + "strict_mode_config": { + "enabled": true, + "max_resident_memory_percent": 90 + } +} +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/java.java b/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/java.java new file mode 100644 index 000000000..938301117 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/java.java @@ -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(); + } +} diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/python.py b/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/python.py new file mode 100644 index 000000000..4c054b501 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/python.py @@ -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), +) diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/rust.rs b/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/rust.rs new file mode 100644 index 000000000..98eb706b8 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/rust.rs @@ -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(()) +} diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/typescript.ts b/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/typescript.ts new file mode 100644 index 000000000..a388fc934 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/max-resident-memory-percent/typescript.ts @@ -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, + }, +}); diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/_description.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/_description.md new file mode 100644 index 000000000..285b50080 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/_description.md @@ -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. \ No newline at end of file diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/bash.sh b/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/bash.sh new file mode 100644 index 000000000..2d8c0fc96 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/bash.sh @@ -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 + } + } + } + }' diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/csharp.cs b/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/csharp.cs new file mode 100644 index 000000000..576212499 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/csharp.cs @@ -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 } } + } + } + ); + } +} diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/generated/bash.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/generated/bash.md new file mode 100644 index 000000000..7566d08ad --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/generated/bash.md @@ -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 + } + } + } + }' +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/generated/csharp.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/generated/csharp.md new file mode 100644 index 000000000..bf5928c6a --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/generated/csharp.md @@ -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 } } + } + } +); +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/generated/go.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/generated/go.md new file mode 100644 index 000000000..ba5b4948f --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/generated/go.md @@ -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))}, + }, + }, + }, +}) +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/generated/java.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/generated/java.md new file mode 100644 index 000000000..7421cd7fa --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/generated/java.md @@ -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(); +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/generated/python.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/generated/python.md new file mode 100644 index 000000000..c15c782b9 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/generated/python.md @@ -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)}, + ), +) +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/generated/rust.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/generated/rust.md new file mode 100644 index 000000000..2c4fd2bf1 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/generated/rust.md @@ -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?; +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/generated/typescript.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/generated/typescript.md new file mode 100644 index 000000000..fd5be60e8 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/generated/typescript.md @@ -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, + }, + }, + }, +}); +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/go.go b/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/go.go new file mode 100644 index 000000000..0f2f7f2ab --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/go.go @@ -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))}, + }, + }, + }, + }) +} diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/http.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/http.md new file mode 100644 index 000000000..0d34ee525 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/http.md @@ -0,0 +1,13 @@ +```http +PUT /collections/{collection_name} +{ + "strict_mode_config": { + "enabled": true, + "multivector_config": { + "{vector_name}": { + "max_vectors": 10 + } + } + } +} +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/java.java b/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/java.java new file mode 100644 index 000000000..7d815f4d1 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/java.java @@ -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(); + } +} diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/python.py b/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/python.py new file mode 100644 index 000000000..2fb762706 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/python.py @@ -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)}, + ), +) diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/rust.rs b/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/rust.rs new file mode 100644 index 000000000..9072ea241 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/rust.rs @@ -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(()) +} diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/typescript.ts b/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/typescript.ts new file mode 100644 index 000000000..ff046d4f3 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/multivector-config/typescript.ts @@ -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, + }, + }, + }, +}); diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/_description.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/_description.md new file mode 100644 index 000000000..14694edb0 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/_description.md @@ -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. \ No newline at end of file diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/bash.sh b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/bash.sh new file mode 100644 index 000000000..285183088 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/bash.sh @@ -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 + } + }' diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/csharp.cs b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/csharp.cs new file mode 100644 index 000000000..49c4473f5 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/csharp.cs @@ -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 } + ); + } +} diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/generated/bash.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/generated/bash.md new file mode 100644 index 000000000..12b9af684 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/generated/bash.md @@ -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 + } + }' +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/generated/csharp.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/generated/csharp.md new file mode 100644 index 000000000..b3b9cb591 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/generated/csharp.md @@ -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 } +); +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/generated/go.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/generated/go.md new file mode 100644 index 000000000..e1d444368 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/generated/go.md @@ -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), + }, +}) +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/generated/java.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/generated/java.md new file mode 100644 index 000000000..0adaaee4d --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/generated/java.md @@ -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(); +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/generated/python.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/generated/python.md new file mode 100644 index 000000000..0a5611e01 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/generated/python.md @@ -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), +) +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/generated/rust.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/generated/rust.md new file mode 100644 index 000000000..3f8c10a56 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/generated/rust.md @@ -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?; +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/generated/typescript.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/generated/typescript.md new file mode 100644 index 000000000..0681de84b --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/generated/typescript.md @@ -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, + }, +}); +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/go.go b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/go.go new file mode 100644 index 000000000..5ce36e44e --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/go.go @@ -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), + }, + }) +} diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/http.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/http.md new file mode 100644 index 000000000..a0ec883c4 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/http.md @@ -0,0 +1,9 @@ +```http +PUT /collections/{collection_name} +{ + "strict_mode_config": { + "enabled": true, + "search_allow_exact": false + } +} +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/java.java b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/java.java new file mode 100644 index 000000000..963b88381 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/java.java @@ -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(); + } +} diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/python.py b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/python.py new file mode 100644 index 000000000..d9db7759a --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/python.py @@ -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), +) diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/rust.rs b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/rust.rs new file mode 100644 index 000000000..d25a49cba --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/rust.rs @@ -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(()) +} diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/typescript.ts b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/typescript.ts new file mode 100644 index 000000000..d3681560c --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-allow-exact/typescript.ts @@ -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, + }, +}); diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/_description.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/_description.md new file mode 100644 index 000000000..70bfab502 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/_description.md @@ -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. \ No newline at end of file diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/bash.sh b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/bash.sh new file mode 100644 index 000000000..9dfb3d642 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/bash.sh @@ -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 + } + }' diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/csharp.cs b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/csharp.cs new file mode 100644 index 000000000..84b32e7ec --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/csharp.cs @@ -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 } + ); + } +} diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/generated/bash.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/generated/bash.md new file mode 100644 index 000000000..526744536 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/generated/bash.md @@ -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 + } + }' +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/generated/csharp.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/generated/csharp.md new file mode 100644 index 000000000..ba3293319 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/generated/csharp.md @@ -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 } +); +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/generated/go.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/generated/go.md new file mode 100644 index 000000000..7e16c4dd8 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/generated/go.md @@ -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)), + }, +}) +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/generated/java.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/generated/java.md new file mode 100644 index 000000000..b4717726a --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/generated/java.md @@ -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(); +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/generated/python.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/generated/python.md new file mode 100644 index 000000000..48147a1f5 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/generated/python.md @@ -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), +) +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/generated/rust.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/generated/rust.md new file mode 100644 index 000000000..321843978 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/generated/rust.md @@ -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?; +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/generated/typescript.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/generated/typescript.md new file mode 100644 index 000000000..7e9d3677b --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/generated/typescript.md @@ -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, + }, +}); +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/go.go b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/go.go new file mode 100644 index 000000000..fea3ea24d --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/go.go @@ -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)), + }, + }) +} diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/http.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/http.md new file mode 100644 index 000000000..52b5024d5 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/http.md @@ -0,0 +1,9 @@ +```http +PUT /collections/{collection_name} +{ + "strict_mode_config": { + "enabled": true, + "search_max_batchsize": 1000 + } +} +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/java.java b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/java.java new file mode 100644 index 000000000..af4e9b22b --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/java.java @@ -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(); + } +} diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/python.py b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/python.py new file mode 100644 index 000000000..b1486fe60 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/python.py @@ -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), +) diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/rust.rs b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/rust.rs new file mode 100644 index 000000000..463cec854 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/rust.rs @@ -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(()) +} diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/typescript.ts b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/typescript.ts new file mode 100644 index 000000000..09830524e --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-batchsize/typescript.ts @@ -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, + }, +}); diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/_description.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/_description.md new file mode 100644 index 000000000..0974cb3d5 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/_description.md @@ -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. \ No newline at end of file diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/bash.sh b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/bash.sh new file mode 100644 index 000000000..31f57e97c --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/bash.sh @@ -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 + } + }' diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/csharp.cs b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/csharp.cs new file mode 100644 index 000000000..9c1b7a440 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/csharp.cs @@ -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 } + ); + } +} diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/generated/bash.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/generated/bash.md new file mode 100644 index 000000000..f56261c06 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/generated/bash.md @@ -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 + } + }' +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/generated/csharp.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/generated/csharp.md new file mode 100644 index 000000000..fa93aa67f --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/generated/csharp.md @@ -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 } +); +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/generated/go.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/generated/go.md new file mode 100644 index 000000000..75f199070 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/generated/go.md @@ -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)), + }, +}) +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/generated/java.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/generated/java.md new file mode 100644 index 000000000..5c70f028f --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/generated/java.md @@ -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(); +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/generated/python.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/generated/python.md new file mode 100644 index 000000000..143b876a7 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/generated/python.md @@ -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), +) +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/generated/rust.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/generated/rust.md new file mode 100644 index 000000000..7184104a8 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/generated/rust.md @@ -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?; +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/generated/typescript.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/generated/typescript.md new file mode 100644 index 000000000..bf664fc17 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/generated/typescript.md @@ -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, + }, +}); +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/go.go b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/go.go new file mode 100644 index 000000000..f737ff33d --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/go.go @@ -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)), + }, + }) +} diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/http.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/http.md new file mode 100644 index 000000000..c4a9d79d4 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/http.md @@ -0,0 +1,9 @@ +```http +PUT /collections/{collection_name} +{ + "strict_mode_config": { + "enabled": true, + "search_max_hnsw_ef": 128 + } +} +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/java.java b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/java.java new file mode 100644 index 000000000..18da088c0 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/java.java @@ -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(); + } +} diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/python.py b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/python.py new file mode 100644 index 000000000..2efc2eccf --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/python.py @@ -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), +) diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/rust.rs b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/rust.rs new file mode 100644 index 000000000..5cfa8cf3b --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/rust.rs @@ -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(()) +} diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/typescript.ts b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/typescript.ts new file mode 100644 index 000000000..e99dae976 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/typescript.ts @@ -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, + }, +}); diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/_description.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/_description.md new file mode 100644 index 000000000..b743a34a3 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/_description.md @@ -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. \ No newline at end of file diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/bash.sh b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/bash.sh new file mode 100644 index 000000000..0119feb9a --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/bash.sh @@ -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 + } + }' diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/csharp.cs b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/csharp.cs new file mode 100644 index 000000000..b7d3dba18 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/csharp.cs @@ -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 } + ); + } +} diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/generated/bash.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/generated/bash.md new file mode 100644 index 000000000..09a6ea913 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/generated/bash.md @@ -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 + } + }' +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/generated/csharp.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/generated/csharp.md new file mode 100644 index 000000000..8dd136724 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/generated/csharp.md @@ -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 } +); +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/generated/go.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/generated/go.md new file mode 100644 index 000000000..f62ad862b --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/generated/go.md @@ -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)), + }, +}) +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/generated/java.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/generated/java.md new file mode 100644 index 000000000..39f200e2b --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/generated/java.md @@ -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(); +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/generated/python.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/generated/python.md new file mode 100644 index 000000000..88503d8ab --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/generated/python.md @@ -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), +) +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/generated/rust.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/generated/rust.md new file mode 100644 index 000000000..a0c21eeb2 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/generated/rust.md @@ -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?; +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/generated/typescript.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/generated/typescript.md new file mode 100644 index 000000000..be9df7862 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/generated/typescript.md @@ -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, + }, +}); +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/go.go b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/go.go new file mode 100644 index 000000000..84f846130 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/go.go @@ -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)), + }, + }) +} diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/http.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/http.md new file mode 100644 index 000000000..a7e4c62a5 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/http.md @@ -0,0 +1,9 @@ +```http +PUT /collections/{collection_name} +{ + "strict_mode_config": { + "enabled": true, + "search_max_oversampling": 2.0 + } +} +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/java.java b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/java.java new file mode 100644 index 000000000..938d9d3d7 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/java.java @@ -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(); + } +} diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/python.py b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/python.py new file mode 100644 index 000000000..30069dd38 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/python.py @@ -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), +) diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/rust.rs b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/rust.rs new file mode 100644 index 000000000..bbe3a3996 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/rust.rs @@ -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(()) +} diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/typescript.ts b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/typescript.ts new file mode 100644 index 000000000..2ce60d536 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/search-max-oversampling/typescript.ts @@ -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, + }, +}); diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/_description.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/_description.md new file mode 100644 index 000000000..daca3b601 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/_description.md @@ -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. \ No newline at end of file diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/bash.sh b/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/bash.sh new file mode 100644 index 000000000..99a3244ff --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/bash.sh @@ -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 + } + } + } + }' diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/csharp.cs b/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/csharp.cs new file mode 100644 index 000000000..c5addfeb1 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/csharp.cs @@ -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 } } + } + } + ); + } +} diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/generated/bash.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/generated/bash.md new file mode 100644 index 000000000..fa292790c --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/generated/bash.md @@ -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 + } + } + } + }' +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/generated/csharp.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/generated/csharp.md new file mode 100644 index 000000000..e3f7b0208 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/generated/csharp.md @@ -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, + SparseConfig = new StrictModeSparseConfig + { + SparseConfig = { ["{vector_name}"] = new StrictModeSparse { MaxLength = 1000 } } + } + } +); +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/generated/go.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/generated/go.md new file mode 100644 index 000000000..9f69e4412 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/generated/go.md @@ -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), + SparseConfig: &qdrant.StrictModeSparseConfig{ + SparseConfig: map[string]*qdrant.StrictModeSparse{ + "{vector_name}": {MaxLength: qdrant.PtrOf(uint64(1000))}, + }, + }, + }, +}) +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/generated/java.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/generated/java.md new file mode 100644 index 000000000..8303aa562 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/generated/java.md @@ -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.StrictModeSparse; +import io.qdrant.client.grpc.Collections.StrictModeSparseConfig; + +QdrantClient client = + new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build()); + +client + .createCollectionAsync( + CreateCollection.newBuilder() + .setCollectionName("{collection_name}") + .setStrictModeConfig( + StrictModeConfig.newBuilder() + .setEnabled(true) + .setSparseConfig( + StrictModeSparseConfig.newBuilder() + .putSparseConfig("{vector_name}", StrictModeSparse.newBuilder().setMaxLength(1000).build()) + .build()) + .build()) + .build()) + .get(); +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/generated/python.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/generated/python.md new file mode 100644 index 000000000..984bf92b0 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/generated/python.md @@ -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, + sparse_config={"{vector_name}": models.StrictModeSparse(max_length=1000)}, + ), +) +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/generated/rust.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/generated/rust.md new file mode 100644 index 000000000..4de07f343 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/generated/rust.md @@ -0,0 +1,27 @@ +```rust +use std::collections::HashMap; + +use qdrant_client::Qdrant; +use qdrant_client::qdrant::{ + CreateCollectionBuilder, StrictModeConfigBuilder, StrictModeSparse, StrictModeSparseConfig, +}; + +let client = Qdrant::from_url("http://localhost:6334").build()?; + +client + .create_collection( + CreateCollectionBuilder::new("{collection_name}").strict_mode_config( + StrictModeConfigBuilder::default() + .enabled(true) + .sparse_config(StrictModeSparseConfig { + sparse_config: HashMap::from([( + "{vector_name}".to_string(), + StrictModeSparse { + max_length: Some(1000), + }, + )]), + }), + ), + ) + .await?; +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/generated/typescript.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/generated/typescript.md new file mode 100644 index 000000000..4f8f98dd4 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/generated/typescript.md @@ -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, + sparse_config: { + "{vector_name}": { + max_length: 1000, + }, + }, + }, +}); +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/go.go b/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/go.go new file mode 100644 index 000000000..861a8b0d2 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/go.go @@ -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), + SparseConfig: &qdrant.StrictModeSparseConfig{ + SparseConfig: map[string]*qdrant.StrictModeSparse{ + "{vector_name}": {MaxLength: qdrant.PtrOf(uint64(1000))}, + }, + }, + }, + }) +} diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/http.md b/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/http.md new file mode 100644 index 000000000..5443d4e56 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/http.md @@ -0,0 +1,13 @@ +```http +PUT /collections/{collection_name} +{ + "strict_mode_config": { + "enabled": true, + "sparse_config": { + "{vector_name}": { + "max_length": 1000 + } + } + } +} +``` diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/java.java b/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/java.java new file mode 100644 index 000000000..1ed3cd64c --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/java.java @@ -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.StrictModeSparse; +import io.qdrant.client.grpc.Collections.StrictModeSparseConfig; + +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) + .setSparseConfig( + StrictModeSparseConfig.newBuilder() + .putSparseConfig("{vector_name}", StrictModeSparse.newBuilder().setMaxLength(1000).build()) + .build()) + .build()) + .build()) + .get(); + } +} diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/python.py b/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/python.py new file mode 100644 index 000000000..757ed4642 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/python.py @@ -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, + sparse_config={"{vector_name}": models.StrictModeSparse(max_length=1000)}, + ), +) diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/rust.rs b/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/rust.rs new file mode 100644 index 000000000..2eacc97f8 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/rust.rs @@ -0,0 +1,29 @@ +use std::collections::HashMap; + +use qdrant_client::Qdrant; +use qdrant_client::qdrant::{ + CreateCollectionBuilder, StrictModeConfigBuilder, StrictModeSparse, StrictModeSparseConfig, +}; + +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) + .sparse_config(StrictModeSparseConfig { + sparse_config: HashMap::from([( + "{vector_name}".to_string(), + StrictModeSparse { + max_length: Some(1000), + }, + )]), + }), + ), + ) + .await?; + + Ok(()) +} diff --git a/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/typescript.ts b/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/typescript.ts new file mode 100644 index 000000000..f7e9d3bf5 --- /dev/null +++ b/qdrant-landing/content/documentation/headless/snippets/strict-mode/sparse-config/typescript.ts @@ -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, + sparse_config: { + "{vector_name}": { + max_length: 1000, + }, + }, + }, +}); diff --git a/qdrant-landing/content/documentation/ops-configuration/administration.md b/qdrant-landing/content/documentation/ops-configuration/administration.md index e675ba7a2..73c77be18 100644 --- a/qdrant-landing/content/documentation/ops-configuration/administration.md +++ b/qdrant-landing/content/documentation/ops-configuration/administration.md @@ -34,7 +34,6 @@ If using a Qdrant binary, recovery mode can be enabled by setting a recovery message in an environment variable, such as `QDRANT__STORAGE__RECOVERY_MODE="My recovery message"`. - ## Low Memory Mode *Available as of v1.18.0* @@ -68,17 +67,15 @@ Low memory mode takes effect on the next restart. It doesn't modify the [vector *Available as of v1.13.0* -Strict mode is a feature to restrict certain type of operations on a collection in order to protect the Qdrant cluster. +Strict mode is a feature to restrict certain type of operations on a collection in order to protect the Qdrant cluster. The goal is to prevent inefficient usage patterns that could overload the system. -The goal is to prevent inefficient usage patterns that could overload the system. +Strict mode ensures a more predictable and responsive service when you do not have control over the queries that are being executed. Upon crossing a limit, the server will return a client side error with the information about the limit that was crossed. -Strict mode ensures a more predictable and responsive service when you do not have control over the queries that are being executed. +The `strict_mode_config` can be enabled when [creating](#create-a-collection) a new collection, see [schema definitions](https://api.qdrant.tech/api-reference/collections/create-collection#request.body.strict_mode_config) for all the available `strict_mode_config` parameters. As part of the config, the `enabled` field act as a toggle to enable or disable the strict mode dynamically. -Upon crossing a limit, the server will return a client side error with the information about the limit that was crossed. +Simply enabling strict mode without specifying a specific restriction does not have any effect. You need to explicitly set the restrictions you want to enforce. -The `strict_mode_config` can be enabled when [creating](#create-a-collection) a new collection, see [schema definitions](https://api.qdrant.tech/api-reference/collections/create-collection#request.body.strict_mode_config) for all the available `strict_mode_config` parameters. - -As part of the config, the `enabled` field act as a toggle to enable or disable the strict mode dynamically. +On Qdrant Cloud, strict mode is enabled by default for new collections. Refer to [Configure Qdrant Cloud Clusters](/documentation/cloud/configure-cluster/) for the specific restrictions. It is possible to raise the default limits and/or disable strict mode entirely. Though, in order to ensure a stable cluster we strongly recommend to keep strict mode enabled using its default configuration. For disabling strict mode on an existing collection use: @@ -122,6 +119,30 @@ Setting `max_timeout` caps the maximum value in seconds for the `timeout` parame {{< code-snippet path="/documentation/headless/snippets/strict-mode/max-timeout/" >}} +### Disable Exact Search + +Exact search bypasses the HNSW index and performs a brute-force scan, which can be very slow on large collections. + +Setting `search_allow_exact` to false prevents clients from requesting exact search. + +{{< code-snippet path="/documentation/headless/snippets/strict-mode/search-allow-exact/" >}} + +### Maximum HNSW ef Parameter + +A high HNSW `ef` value increases recall but also increases search latency. + +Setting `search_max_hnsw_ef` caps the maximum `ef` value allowed in search parameters. + +{{< code-snippet path="/documentation/headless/snippets/strict-mode/search-max-hnsw-ef/" >}} + +### Maximum Search Oversampling + +A high oversampling factor increases the number of candidates evaluated during search, which can significantly increase latency. + +Setting `search_max_oversampling` caps the maximum oversampling factor allowed in search parameters. + +{{< code-snippet path="/documentation/headless/snippets/strict-mode/search-max-oversampling/" >}} + ### Maximum Size of a Filtering Condition Large filtering conditions are expensive to evaluate. @@ -148,6 +169,14 @@ Setting `upsert_max_batchsize` caps the maximum size in bytes of a batch during {{< code-snippet path="/documentation/headless/snippets/strict-mode/upsert-max-batchsize/" >}} +### Maximum Batch Size When Searching + +Sending very large search batches can create internal congestion. + +Setting `search_max_batchsize` caps the maximum number of searches in a single batch request. + +{{< code-snippet path="/documentation/headless/snippets/strict-mode/search-max-batchsize/" >}} + ### Maximum Collection Storage Size It is possible to set the maximum size of a collection in terms of vectors and/or payload storage size. @@ -156,6 +185,14 @@ Setting `max_collection_vector_size_bytes` and/or `max_collection_payload_size_b {{< code-snippet path="/documentation/headless/snippets/strict-mode/max-collection-storage-size-bytes/" >}} +### Maximum Resident Memory Usage + +When a node is under memory pressure, new write operations can destabilize the cluster. + +Setting `max_resident_memory_percent` rejects memory-consuming write operations (such as upsert and set payload) when process resident memory exceeds the given percentage of total system memory. Delete operations are not affected. Accepts values in the range 1–100. + +{{< code-snippet path="/documentation/headless/snippets/strict-mode/max-resident-memory-percent/" >}} + ### Maximum Points Count Setting `max_points_count` caps the maximum number of points for a collection. @@ -170,4 +207,20 @@ Setting `read_rate_limit` and/or `write_rate_limit` to cap the maximum number of When exceeding the maximum number of operations, the client will receive an HTTP 429 error code with a suggested delay before retrying. -{{< code-snippet path="/documentation/headless/snippets/strict-mode/rate-limiting/" >}} \ No newline at end of file +{{< code-snippet path="/documentation/headless/snippets/strict-mode/rate-limiting/" >}} + +### Maximum Vectors per Multivector + +A multivector with many vectors per point is expensive to store, index and query. + +Setting `multivector_config` caps the maximum number of vectors per multivector for each named vector. + +{{< code-snippet path="/documentation/headless/snippets/strict-mode/multivector-config/" >}} + +### Maximum Sparse Vector Length + +Long sparse vectors increase memory usage and slow down filtering. + +Setting `sparse_config` caps the maximum length of sparse vectors for each named vector. + +{{< code-snippet path="/documentation/headless/snippets/strict-mode/sparse-config/" >}} \ No newline at end of file