Document new strict_mode_config parameters (v1.18.0) (#2303)

* Document 7 missing strict_mode_config parameters

Adds documentation sections and code snippets (Python, TypeScript, Rust,
Go, Java, C#, HTTP, bash) for search_allow_exact, search_max_hnsw_ef,
search_max_oversampling, search_max_batchsize, max_resident_memory_percent,
multivector_config, and sparse_config.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Use title case for all headers

* Update qdrant-landing/content/documentation/ops-configuration/administration.md

Co-authored-by: Tim Visée <tim@visee.me>

* Mention default strict mode on Cloud; Clarify behavior of only setting enabled=true

* Apply suggestion from @timvisee

Co-authored-by: Tim Visée <tim@visee.me>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Tim Visée <tim@visee.me>
This commit is contained in:
Abdon Pijpelink
2026-04-30 20:25:21 +02:00
committed by GitHub
co-authored by Claude Sonnet 4.6 Tim Visée
parent dc7d66545e
commit ecd4887576
113 changed files with 1690 additions and 9 deletions
@@ -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.
@@ -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
}
}'
@@ -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 }
);
}
}
@@ -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
}
}'
```
@@ -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 }
);
```
@@ -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)),
},
})
```
@@ -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();
```
@@ -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),
)
```
@@ -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?;
```
@@ -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,
},
});
```
@@ -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)),
},
})
}
@@ -0,0 +1,9 @@
```http
PUT /collections/{collection_name}
{
"strict_mode_config": {
"enabled": true,
"max_resident_memory_percent": 90
}
}
```
@@ -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();
}
}
@@ -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),
)
@@ -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(())
}
@@ -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,
},
});
@@ -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.
@@ -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
}
}
}
}'
@@ -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 } }
}
}
);
}
}
@@ -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
}
}
}
}'
```
@@ -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 } }
}
}
);
```
@@ -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))},
},
},
},
})
```
@@ -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();
```
@@ -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)},
),
)
```
@@ -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?;
```
@@ -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,
},
},
},
});
```
@@ -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))},
},
},
},
})
}
@@ -0,0 +1,13 @@
```http
PUT /collections/{collection_name}
{
"strict_mode_config": {
"enabled": true,
"multivector_config": {
"{vector_name}": {
"max_vectors": 10
}
}
}
}
```
@@ -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();
}
}
@@ -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)},
),
)
@@ -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(())
}
@@ -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,
},
},
},
});
@@ -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.
@@ -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
}
}'
@@ -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 }
);
}
}
@@ -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
}
}'
```
@@ -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 }
);
```
@@ -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),
},
})
```
@@ -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();
```
@@ -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),
)
```
@@ -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?;
```
@@ -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,
},
});
```
@@ -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),
},
})
}
@@ -0,0 +1,9 @@
```http
PUT /collections/{collection_name}
{
"strict_mode_config": {
"enabled": true,
"search_allow_exact": false
}
}
```
@@ -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();
}
}
@@ -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),
)
@@ -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(())
}
@@ -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,
},
});
@@ -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.
@@ -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
}
}'
@@ -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 }
);
}
}
@@ -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
}
}'
```
@@ -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 }
);
```
@@ -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)),
},
})
```
@@ -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();
```
@@ -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),
)
```
@@ -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?;
```
@@ -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,
},
});
```
@@ -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)),
},
})
}
@@ -0,0 +1,9 @@
```http
PUT /collections/{collection_name}
{
"strict_mode_config": {
"enabled": true,
"search_max_batchsize": 1000
}
}
```
@@ -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();
}
}
@@ -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),
)
@@ -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(())
}
@@ -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,
},
});
@@ -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.
@@ -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
}
}'
@@ -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 }
);
}
}
@@ -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
}
}'
```
@@ -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 }
);
```
@@ -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)),
},
})
```
@@ -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();
```
@@ -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),
)
```
@@ -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?;
```
@@ -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,
},
});
```
@@ -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)),
},
})
}
@@ -0,0 +1,9 @@
```http
PUT /collections/{collection_name}
{
"strict_mode_config": {
"enabled": true,
"search_max_hnsw_ef": 128
}
}
```
@@ -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();
}
}
@@ -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),
)
@@ -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(())
}
@@ -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,
},
});
@@ -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.
@@ -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
}
}'
@@ -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 }
);
}
}
@@ -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
}
}'
```
@@ -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 }
);
```
@@ -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)),
},
})
```
@@ -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();
```
@@ -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),
)
```
@@ -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?;
```
@@ -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,
},
});
```
@@ -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)),
},
})
}
@@ -0,0 +1,9 @@
```http
PUT /collections/{collection_name}
{
"strict_mode_config": {
"enabled": true,
"search_max_oversampling": 2.0
}
}
```
@@ -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();
}
}
@@ -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),
)
@@ -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(())
}
@@ -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,
},
});
@@ -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.
@@ -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
}
}
}
}'
@@ -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 } }
}
}
);
}
}
@@ -0,0 +1,14 @@
```bash
curl -X PUT http://localhost:6333/collections/{collection_name} \
-H 'Content-Type: application/json' \
--data-raw '{
"strict_mode_config": {
"enabled": true,
"sparse_config": {
"{vector_name}": {
"max_length": 1000
}
}
}
}'
```

Some files were not shown because too many files have changed in this diff Show More