mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-05 02:48:30 +02:00
Automated snippet conversion by scripts
These changes are purely mechanical to differentiate them from manual fixes/adjustments made in the next commit. This results in broken code as some snippets contain errors. Made in four steps: 1. Run ./migrate-snippet.py that converts `.md` files to code files and perhaps adds missing lines under `// @hide` comments. 2. Sort Java imports. 3. Remove old `.md` files. 4. Run ./generate.md to produce `*/generated/*.md` files.
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
||||
```csharp
|
||||
using Qdrant.Client;
|
||||
using Qdrant.Client.Grpc;
|
||||
|
||||
var client = new QdrantClient("localhost", 6334);
|
||||
|
||||
await client.QueryAsync(
|
||||
collectionName: "{collection_name}",
|
||||
prefetch: new List<PrefetchQuery>
|
||||
{
|
||||
// 2+ prefetches here
|
||||
},
|
||||
query: new Rrf
|
||||
{
|
||||
K = 60,
|
||||
}
|
||||
);
|
||||
```
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
```go
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/qdrant/go-client/qdrant"
|
||||
)
|
||||
|
||||
client, err := qdrant.NewClient(&qdrant.Config{
|
||||
Host: "localhost",
|
||||
Port: 6334,
|
||||
})
|
||||
|
||||
client.Query(context.Background(), &qdrant.QueryPoints{
|
||||
CollectionName: "{collection_name}",
|
||||
Prefetch: []*qdrant.PrefetchQuery{
|
||||
// 2+ prefetches here
|
||||
},
|
||||
Query: qdrant.NewQueryRRF(
|
||||
&qdrant.Rrf{
|
||||
K: qdrant.PtrOf(uint32(60)),
|
||||
}),
|
||||
})
|
||||
```
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
```java
|
||||
import static io.qdrant.client.QueryFactory.rrf;
|
||||
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Points.PrefetchQuery;
|
||||
import io.qdrant.client.grpc.Points.QueryPoints;
|
||||
import io.qdrant.client.grpc.Points.Rrf;
|
||||
import java.util.List;
|
||||
|
||||
QdrantClient client = new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build());
|
||||
|
||||
client
|
||||
.queryAsync(
|
||||
QueryPoints.newBuilder()
|
||||
.setCollectionName("{collection_name}")
|
||||
// .addPrefetch(...) <┐
|
||||
// .addPrefetch(...) <┴─ 2+ prefetches here
|
||||
.setQuery(rrf(Rrf.newBuilder().setK(60).build()))
|
||||
.build())
|
||||
.get();
|
||||
```
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
```python
|
||||
from qdrant_client import QdrantClient, models
|
||||
|
||||
client = QdrantClient(url="http://localhost:6333")
|
||||
|
||||
client.query_points(
|
||||
collection_name="{collection_name}",
|
||||
prefetch=[
|
||||
# 2+ prefetches here
|
||||
],
|
||||
query=models.RrfQuery(rrf=models.Rrf(k=60)),
|
||||
)
|
||||
```
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
```rust
|
||||
use qdrant_client::Qdrant;
|
||||
use qdrant_client::qdrant::{Rrf, PrefetchQueryBuilder, Query, QueryPointsBuilder};
|
||||
|
||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
|
||||
client.query(
|
||||
QueryPointsBuilder::new("{collection_name}")
|
||||
// .add_prefetch(...) <┐
|
||||
// .add_prefetch(...) <┴─ 2+ prefetches here
|
||||
.query(Query::new_rrf(RrfBuilder::with_k(60))
|
||||
).await?;
|
||||
```
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
```typescript
|
||||
import { QdrantClient } from "@qdrant/js-client-rest";
|
||||
|
||||
const client = new QdrantClient({ host: "localhost", port: 6333 });
|
||||
|
||||
client.query("{collection_name}", {
|
||||
prefetch: [
|
||||
// 2+ prefetches here
|
||||
],
|
||||
query: { rrf: { k: 60 } },
|
||||
});
|
||||
```
|
||||
Reference in New Issue
Block a user