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 demonstrates an alternative way to specify and remove certain points from a collection by filtering based on a specific key-value pair. In this case, the filter is set to remove points with the key "color" that match the value "red".
@@ -0,0 +1,8 @@
```csharp
using Qdrant.Client;
using static Qdrant.Client.Grpc.Conditions;
var client = new QdrantClient("localhost", 6334);
await client.DeleteAsync(collectionName: "{collection_name}", filter: MatchKeyword("color", "red"));
```
@@ -0,0 +1,23 @@
```go
import (
"context"
"github.com/qdrant/go-client/qdrant"
)
client, err := qdrant.NewClient(&qdrant.Config{
Host: "localhost",
Port: 6334,
})
client.Delete(context.Background(), &qdrant.DeletePoints{
CollectionName: "{collection_name}",
Points: qdrant.NewPointsSelectorFilter(
&qdrant.Filter{
Must: []*qdrant.Condition{
qdrant.NewMatch("color", "red"),
},
},
),
})
```
@@ -0,0 +1,15 @@
```http
POST /collections/{collection_name}/points/delete
{
"filter": {
"must": [
{
"key": "color",
"match": {
"value": "red"
}
}
]
}
}
```
@@ -0,0 +1,11 @@
```java
import static io.qdrant.client.ConditionFactory.matchKeyword;
import io.qdrant.client.grpc.Points.Filter;
client
.deleteAsync(
"{collection_name}",
Filter.newBuilder().addMust(matchKeyword("color", "red")).build())
.get();
```
@@ -0,0 +1,15 @@
```python
client.delete(
collection_name="{collection_name}",
points_selector=models.FilterSelector(
filter=models.Filter(
must=[
models.FieldCondition(
key="color",
match=models.MatchValue(value="red"),
),
],
)
),
)
```
@@ -0,0 +1,14 @@
```rust
use qdrant_client::qdrant::{Condition, DeletePointsBuilder, Filter};
client
.delete_points(
DeletePointsBuilder::new("{collection_name}")
.points(Filter::must([Condition::matches(
"color",
"red".to_string(),
)]))
.wait(true),
)
.await?;
```
@@ -0,0 +1,14 @@
```typescript
client.delete("{collection_name}", {
filter: {
must: [
{
key: "color",
match: {
value: "red",
},
},
],
},
});
```
@@ -0,0 +1 @@
This code represents a task to delete specific points from a collection. The API endpoint allows you to send a POST request to delete points with the specified indexes (0, 3, and 100) from a collection specified by its name.
@@ -0,0 +1,7 @@
```csharp
using Qdrant.Client;
var client = new QdrantClient("localhost", 6334);
await client.DeleteAsync(collectionName: "{collection_name}", ids: [0, 3, 100]);
```
@@ -0,0 +1,19 @@
```go
import (
"context"
"github.com/qdrant/go-client/qdrant"
)
client, err := qdrant.NewClient(&qdrant.Config{
Host: "localhost",
Port: 6334,
})
client.Delete(context.Background(), &qdrant.DeletePoints{
CollectionName: "{collection_name}",
Points: qdrant.NewPointsSelector(
qdrant.NewIDNum(0), qdrant.NewIDNum(3), qdrant.NewIDNum(100),
),
})
```
@@ -0,0 +1,6 @@
```http
POST /collections/{collection_name}/points/delete
{
"points": [0, 3, 100]
}
```
@@ -0,0 +1,7 @@
```java
import java.util.List;
import static io.qdrant.client.PointIdFactory.id;
client.deleteAsync("{collection_name}", List.of(id(0), id(3), id(100)));
```
@@ -0,0 +1,8 @@
```python
client.delete(
collection_name="{collection_name}",
points_selector=models.PointIdsList(
points=[0, 3, 100],
),
)
```
@@ -0,0 +1,13 @@
```rust
use qdrant_client::qdrant::{DeletePointsBuilder, PointsIdsList};
client
.delete_points(
DeletePointsBuilder::new("{collection_name}")
.points(PointsIdsList {
ids: vec![0.into(), 3.into(), 100.into()],
})
.wait(true),
)
.await?;
```
@@ -0,0 +1,5 @@
```typescript
client.delete("{collection_name}", {
points: [0, 3, 100],
});
```