Shortcode for rendering code snippets from separate markdown files (#1548)

* shortcode for rendering code snippets from separate markdown files

* formatted code

* fix and readme

* semi-automatically extracts snippets from markdown

* extract snippets from points.md

* extract snippets from vectors.md

* extract snippets from payload.md

* extract snippets from search.md + fixes

* extract snippets from explore.md

* extract snippets from hybrid-queries.md + mode query by id into search

* extract snippets from filtering.md

* extract snippets from storage.md + update outdated info

* extract snippets from indexing.md

* extract snippets from snapshots.md

* extract snippets from guides/optimize.md

* extract snippets from guides/multiple-partitions.md + fix aside note

* extract snippets from guides/quantization.md

* use auto-generated descriptions

* order json snippets first

---------

Co-authored-by: generall <andrey@vasnetsov.com>
This commit is contained in:
trean
2025-04-07 00:40:39 +02:00
committed by GitHub
co-authored by generall
parent 28a16b3966
commit 784f11cba4
1160 changed files with 17100 additions and 17966 deletions
@@ -0,0 +1 @@
This code snippet shows an example of using filters to delete specific keys from a payload based on defined criteria. In this example, it showcases how to delete keys "color" and "price" where the "color" key matches the value "red".
@@ -0,0 +1,12 @@
```csharp
using Qdrant.Client;
using static Qdrant.Client.Grpc.Conditions;
var client = new QdrantClient("localhost", 6334);
await client.DeletePayloadAsync(
collectionName: "{collection_name}",
keys: ["color", "price"],
filter: MatchKeyword("color", "red")
);
```
@@ -0,0 +1,22 @@
```go
import (
"context"
"github.com/qdrant/go-client/qdrant"
)
client, err := qdrant.NewClient(&qdrant.Config{
Host: "localhost",
Port: 6334,
})
client.DeletePayload(context.Background(), &qdrant.DeletePayloadPoints{
CollectionName: "{collection_name}",
Keys: []string{"color", "price"},
PointsSelector: qdrant.NewPointsSelectorFilter(
&qdrant.Filter{
Must: []*qdrant.Condition{qdrant.NewMatch("color", "red")},
},
),
})
```
@@ -0,0 +1,16 @@
```http
POST /collections/{collection_name}/points/payload/delete
{
"keys": ["color", "price"],
"filter": {
"must": [
{
"key": "color",
"match": {
"value": "red"
}
}
]
}
}
```
@@ -0,0 +1,15 @@
```java
import java.util.List;
import static io.qdrant.client.ConditionFactory.matchKeyword;
client
.deletePayloadAsync(
"{collection_name}",
List.of("color", "price"),
Filter.newBuilder().addMust(matchKeyword("color", "red")).build(),
true,
null,
null)
.get();
```
@@ -0,0 +1,14 @@
```python
client.delete_payload(
collection_name="{collection_name}",
keys=["color", "price"],
points=models.Filter(
must=[
models.FieldCondition(
key="color",
match=models.MatchValue(value="red"),
),
],
),
)
```
@@ -0,0 +1,17 @@
```rust
use qdrant_client::qdrant::{Condition, DeletePayloadPointsBuilder, Filter};
client
.delete_payload(
DeletePayloadPointsBuilder::new(
"{collection_name}",
vec!["color".to_string(), "price".to_string()],
)
.points_selector(Filter::must([Condition::matches(
"color",
"red".to_string(),
)]))
.wait(true),
)
.await?;
```
@@ -0,0 +1,15 @@
```typescript
client.deletePayload("{collection_name}", {
keys: ["color", "price"],
filter: {
must: [
{
key: "color",
match: {
value: "red",
},
},
],
},
});
```
@@ -0,0 +1 @@
This code snippet pertains to deleting specific keys from the payload of points. It specifies the keys to be deleted as 'color' and 'price' from the points with IDs 0, 3, and 100 within a collection.
@@ -0,0 +1,11 @@
```csharp
using Qdrant.Client;
var client = new QdrantClient("localhost", 6334);
await client.DeletePayloadAsync(
collectionName: "{collection_name}",
keys: ["color", "price"],
ids: new ulong[] { 0, 3, 100 }
);
```
@@ -0,0 +1,20 @@
```go
import (
"context"
"github.com/qdrant/go-client/qdrant"
)
client, err := qdrant.NewClient(&qdrant.Config{
Host: "localhost",
Port: 6334,
})
client.DeletePayload(context.Background(), &qdrant.DeletePayloadPoints{
CollectionName: "{collection_name}",
Keys: []string{"color", "price"},
PointsSelector: qdrant.NewPointsSelector(
qdrant.NewIDNum(0),
qdrant.NewIDNum(3)),
})
```
@@ -0,0 +1,7 @@
```http
POST /collections/{collection_name}/points/payload/delete
{
"keys": ["color", "price"],
"points": [0, 3, 100]
}
```
@@ -0,0 +1,15 @@
```java
import java.util.List;
import static io.qdrant.client.PointIdFactory.id;
client
.deletePayloadAsync(
"{collection_name}",
List.of("color", "price"),
List.of(id(0), id(3), id(100)),
true,
null,
null)
.get();
```
@@ -0,0 +1,7 @@
```python
client.delete_payload(
collection_name="{collection_name}",
keys=["color", "price"],
points=[0, 3, 100],
)
```
@@ -0,0 +1,16 @@
```rust
use qdrant_client::qdrant::{DeletePayloadPointsBuilder, PointsIdsList};
client
.delete_payload(
DeletePayloadPointsBuilder::new(
"{collection_name}",
vec!["color".to_string(), "price".to_string()],
)
.points_selector(PointsIdsList {
ids: vec![0.into(), 3.into(), 10.into()],
})
.wait(true),
)
.await?;
```
@@ -0,0 +1,6 @@
```typescript
client.deletePayload("{collection_name}", {
keys: ["color", "price"],
points: [0, 3, 100],
});
```