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 `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,
},
});