mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-07 20:08:32 +02:00
Fix unindexed filtering retrieve docs (#2217)
* Change 2nd snippet to use update collection instead of create * Fix broken link
This commit is contained in:
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
curl -X PUT http://localhost:6333/collections/{collection_name} \
|
curl -X PATCH http://localhost:6333/collections/{collection_name} \
|
||||||
-H 'Content-Type: application/json' \
|
-H 'Content-Type: application/json' \
|
||||||
--data-raw '{
|
--data-raw '{
|
||||||
"strict_mode_config": {
|
"strict_mode_config": {
|
||||||
"enabled":" true,
|
"enabled": true,
|
||||||
"unindexed_filtering_retrieve": true
|
"unindexed_filtering_retrieve": true
|
||||||
}
|
}
|
||||||
}'
|
}'
|
||||||
|
|||||||
+6
-2
@@ -7,9 +7,13 @@ public class Snippet
|
|||||||
{
|
{
|
||||||
var client = new QdrantClient("localhost", 6334);
|
var client = new QdrantClient("localhost", 6334);
|
||||||
|
|
||||||
await client.CreateCollectionAsync(
|
await client.UpdateCollectionAsync(
|
||||||
collectionName: "{collection_name}",
|
collectionName: "{collection_name}",
|
||||||
strictModeConfig: new StrictModeConfig { Enabled = true, UnindexedFilteringRetrieve = true }
|
strictModeConfig: new StrictModeConfig
|
||||||
|
{
|
||||||
|
Enabled = true,
|
||||||
|
UnindexedFilteringRetrieve = true,
|
||||||
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -1,9 +1,9 @@
|
|||||||
```bash
|
```bash
|
||||||
curl -X PUT http://localhost:6333/collections/{collection_name} \
|
curl -X PATCH http://localhost:6333/collections/{collection_name} \
|
||||||
-H 'Content-Type: application/json' \
|
-H 'Content-Type: application/json' \
|
||||||
--data-raw '{
|
--data-raw '{
|
||||||
"strict_mode_config": {
|
"strict_mode_config": {
|
||||||
"enabled":" true,
|
"enabled": true,
|
||||||
"unindexed_filtering_retrieve": true
|
"unindexed_filtering_retrieve": true
|
||||||
}
|
}
|
||||||
}'
|
}'
|
||||||
|
|||||||
+6
-2
@@ -4,8 +4,12 @@ using Qdrant.Client.Grpc;
|
|||||||
|
|
||||||
var client = new QdrantClient("localhost", 6334);
|
var client = new QdrantClient("localhost", 6334);
|
||||||
|
|
||||||
await client.CreateCollectionAsync(
|
await client.UpdateCollectionAsync(
|
||||||
collectionName: "{collection_name}",
|
collectionName: "{collection_name}",
|
||||||
strictModeConfig: new StrictModeConfig { Enabled = true, UnindexedFilteringRetrieve = true }
|
strictModeConfig: new StrictModeConfig
|
||||||
|
{
|
||||||
|
Enabled = true,
|
||||||
|
UnindexedFilteringRetrieve = true,
|
||||||
|
}
|
||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|||||||
+1
-6
@@ -5,12 +5,7 @@ import (
|
|||||||
"github.com/qdrant/go-client/qdrant"
|
"github.com/qdrant/go-client/qdrant"
|
||||||
)
|
)
|
||||||
|
|
||||||
client, err := qdrant.NewClient(&qdrant.Config{
|
client.UpdateCollection(context.Background(), &qdrant.UpdateCollection{
|
||||||
Host: "localhost",
|
|
||||||
Port: 6334,
|
|
||||||
})
|
|
||||||
|
|
||||||
client.CreateCollection(context.Background(), &qdrant.CreateCollection{
|
|
||||||
CollectionName: "{collection_name}",
|
CollectionName: "{collection_name}",
|
||||||
StrictModeConfig: &qdrant.StrictModeConfig{
|
StrictModeConfig: &qdrant.StrictModeConfig{
|
||||||
Enabled: qdrant.PtrOf(true),
|
Enabled: qdrant.PtrOf(true),
|
||||||
|
|||||||
+7
-7
@@ -1,18 +1,18 @@
|
|||||||
```java
|
```java
|
||||||
import io.qdrant.client.QdrantClient;
|
import io.qdrant.client.QdrantClient;
|
||||||
import io.qdrant.client.QdrantGrpcClient;
|
import io.qdrant.client.QdrantGrpcClient;
|
||||||
import io.qdrant.client.grpc.Collections.CreateCollection;
|
import io.qdrant.client.grpc.Collections.UpdateCollection;
|
||||||
import io.qdrant.client.grpc.Collections.StrictModeConfig;
|
import io.qdrant.client.grpc.Collections.StrictModeConfig;
|
||||||
|
|
||||||
QdrantClient client =
|
|
||||||
new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build());
|
|
||||||
|
|
||||||
client
|
client
|
||||||
.createCollectionAsync(
|
.updateCollectionAsync(
|
||||||
CreateCollection.newBuilder()
|
UpdateCollection.newBuilder()
|
||||||
.setCollectionName("{collection_name}")
|
.setCollectionName("{collection_name}")
|
||||||
.setStrictModeConfig(
|
.setStrictModeConfig(
|
||||||
StrictModeConfig.newBuilder().setEnabled(true).setUnindexedFilteringRetrieve(true).build())
|
StrictModeConfig.newBuilder()
|
||||||
|
.setEnabled(true)
|
||||||
|
.setUnindexedFilteringRetrieve(true)
|
||||||
|
.build())
|
||||||
.build())
|
.build())
|
||||||
.get();
|
.get();
|
||||||
```
|
```
|
||||||
|
|||||||
+5
-6
@@ -1,10 +1,9 @@
|
|||||||
```python
|
```python
|
||||||
from qdrant_client import QdrantClient, models
|
client.update_collection(
|
||||||
|
|
||||||
client = QdrantClient(url="http://localhost:6333")
|
|
||||||
|
|
||||||
client.create_collection(
|
|
||||||
collection_name="{collection_name}",
|
collection_name="{collection_name}",
|
||||||
strict_mode_config=models.StrictModeConfig(enabled=True, unindexed_filtering_retrieve=True),
|
strict_mode_config=models.StrictModeConfig(
|
||||||
|
enabled=True,
|
||||||
|
unindexed_filtering_retrieve=True,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|||||||
+8
-7
@@ -1,13 +1,14 @@
|
|||||||
```rust
|
```rust
|
||||||
use qdrant_client::Qdrant;
|
use qdrant_client::qdrant::{UpdateCollectionBuilder, StrictModeConfigBuilder};
|
||||||
use qdrant_client::qdrant::{CreateCollectionBuilder, StrictModeConfigBuilder};
|
|
||||||
|
|
||||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
|
||||||
|
|
||||||
client
|
client
|
||||||
.create_collection(
|
.update_collection(
|
||||||
CreateCollectionBuilder::new("{collection_name}")
|
UpdateCollectionBuilder::new("{collection_name}")
|
||||||
.strict_mode_config(StrictModeConfigBuilder::default().enabled(true).unindexed_filtering_retrieve(true)),
|
.strict_mode_config(
|
||||||
|
StrictModeConfigBuilder::default()
|
||||||
|
.enabled(true)
|
||||||
|
.unindexed_filtering_retrieve(true),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
```
|
```
|
||||||
|
|||||||
+1
-5
@@ -1,9 +1,5 @@
|
|||||||
```typescript
|
```typescript
|
||||||
import { QdrantClient } from "@qdrant/js-client-rest";
|
client.updateCollection("{collection_name}", {
|
||||||
|
|
||||||
const client = new QdrantClient({ host: "localhost", port: 6333 });
|
|
||||||
|
|
||||||
client.createCollection("{collection_name}", {
|
|
||||||
strict_mode_config: {
|
strict_mode_config: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
unindexed_filtering_retrieve: true,
|
unindexed_filtering_retrieve: true,
|
||||||
|
|||||||
+4
-2
@@ -7,14 +7,16 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func Main() {
|
func Main() {
|
||||||
|
// @hide-start
|
||||||
client, err := qdrant.NewClient(&qdrant.Config{
|
client, err := qdrant.NewClient(&qdrant.Config{
|
||||||
Host: "localhost",
|
Host: "localhost",
|
||||||
Port: 6334,
|
Port: 6334,
|
||||||
})
|
})
|
||||||
|
|
||||||
if err != nil { panic(err) } // @hide
|
if err != nil { panic(err) }
|
||||||
|
// @hide-end
|
||||||
|
|
||||||
client.CreateCollection(context.Background(), &qdrant.CreateCollection{
|
client.UpdateCollection(context.Background(), &qdrant.UpdateCollection{
|
||||||
CollectionName: "{collection_name}",
|
CollectionName: "{collection_name}",
|
||||||
StrictModeConfig: &qdrant.StrictModeConfig{
|
StrictModeConfig: &qdrant.StrictModeConfig{
|
||||||
Enabled: qdrant.PtrOf(true),
|
Enabled: qdrant.PtrOf(true),
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
```http
|
```http
|
||||||
PUT /collections/{collection_name}
|
PATCH /collections/{collection_name}
|
||||||
{
|
{
|
||||||
"strict_mode_config": {
|
"strict_mode_config": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
|
|||||||
+13
-6
@@ -2,20 +2,27 @@ package com.example.snippets_amalgamation;
|
|||||||
|
|
||||||
import io.qdrant.client.QdrantClient;
|
import io.qdrant.client.QdrantClient;
|
||||||
import io.qdrant.client.QdrantGrpcClient;
|
import io.qdrant.client.QdrantGrpcClient;
|
||||||
import io.qdrant.client.grpc.Collections.CreateCollection;
|
import io.qdrant.client.grpc.Collections.UpdateCollection;
|
||||||
import io.qdrant.client.grpc.Collections.StrictModeConfig;
|
import io.qdrant.client.grpc.Collections.StrictModeConfig;
|
||||||
|
|
||||||
public class Snippet {
|
public class Snippet {
|
||||||
public static void run() throws Exception {
|
public static void run() throws Exception {
|
||||||
QdrantClient client =
|
// @hide-start
|
||||||
new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build());
|
QdrantClient client = new QdrantClient(
|
||||||
|
QdrantGrpcClient
|
||||||
|
.newBuilder("localhost", 6334, false)
|
||||||
|
.build());
|
||||||
|
// @hide-end
|
||||||
|
|
||||||
client
|
client
|
||||||
.createCollectionAsync(
|
.updateCollectionAsync(
|
||||||
CreateCollection.newBuilder()
|
UpdateCollection.newBuilder()
|
||||||
.setCollectionName("{collection_name}")
|
.setCollectionName("{collection_name}")
|
||||||
.setStrictModeConfig(
|
.setStrictModeConfig(
|
||||||
StrictModeConfig.newBuilder().setEnabled(true).setUnindexedFilteringRetrieve(true).build())
|
StrictModeConfig.newBuilder()
|
||||||
|
.setEnabled(true)
|
||||||
|
.setUnindexedFilteringRetrieve(true)
|
||||||
|
.build())
|
||||||
.build())
|
.build())
|
||||||
.get();
|
.get();
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-4
@@ -1,8 +1,11 @@
|
|||||||
from qdrant_client import QdrantClient, models
|
from qdrant_client import QdrantClient, models # @hide
|
||||||
|
|
||||||
client = QdrantClient(url="http://localhost:6333")
|
client = QdrantClient(url="http://localhost:6333") # @hide
|
||||||
|
|
||||||
client.create_collection(
|
client.update_collection(
|
||||||
collection_name="{collection_name}",
|
collection_name="{collection_name}",
|
||||||
strict_mode_config=models.StrictModeConfig(enabled=True, unindexed_filtering_retrieve=True),
|
strict_mode_config=models.StrictModeConfig(
|
||||||
|
enabled=True,
|
||||||
|
unindexed_filtering_retrieve=True,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|||||||
+9
-6
@@ -1,13 +1,16 @@
|
|||||||
use qdrant_client::Qdrant;
|
use qdrant_client::qdrant::{UpdateCollectionBuilder, StrictModeConfigBuilder};
|
||||||
use qdrant_client::qdrant::{CreateCollectionBuilder, StrictModeConfigBuilder};
|
|
||||||
|
|
||||||
pub async fn main() -> anyhow::Result<()> {
|
pub async fn main() -> anyhow::Result<()> {
|
||||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
let client = qdrant_client::Qdrant::from_url("http://localhost:6334").build()?; // @hide
|
||||||
|
|
||||||
client
|
client
|
||||||
.create_collection(
|
.update_collection(
|
||||||
CreateCollectionBuilder::new("{collection_name}")
|
UpdateCollectionBuilder::new("{collection_name}")
|
||||||
.strict_mode_config(StrictModeConfigBuilder::default().enabled(true).unindexed_filtering_retrieve(true)),
|
.strict_mode_config(
|
||||||
|
StrictModeConfigBuilder::default()
|
||||||
|
.enabled(true)
|
||||||
|
.unindexed_filtering_retrieve(true),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -1,8 +1,8 @@
|
|||||||
import { QdrantClient } from "@qdrant/js-client-rest";
|
import { QdrantClient } from "@qdrant/js-client-rest"; // @hide
|
||||||
|
|
||||||
const client = new QdrantClient({ host: "localhost", port: 6333 });
|
const client = new QdrantClient({ host: "localhost", port: 6333 }); // @hide
|
||||||
|
|
||||||
client.createCollection("{collection_name}", {
|
client.updateCollection("{collection_name}", {
|
||||||
strict_mode_config: {
|
strict_mode_config: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
unindexed_filtering_retrieve: true,
|
unindexed_filtering_retrieve: true,
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ Setting `unindexed_filtering_retrieve` to false prevents retrieving points by fi
|
|||||||
|
|
||||||
{{< code-snippet path="/documentation/headless/snippets/strict-mode/unindexed-filtering-retrieve/" >}}
|
{{< code-snippet path="/documentation/headless/snippets/strict-mode/unindexed-filtering-retrieve/" >}}
|
||||||
|
|
||||||
Or turn it off later on an existing collection through the [collection update](#update-collection-parameters) API.
|
Or turn it off later on an existing collection through the [update collection parameters](/documentation/manage-data/collections/#update-collection-parameters) API.
|
||||||
|
|
||||||
{{< code-snippet path="/documentation/headless/snippets/strict-mode/unindexed-filtering-retrieve-off/" >}}
|
{{< code-snippet path="/documentation/headless/snippets/strict-mode/unindexed-filtering-retrieve-off/" >}}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user