mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-06 11:28:31 +02:00
Regenerate snippet .md files
Run `./generate-md.py` to update generated markdown files after semi-manual changes made in the previous commit. This commit serves as a gist of fixed issues found in snippets. (it's easier to review 250 lines diff rather than 31k lines diff, isn't it?)
This commit is contained in:
+2
-1
@@ -11,6 +11,7 @@ import io.qdrant.client.grpc.Points.PointsUpdateOperation.ClearPayload;
|
||||
import io.qdrant.client.grpc.Points.PointsUpdateOperation.DeletePayload;
|
||||
import io.qdrant.client.grpc.Points.PointsUpdateOperation.DeletePoints;
|
||||
import io.qdrant.client.grpc.Points.PointsUpdateOperation.DeleteVectors;
|
||||
import io.qdrant.client.grpc.Points.PointsUpdateOperation.OverwritePayload;
|
||||
import io.qdrant.client.grpc.Points.PointsUpdateOperation.PointStructList;
|
||||
import io.qdrant.client.grpc.Points.PointsUpdateOperation.SetPayload;
|
||||
import io.qdrant.client.grpc.Points.PointsUpdateOperation.UpdateVectors;
|
||||
@@ -55,7 +56,7 @@ client
|
||||
.build(),
|
||||
PointsUpdateOperation.newBuilder()
|
||||
.setOverwritePayload(
|
||||
SetPayload.newBuilder()
|
||||
OverwritePayload.newBuilder()
|
||||
.setPointsSelector(
|
||||
PointsSelector.newBuilder()
|
||||
.setPoints(PointsIdsList.newBuilder().addIds(id(1)).build())
|
||||
|
||||
+9
-7
@@ -7,6 +7,7 @@ import io.qdrant.client.grpc.Collections.SparseVectorParams;
|
||||
import io.qdrant.client.grpc.Collections.VectorParams;
|
||||
import io.qdrant.client.grpc.Collections.VectorParamsMap;
|
||||
import io.qdrant.client.grpc.Collections.VectorsConfig;
|
||||
import java.util.Map;
|
||||
|
||||
client
|
||||
.createCollectionAsync(
|
||||
@@ -23,13 +24,14 @@ client
|
||||
.setSize(384)
|
||||
.setDistance(Distance.Cosine)
|
||||
.build())))
|
||||
.setSparseVectorsConfig(
|
||||
SparseVectorConfig.newBuilder()
|
||||
.putMap(
|
||||
"bm25_sparse_vector",
|
||||
SparseVectorParams.newBuilder()
|
||||
.setModifier(Modifier.Idf)
|
||||
.build())))
|
||||
.build())
|
||||
.setSparseVectorsConfig(
|
||||
SparseVectorConfig.newBuilder()
|
||||
.putMap(
|
||||
"bm25_sparse_vector",
|
||||
SparseVectorParams.newBuilder()
|
||||
.setModifier(Modifier.Idf)
|
||||
.build()))
|
||||
.build())
|
||||
.get();
|
||||
```
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
```csharp
|
||||
var queryText = "What is relapsing polychondritis?"
|
||||
var queryText = "What is relapsing polychondritis?";
|
||||
```
|
||||
|
||||
+1
-5
@@ -1,9 +1,5 @@
|
||||
```go
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/qdrant/go-client/qdrant"
|
||||
)
|
||||
import "github.com/qdrant/go-client/qdrant"
|
||||
|
||||
client, err := qdrant.NewClient(&qdrant.Config{
|
||||
Host: "xyz-example.cloud-region.cloud-provider.cloud.qdrant.io",
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
```python
|
||||
from qdrant_client import QdrantClient
|
||||
|
||||
qdrant_client = QdrantClient(
|
||||
client = QdrantClient(
|
||||
"xyz-example.cloud-region.cloud-provider.cloud.qdrant.io",
|
||||
api_key="<paste-your-api-key-here>",
|
||||
cloud_inference=True,
|
||||
timeout=30.0
|
||||
timeout=30,
|
||||
)
|
||||
```
|
||||
|
||||
-2
@@ -1,7 +1,5 @@
|
||||
```rust
|
||||
use qdrant_client::Qdrant;
|
||||
use qdrant_client::qdrant::{Document};
|
||||
use qdrant_client::qdrant::{PointStruct, UpsertPointsBuilder};
|
||||
|
||||
let client = Qdrant::from_url("https://xyz-example.qdrant.io:6334")
|
||||
.api_key("<paste-your-api-key-here>")
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ prefetch := []*qdrant.PrefetchQuery{
|
||||
},
|
||||
}
|
||||
|
||||
client.Query(ctx, &qdrant.QueryPoints{
|
||||
client.Query(context.Background(), &qdrant.QueryPoints{
|
||||
CollectionName: "{collection_name}",
|
||||
Prefetch: prefetch,
|
||||
Query: qdrant.NewQueryFusion(qdrant.Fusion_RRF),
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@ results = client.query_points(
|
||||
collection_name="{collection_name}",
|
||||
prefetch=[
|
||||
models.Prefetch(
|
||||
query=Document(
|
||||
query=models.Document(
|
||||
text=query_text,
|
||||
model=dense_model
|
||||
),
|
||||
@@ -11,7 +11,7 @@ results = client.query_points(
|
||||
limit=5
|
||||
),
|
||||
models.Prefetch(
|
||||
query=Document(
|
||||
query=models.Document(
|
||||
text=query_text,
|
||||
model=bm25_model
|
||||
),
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ let bm25_prefetch = PrefetchQueryBuilder::default()
|
||||
.using("bm25_sparse_vector")
|
||||
.build();
|
||||
|
||||
let query_request = QueryPointsBuilder::new(collection_name)
|
||||
let query_request = QueryPointsBuilder::new("{collection_name}")
|
||||
.add_prefetch(dense_prefetch)
|
||||
.add_prefetch(bm25_prefetch)
|
||||
.query(Query::new_fusion(Fusion::Rrf))
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
```typescript
|
||||
const results = await client.query(collectionName, {
|
||||
const results = await client.query("{collection_name}", {
|
||||
prefetch: [
|
||||
{
|
||||
query: {
|
||||
|
||||
+2
-2
@@ -23,8 +23,8 @@ for _, item := range dataset {
|
||||
}
|
||||
points = append(points, point)
|
||||
}
|
||||
_, err = client.Upsert(ctx, &qdrant.UpsertPoints{
|
||||
CollectionName: "{collection_name},
|
||||
_, err = client.Upsert(context.Background(), &qdrant.UpsertPoints{
|
||||
CollectionName: "{collection_name}",
|
||||
Points: points,
|
||||
})
|
||||
```
|
||||
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
```java
|
||||
import static io.qdrant.client.PointIdFactory.id;
|
||||
import static io.qdrant.client.VectorFactory.vector;
|
||||
import static io.qdrant.client.VectorsFactory.namedVectors;
|
||||
import static io.qdrant.client.VectorsFactory.vectors;
|
||||
|
||||
import io.qdrant.client.grpc.Points.Document;
|
||||
import io.qdrant.client.grpc.Points.PointStruct;
|
||||
@@ -26,10 +26,10 @@ for (Map<String, String> item : dataset) {
|
||||
namedVectors(
|
||||
Map.of(
|
||||
"dense_vector",
|
||||
vectors(
|
||||
vector(
|
||||
Document.newBuilder().setText(passage).setModel(denseModel).build()),
|
||||
"bm25_sparse_vector",
|
||||
vectors(
|
||||
vector(
|
||||
Document.newBuilder().setText(passage).setModel(bm25Model).build()))))
|
||||
.build();
|
||||
points.add(point);
|
||||
|
||||
+2
-1
@@ -3,6 +3,7 @@ use qdrant_client::qdrant::{
|
||||
Document, NamedVectors, PointStruct, UpsertPointsBuilder,
|
||||
};
|
||||
use qdrant_client::Payload;
|
||||
use uuid::Uuid;
|
||||
|
||||
let dense_model = "sentence-transformers/all-minilm-l6-v2";
|
||||
let bm25_model = "qdrant/bm25";
|
||||
@@ -29,6 +30,6 @@ let points: Vec<PointStruct> = dataset
|
||||
.collect();
|
||||
|
||||
client
|
||||
.upsert_points(UpsertPointsBuilder::new(collection_name, points))
|
||||
.upsert_points(UpsertPointsBuilder::new("{collection_name}", points))
|
||||
.await?;
|
||||
```
|
||||
|
||||
+1
@@ -1,5 +1,6 @@
|
||||
```java
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Collections.Datatype;
|
||||
import io.qdrant.client.grpc.Collections.Distance;
|
||||
import io.qdrant.client.grpc.Collections.VectorParams;
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
use qdrant_client::qdrant::{
|
||||
CreateCollectionBuilder, Modifier, SparseVectorParamsBuilder, SparseVectorsConfigBuilder,
|
||||
};
|
||||
use qdrant_client::{Qdrant, QdrantError};
|
||||
use qdrant_client::Qdrant;
|
||||
|
||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ client.CreateCollection(context.Background(), &qdrant.CreateCollection{
|
||||
}),
|
||||
QuantizationConfig: qdrant.NewQuantizationBinary(
|
||||
&qdrant.BinaryQuantization{
|
||||
QueryEncoding: qdrant.NewBinaryQuantizationQueryEncodingSetting(BinaryQuantizationQueryEncoding_Scalar8Bits),
|
||||
QueryEncoding: qdrant.NewBinaryQuantizationQueryEncodingSetting(qdrant.BinaryQuantizationQueryEncoding_Scalar8Bits),
|
||||
AlwaysRam: qdrant.PtrOf(true),
|
||||
},
|
||||
),
|
||||
|
||||
+1
-1
@@ -1,9 +1,9 @@
|
||||
```rust
|
||||
use qdrant_client::Qdrant;
|
||||
use qdrant_client::qdrant::{
|
||||
BinaryQuantizationBuilder, CreateCollectionBuilder, Distance, HnswConfigDiffBuilder,
|
||||
VectorParamsBuilder,
|
||||
};
|
||||
use qdrant_client::Qdrant;
|
||||
|
||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ client.create_payload_index(
|
||||
collection_name="{collection_name}",
|
||||
field_name="name_of_the_field_to_index",
|
||||
field_schema=models.TextIndexParams(
|
||||
type="text",
|
||||
type=models.TextIndexType.TEXT,
|
||||
tokenizer=models.TokenizerType.WORD,
|
||||
ascii_folding=True,
|
||||
),
|
||||
|
||||
+3
-2
@@ -2,6 +2,7 @@
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Collections.IntegerIndexParams;
|
||||
import io.qdrant.client.grpc.Collections.KeywordIndexParams;
|
||||
import io.qdrant.client.grpc.Collections.PayloadIndexParams;
|
||||
import io.qdrant.client.grpc.Collections.PayloadSchemaType;
|
||||
|
||||
@@ -15,8 +16,8 @@ client
|
||||
PayloadSchemaType.Integer,
|
||||
PayloadIndexParams.newBuilder()
|
||||
.setIntegerIndexParams(
|
||||
KeywordIndexParams.newBuilder()
|
||||
.setIsPrincipa(true)
|
||||
IntegerIndexParams.newBuilder()
|
||||
.setIsPrincipal(true)
|
||||
.build())
|
||||
.build(),
|
||||
null,
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@ use qdrant_client::qdrant::{
|
||||
IntegerIndexParamsBuilder,
|
||||
FieldType
|
||||
};
|
||||
use qdrant_client::{Qdrant, QdrantError};
|
||||
use qdrant_client::Qdrant;
|
||||
|
||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
|
||||
@@ -18,5 +18,5 @@ client.create_field_index(
|
||||
IntegerIndexParamsBuilder::default()
|
||||
.is_principal(true),
|
||||
),
|
||||
);
|
||||
).await?;
|
||||
```
|
||||
|
||||
+2
-2
@@ -16,8 +16,8 @@ client.CreateFieldIndex(context.Background(), &qdrant.CreateFieldIndexCollection
|
||||
FieldType: qdrant.FieldType_FieldTypeInteger.Enum(),
|
||||
FieldIndexParams: qdrant.NewPayloadIndexParamsInt(
|
||||
&qdrant.IntegerIndexParams{
|
||||
Lookup: false,
|
||||
Range: true,
|
||||
Lookup: qdrant.PtrOf(false),
|
||||
Range: qdrant.PtrOf(true),
|
||||
}),
|
||||
})
|
||||
```
|
||||
|
||||
+4
-10
@@ -1,9 +1,8 @@
|
||||
```rust
|
||||
use qdrant_client::qdrant::{
|
||||
payload_index_params::IndexParams, CreateFieldIndexCollectionBuilder, FieldType,
|
||||
IntegerIndexParams, PayloadIndexParams,
|
||||
};
|
||||
use qdrant_client::Qdrant;
|
||||
use qdrant_client::qdrant::{
|
||||
CreateFieldIndexCollectionBuilder, FieldType, IntegerIndexParamsBuilder,
|
||||
};
|
||||
|
||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
|
||||
@@ -14,12 +13,7 @@ client
|
||||
"name_of_the_field_to_index",
|
||||
FieldType::Integer,
|
||||
)
|
||||
.field_index_params(PayloadIndexParams {
|
||||
index_params: Some(IndexParams::IntegerIndexParams(IntegerIndexParams {
|
||||
lookup: false,
|
||||
range: true,
|
||||
})),
|
||||
}),
|
||||
.field_index_params(IntegerIndexParamsBuilder::new(false, true).build()),
|
||||
)
|
||||
.await?;
|
||||
```
|
||||
|
||||
+3
-2
@@ -4,7 +4,8 @@ use qdrant_client::qdrant::{
|
||||
KeywordIndexParamsBuilder,
|
||||
FieldType
|
||||
};
|
||||
use qdrant_client::{Qdrant, QdrantError};
|
||||
|
||||
use qdrant_client::Qdrant;
|
||||
|
||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
|
||||
@@ -18,5 +19,5 @@ client.create_field_index(
|
||||
KeywordIndexParamsBuilder::default()
|
||||
.is_tenant(true),
|
||||
),
|
||||
);
|
||||
).await?;
|
||||
```
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@ use qdrant_client::qdrant::{
|
||||
KeywordIndexParamsBuilder,
|
||||
FieldType
|
||||
};
|
||||
use qdrant_client::{Qdrant, QdrantError};
|
||||
use qdrant_client::Qdrant;
|
||||
|
||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
|
||||
@@ -18,5 +18,5 @@ client.create_field_index(
|
||||
KeywordIndexParamsBuilder::default()
|
||||
.on_disk(true),
|
||||
),
|
||||
);
|
||||
).await?;
|
||||
```
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ client.create_payload_index(
|
||||
collection_name="{collection_name}",
|
||||
field_name="name_of_the_field_to_index",
|
||||
field_schema=models.TextIndexParams(
|
||||
type="text",
|
||||
type=models.TextIndexType.TEXT,
|
||||
tokenizer=models.TokenizerType.WORD,
|
||||
lowercase=False,
|
||||
),
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ client.create_payload_index(
|
||||
collection_name="{collection_name}",
|
||||
field_name="name_of_the_field_to_index",
|
||||
field_schema=models.TextIndexParams(
|
||||
type="text",
|
||||
type=models.TextIndexType.TEXT,
|
||||
tokenizer=models.TokenizerType.WORD,
|
||||
lowercase=True,
|
||||
phrase_matching=True,
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ client.create_payload_index(
|
||||
collection_name="{collection_name}",
|
||||
field_name="name_of_the_field_to_index",
|
||||
field_schema=models.TextIndexParams(
|
||||
type="text",
|
||||
type=models.TextIndexType.TEXT,
|
||||
tokenizer=models.TokenizerType.WORD,
|
||||
min_token_len=2,
|
||||
max_token_len=10,
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ client.create_payload_index(
|
||||
collection_name="{collection_name}",
|
||||
field_name="name_of_the_field_to_index",
|
||||
field_schema=models.TextIndexParams(
|
||||
type="text",
|
||||
type=models.TextIndexType.TEXT,
|
||||
tokenizer=models.TokenizerType.WORD,
|
||||
stemmer=models.SnowballParams(
|
||||
type=models.Snowball.SNOWBALL,
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@ client.create_payload_index(
|
||||
collection_name="{collection_name}",
|
||||
field_name="name_of_the_field_to_index",
|
||||
field_schema=models.TextIndexParams(
|
||||
type="text",
|
||||
type=models.TextIndexType.TEXT,
|
||||
tokenizer=models.TokenizerType.WORD,
|
||||
stopwords=models.Language.ENGLISH,
|
||||
),
|
||||
@@ -19,7 +19,7 @@ client.create_payload_index(
|
||||
collection_name="{collection_name}",
|
||||
field_name="name_of_the_field_to_index",
|
||||
field_schema=models.TextIndexParams(
|
||||
type="text",
|
||||
type=models.TextIndexType.TEXT,
|
||||
tokenizer=models.TokenizerType.WORD,
|
||||
stopwords=models.StopwordsSet(
|
||||
languages=[
|
||||
|
||||
+1
@@ -1,5 +1,6 @@
|
||||
```csharp
|
||||
using Qdrant.Client;
|
||||
using Qdrant.Client.Grpc;
|
||||
|
||||
var client = new QdrantClient("localhost", 6334);
|
||||
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ client.create_payload_index(
|
||||
collection_name="{collection_name}",
|
||||
field_name="group_id",
|
||||
field_schema=models.KeywordIndexParams(
|
||||
type="keyword",
|
||||
type=models.KeywordIndexType.KEYWORD,
|
||||
is_tenant=True,
|
||||
),
|
||||
)
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ use qdrant_client::qdrant::{
|
||||
KeywordIndexParamsBuilder,
|
||||
FieldType
|
||||
};
|
||||
use qdrant_client::{Qdrant, QdrantError};
|
||||
use qdrant_client::Qdrant;
|
||||
|
||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
|
||||
|
||||
+2
-2
@@ -15,7 +15,7 @@ client.CreateShardKey(
|
||||
"{collection_name}",
|
||||
&qdrant.CreateShardKey{
|
||||
ShardKey: qdrant.NewShardKey("default"),
|
||||
InitialState: qdrant.ReplicaState_PARTIAL,
|
||||
}
|
||||
InitialState: qdrant.PtrOf(qdrant.ReplicaState_Partial),
|
||||
},
|
||||
)
|
||||
```
|
||||
|
||||
+2
-1
@@ -6,6 +6,7 @@ import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Collections.CreateShardKey;
|
||||
import io.qdrant.client.grpc.Collections.CreateShardKeyRequest;
|
||||
import io.qdrant.client.grpc.Collections.ReplicaState;
|
||||
import io.qdrant.client.grpc.Common.Filter;
|
||||
|
||||
QdrantClient client =
|
||||
new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build());
|
||||
@@ -14,7 +15,7 @@ client.createShardKeyAsync(CreateShardKeyRequest.newBuilder()
|
||||
.setCollectionName("{collection_name}")
|
||||
.setRequest(CreateShardKey.newBuilder()
|
||||
.setShardKey(shardKey("default"))
|
||||
.setInitialState(ReplicaState.PARTIAL)
|
||||
.setInitialState(ReplicaState.Partial)
|
||||
.build())
|
||||
.build()).get();
|
||||
```
|
||||
|
||||
+1
@@ -1,6 +1,7 @@
|
||||
```java
|
||||
import static io.qdrant.client.ConditionFactory.matchKeyword;
|
||||
|
||||
import io.qdrant.client.grpc.Common.Filter;
|
||||
import java.util.List;
|
||||
|
||||
client
|
||||
|
||||
+1
-1
@@ -3,5 +3,5 @@ using Qdrant.Client;
|
||||
|
||||
var client = new QdrantClient("localhost", 6334);
|
||||
|
||||
await client.DeleteAsync(collectionName: "{collection_name}", ids: [0, 3, 100]);
|
||||
await client.DeleteAsync(collectionName: "{collection_name}", ids: (ulong[])[0, 3, 100]);
|
||||
```
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ client, err := qdrant.NewClient(&qdrant.Config{
|
||||
|
||||
sample := uint64(10)
|
||||
limit := uint64(2)
|
||||
res, err := client.SearchMatrixPairs(ctx, &qdrant.SearchMatrixPoints{
|
||||
res, err := client.SearchMatrixPairs(context.Background(), &qdrant.SearchMatrixPoints{
|
||||
CollectionName: "{collection_name}",
|
||||
Sample: &sample,
|
||||
Limit: &limit,
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ QdrantClient client =
|
||||
|
||||
client
|
||||
.searchMatrixPairsAsync(
|
||||
Points.SearchMatrixPoints.newBuilder()
|
||||
SearchMatrixPoints.newBuilder()
|
||||
.setCollectionName("{collection_name}")
|
||||
.setFilter(Filter.newBuilder().addMust(matchKeyword("color", "red")).build())
|
||||
.setSample(10)
|
||||
|
||||
-1
@@ -1,6 +1,5 @@
|
||||
```rust
|
||||
use qdrant_client::qdrant::{Condition, Filter, SearchMatrixPointsBuilder};
|
||||
use qdrant_client::Qdrant;
|
||||
|
||||
client
|
||||
.search_matrix_pairs(
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ client, err := qdrant.NewClient(&qdrant.Config{
|
||||
|
||||
sample := uint64(10)
|
||||
limit := uint64(2)
|
||||
res, err := client.SearchMatrixOffsets(ctx, &qdrant.SearchMatrixPoints{
|
||||
res, err := client.SearchMatrixOffsets(context.Background(), &qdrant.SearchMatrixPoints{
|
||||
CollectionName: "{collection_name}",
|
||||
Sample: &sample,
|
||||
Limit: &limit,
|
||||
|
||||
-1
@@ -1,6 +1,5 @@
|
||||
```rust
|
||||
use qdrant_client::qdrant::{Condition, Filter, SearchMatrixPointsBuilder};
|
||||
use qdrant_client::Qdrant;
|
||||
|
||||
client
|
||||
.search_matrix_offsets(
|
||||
|
||||
+2
-1
@@ -1,9 +1,10 @@
|
||||
```csharp
|
||||
using Qdrant.Client;
|
||||
using Qdrant.Client.Grpc;
|
||||
|
||||
await client.FacetAsync(
|
||||
"{collection_name}",
|
||||
key: "size",
|
||||
exact: true,
|
||||
exact: true
|
||||
);
|
||||
```
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
```go
|
||||
res, err := client.Facet(ctx, &qdrant.FacetCounts{
|
||||
res, err := client.Facet(context.Background(), &qdrant.FacetCounts{
|
||||
CollectionName: "{collection_name}",
|
||||
Key: "key",
|
||||
Exact: true,
|
||||
Exact: qdrant.PtrOf(true),
|
||||
})
|
||||
```
|
||||
|
||||
+4
-2
@@ -1,8 +1,10 @@
|
||||
```java
|
||||
import io.qdrant.client.grpc.Points.FacetCounts;
|
||||
|
||||
client
|
||||
.facetAsync(
|
||||
Points.FacetCounts.newBuilder()
|
||||
.setCollectionName(collection_name)
|
||||
FacetCounts.newBuilder()
|
||||
.setCollectionName("{collection_name}")
|
||||
.setKey("foo")
|
||||
.setExact(true)
|
||||
.build())
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ client, err := qdrant.NewClient(&qdrant.Config{
|
||||
Port: 6334,
|
||||
})
|
||||
|
||||
res, err := client.Facet(ctx, &qdrant.FacetCounts{
|
||||
res, err := client.Facet(context.Background(), &qdrant.FacetCounts{
|
||||
CollectionName: "{collection_name}",
|
||||
Key: "size",
|
||||
Filter: &qdrant.Filter{
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@ import static io.qdrant.client.ConditionFactory.matchKeyword;
|
||||
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Filter;
|
||||
import io.qdrant.client.grpc.Common.Filter;
|
||||
import io.qdrant.client.grpc.Points;
|
||||
|
||||
QdrantClient client = new QdrantClient(
|
||||
@@ -12,7 +12,7 @@ QdrantClient client = new QdrantClient(
|
||||
client
|
||||
.facetAsync(
|
||||
Points.FacetCounts.newBuilder()
|
||||
.setCollectionName(collection_name)
|
||||
.setCollectionName("{collection_name}")
|
||||
.setKey("size")
|
||||
.setFilter(Filter.newBuilder().addMust(matchKeyword("color", "red")).build())
|
||||
.build())
|
||||
|
||||
+8
-1
@@ -6,6 +6,13 @@ client = QdrantClient(url="http://localhost:6333")
|
||||
client.facet(
|
||||
collection_name="{collection_name}",
|
||||
key="size",
|
||||
facet_filter=models.Filter(must=[models.Match("color", "red")]),
|
||||
facet_filter=models.Filter(
|
||||
must=[
|
||||
models.FieldCondition(
|
||||
key="color",
|
||||
match=models.MatchValue(value="red"),
|
||||
)
|
||||
]
|
||||
),
|
||||
)
|
||||
```
|
||||
|
||||
+1
@@ -3,6 +3,7 @@ import static io.qdrant.client.ConditionFactory.geoPolygon;
|
||||
|
||||
import io.qdrant.client.grpc.Common.GeoLineString;
|
||||
import io.qdrant.client.grpc.Common.GeoPoint;
|
||||
import java.util.List;
|
||||
|
||||
geoPolygon(
|
||||
"location",
|
||||
|
||||
+2
@@ -1,5 +1,7 @@
|
||||
```java
|
||||
import static io.qdrant.client.ConditionFactory.matchKeywords;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
matchKeywords("color", List.of("black", "yellow"));
|
||||
```
|
||||
|
||||
+2
@@ -1,5 +1,7 @@
|
||||
```java
|
||||
import static io.qdrant.client.ConditionFactory.matchExceptKeywords;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
matchExceptKeywords("color", List.of("black", "yellow"));
|
||||
```
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
```java
|
||||
import static io.qdrant.client.ConditionFactory.matchKeyword;
|
||||
|
||||
matchKeyword("color", "red");
|
||||
```
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
```java
|
||||
import static io.qdrant.client.ConditionFactory.matchKeyword;
|
||||
|
||||
matchKeyword("uuid", "f47ac10b-58cc-4372-a567-0e02b2c3d479");
|
||||
```
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
```java
|
||||
import static io.qdrant.client.ConditionFactory.range;
|
||||
|
||||
import io.qdrant.client.grpc.Points.Range;
|
||||
import io.qdrant.client.grpc.Common.Range;
|
||||
|
||||
range("price", Range.newBuilder().setGte(100.0).setLte(450).build());
|
||||
```
|
||||
|
||||
+1
-2
@@ -1,7 +1,6 @@
|
||||
```go
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/qdrant/go-client/qdrant"
|
||||
)
|
||||
@@ -13,7 +12,7 @@ client, err := qdrant.NewClient(&qdrant.Config{
|
||||
UseTLS: true,
|
||||
})
|
||||
|
||||
client.Query(ctx, &qdrant.QueryPoints{
|
||||
client.Query(context.Background(), &qdrant.QueryPoints{
|
||||
CollectionName: "{collection_name}",
|
||||
Query: qdrant.NewQueryNearest(
|
||||
qdrant.NewVectorInputDocument(&qdrant.Document{
|
||||
|
||||
+2
-1
@@ -5,6 +5,7 @@ import static io.qdrant.client.ValueFactory.value;
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Points.Document;
|
||||
import io.qdrant.client.grpc.Points.QueryPoints;
|
||||
import java.util.Map;
|
||||
|
||||
QdrantClient client =
|
||||
@@ -15,7 +16,7 @@ QdrantClient client =
|
||||
|
||||
client
|
||||
.queryAsync(
|
||||
Points.QueryPoints.newBuilder()
|
||||
QueryPoints.newBuilder()
|
||||
.setCollectionName("{collection_name}")
|
||||
.setQuery(
|
||||
nearest(
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
```rust
|
||||
use qdrant_client::{
|
||||
Qdrant, QdrantError,
|
||||
Qdrant,
|
||||
qdrant::{Document, Query, QueryPointsBuilder, Value},
|
||||
};
|
||||
use std::collections::HashMap;
|
||||
|
||||
+1
-2
@@ -1,7 +1,6 @@
|
||||
```go
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/qdrant/go-client/qdrant"
|
||||
)
|
||||
@@ -13,7 +12,7 @@ client, err := qdrant.NewClient(&qdrant.Config{
|
||||
UseTLS: true,
|
||||
})
|
||||
|
||||
client.Upsert(ctx, &qdrant.UpsertPoints{
|
||||
client.Upsert(context.Background(), &qdrant.UpsertPoints{
|
||||
CollectionName: "{collection_name}",
|
||||
Points: []*qdrant.PointStruct{
|
||||
{
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
```rust
|
||||
use qdrant_client::{
|
||||
Payload, Qdrant, QdrantError,
|
||||
Payload, Qdrant,
|
||||
qdrant::{Document, PointStruct, UpsertPointsBuilder},
|
||||
};
|
||||
use std::collections::HashMap;
|
||||
|
||||
+1
-2
@@ -1,7 +1,6 @@
|
||||
```go
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/qdrant/go-client/qdrant"
|
||||
)
|
||||
@@ -13,7 +12,7 @@ client, err := qdrant.NewClient(&qdrant.Config{
|
||||
UseTLS: true,
|
||||
})
|
||||
|
||||
client.Upsert(ctx, &qdrant.UpsertPoints{
|
||||
client.Upsert(context.Background(), &qdrant.UpsertPoints{
|
||||
CollectionName: "{collection_name}",
|
||||
Points: []*qdrant.PointStruct{
|
||||
{
|
||||
|
||||
+1
@@ -6,6 +6,7 @@ import static io.qdrant.client.VectorsFactory.namedVectors;
|
||||
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Points.Document;
|
||||
import io.qdrant.client.grpc.Points.Image;
|
||||
import io.qdrant.client.grpc.Points.PointStruct;
|
||||
import java.util.List;
|
||||
|
||||
+16
-14
@@ -1,22 +1,24 @@
|
||||
```rust
|
||||
use qdrant_client::{
|
||||
Payload, Qdrant, QdrantError,
|
||||
qdrant::{Document, PointStruct, UpsertPointsBuilder},
|
||||
Payload, Qdrant,
|
||||
qdrant::{DocumentBuilder, PointStruct, UpsertPointsBuilder},
|
||||
};
|
||||
use std::collections::HashMap;
|
||||
|
||||
let client = Qdrant::from_url("<your-qdrant-url>").build()?;
|
||||
|
||||
client
|
||||
.upsert_points(UpsertPointsBuilder::new("{collection_name}",
|
||||
vec![
|
||||
PointStruct::new(1,
|
||||
HashMap::from([("my-bm25-vector".to_string(),
|
||||
Document {
|
||||
text: "Recipe for baking chocolate chip cookies".into(),
|
||||
model: "qdrant/bm25".into(),
|
||||
..Default::default()
|
||||
}.into())]),
|
||||
Payload::default())
|
||||
]))
|
||||
.await?;
|
||||
.upsert_points(UpsertPointsBuilder::new(
|
||||
"{collection_name}",
|
||||
vec![PointStruct::new(
|
||||
1,
|
||||
HashMap::from([(
|
||||
"my-bm25-vector".to_string(),
|
||||
DocumentBuilder::new("Recipe for baking chocolate chip cookies", "qdrant/bm25")
|
||||
.build(),
|
||||
)]),
|
||||
Payload::default(),
|
||||
)],
|
||||
))
|
||||
.await?;
|
||||
```
|
||||
|
||||
+1
-2
@@ -1,7 +1,6 @@
|
||||
```go
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/qdrant/go-client/qdrant"
|
||||
)
|
||||
@@ -13,7 +12,7 @@ client, err := qdrant.NewClient(&qdrant.Config{
|
||||
UseTLS: true,
|
||||
})
|
||||
|
||||
client.Query(ctx, &qdrant.QueryPoints{
|
||||
client.Query(context.Background(), &qdrant.QueryPoints{
|
||||
CollectionName: "{collection_name}",
|
||||
Query: qdrant.NewQueryNearest(
|
||||
qdrant.NewVectorInputDocument(&qdrant.Document{
|
||||
|
||||
+2
-1
@@ -5,6 +5,7 @@ import static io.qdrant.client.ValueFactory.value;
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Points.Document;
|
||||
import io.qdrant.client.grpc.Points.QueryPoints;
|
||||
import java.util.Map;
|
||||
|
||||
QdrantClient client =
|
||||
@@ -14,7 +15,7 @@ QdrantClient client =
|
||||
.build());
|
||||
client
|
||||
.queryAsync(
|
||||
Points.QueryPoints.newBuilder()
|
||||
QueryPoints.newBuilder()
|
||||
.setCollectionName("{collection_name}")
|
||||
.setQuery(
|
||||
nearest(
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
```rust
|
||||
use qdrant_client::{
|
||||
Qdrant, QdrantError,
|
||||
Qdrant,
|
||||
qdrant::{Document, Query, QueryPointsBuilder, Value},
|
||||
};
|
||||
use std::collections::HashMap;
|
||||
|
||||
+1
-2
@@ -1,7 +1,6 @@
|
||||
```go
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/qdrant/go-client/qdrant"
|
||||
)
|
||||
@@ -13,7 +12,7 @@ client, err := qdrant.NewClient(&qdrant.Config{
|
||||
UseTLS: true,
|
||||
})
|
||||
|
||||
client.Upsert(ctx, &qdrant.UpsertPoints{
|
||||
client.Upsert(context.Background(), &qdrant.UpsertPoints{
|
||||
CollectionName: "{collection_name}",
|
||||
Points: []*qdrant.PointStruct{
|
||||
{
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
```rust
|
||||
use qdrant_client::{
|
||||
Payload, Qdrant, QdrantError,
|
||||
Payload, Qdrant,
|
||||
qdrant::{Image, PointStruct, UpsertPointsBuilder},
|
||||
};
|
||||
use std::collections::HashMap;
|
||||
|
||||
+1
-2
@@ -1,7 +1,6 @@
|
||||
```go
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/qdrant/go-client/qdrant"
|
||||
)
|
||||
@@ -13,7 +12,7 @@ client, err := qdrant.NewClient(&qdrant.Config{
|
||||
UseTLS: true,
|
||||
})
|
||||
|
||||
client.Upsert(ctx, &qdrant.UpsertPoints{
|
||||
client.Upsert(context.Background(), &qdrant.UpsertPoints{
|
||||
CollectionName: "{collection_name}",
|
||||
Points: []*qdrant.PointStruct{
|
||||
{
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
```rust
|
||||
use qdrant_client::{
|
||||
Payload, Qdrant, QdrantError,
|
||||
qdrant::{Document, PointStruct, UpsertPointsBuilder, Vectors},
|
||||
Payload, Qdrant,
|
||||
qdrant::{Document, Image, NamedVectors, PointStruct, UpsertPointsBuilder},
|
||||
};
|
||||
use std::collections::HashMap;
|
||||
|
||||
|
||||
+1
-2
@@ -1,7 +1,6 @@
|
||||
```go
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/qdrant/go-client/qdrant"
|
||||
)
|
||||
@@ -13,7 +12,7 @@ client, err := qdrant.NewClient(&qdrant.Config{
|
||||
UseTLS: true,
|
||||
})
|
||||
|
||||
client.Query(ctx, &qdrant.QueryPoints{
|
||||
client.Query(context.Background(), &qdrant.QueryPoints{
|
||||
CollectionName: "{collection_name}",
|
||||
Query: qdrant.NewQueryNearest(
|
||||
qdrant.NewVectorInputDocument(&qdrant.Document{
|
||||
|
||||
+2
-1
@@ -5,6 +5,7 @@ import static io.qdrant.client.ValueFactory.value;
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Points.Document;
|
||||
import io.qdrant.client.grpc.Points.QueryPoints;
|
||||
import java.util.Map;
|
||||
|
||||
QdrantClient client =
|
||||
@@ -14,7 +15,7 @@ QdrantClient client =
|
||||
.build());
|
||||
client
|
||||
.queryAsync(
|
||||
Points.QueryPoints.newBuilder()
|
||||
QueryPoints.newBuilder()
|
||||
.setCollectionName("{collection_name}")
|
||||
.setQuery(
|
||||
nearest(
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
```rust
|
||||
use qdrant_client::{
|
||||
Qdrant, QdrantError,
|
||||
Qdrant,
|
||||
qdrant::{Document, Query, QueryPointsBuilder, Value},
|
||||
};
|
||||
use std::collections::HashMap;
|
||||
|
||||
+1
-2
@@ -1,7 +1,6 @@
|
||||
```go
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/qdrant/go-client/qdrant"
|
||||
)
|
||||
@@ -13,7 +12,7 @@ client, err := qdrant.NewClient(&qdrant.Config{
|
||||
UseTLS: true,
|
||||
})
|
||||
|
||||
client.Upsert(ctx, &qdrant.UpsertPoints{
|
||||
client.Upsert(context.Background(), &qdrant.UpsertPoints{
|
||||
CollectionName: "{collection_name}",
|
||||
Points: []*qdrant.PointStruct{
|
||||
{
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
```rust
|
||||
use qdrant_client::{
|
||||
Payload, Qdrant, QdrantError,
|
||||
Payload, Qdrant,
|
||||
qdrant::{Document, PointStruct, UpsertPointsBuilder},
|
||||
};
|
||||
use std::collections::HashMap;
|
||||
|
||||
+1
-2
@@ -1,7 +1,6 @@
|
||||
```go
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/qdrant/go-client/qdrant"
|
||||
)
|
||||
@@ -13,7 +12,7 @@ client, err := qdrant.NewClient(&qdrant.Config{
|
||||
UseTLS: true,
|
||||
})
|
||||
|
||||
client.Query(ctx, &qdrant.QueryPoints{
|
||||
client.Query(context.Background(), &qdrant.QueryPoints{
|
||||
CollectionName: "{collection_name}",
|
||||
Query: qdrant.NewQueryNearest(
|
||||
qdrant.NewVectorInputDocument(&qdrant.Document{
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
```rust
|
||||
use qdrant_client::{
|
||||
Qdrant, QdrantError,
|
||||
Qdrant,
|
||||
qdrant::{Document, Query, QueryPointsBuilder},
|
||||
};
|
||||
|
||||
|
||||
+2
-6
@@ -11,12 +11,8 @@ await client.UpsertAsync(
|
||||
Id = 1,
|
||||
Vectors = new Dictionary<string, Vector>
|
||||
{
|
||||
["image"] = new() {
|
||||
Data = {0.9f, 0.1f, 0.1f, 0.2f}
|
||||
},
|
||||
["text"] = new() {
|
||||
Data = {0.4f, 0.7f, 0.1f, 0.8f, 0.1f}
|
||||
},
|
||||
["image"] = new float[] {0.9f, 0.1f, 0.1f, 0.2f},
|
||||
["text"] = new float[] {0.4f, 0.7f, 0.1f, 0.8f, 0.1f},
|
||||
["text-sparse"] = ([0.1f, 0.2f, 0.3f, 0.4f], [1, 3, 5, 7]),
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
```rust
|
||||
use std::collections::HashMap;
|
||||
|
||||
use qdrant_client::qdrant::{PointStruct, UpsertPointsBuilder, Vector};
|
||||
use qdrant_client::qdrant::{PointStruct, UpsertPointsBuilder};
|
||||
use qdrant_client::Payload;
|
||||
|
||||
client
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ client
|
||||
.upsertAsync(
|
||||
UpsertPoints.newBuilder()
|
||||
.setCollectionName("{collectionName}")
|
||||
.addPoint(
|
||||
.addPoints(
|
||||
PointStruct.newBuilder()
|
||||
.setId(id(1))
|
||||
.setVectors(vectors(0.05f, 0.61f, 0.76f, 0.74f))
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ client.upsert("{collection_name}", {
|
||||
},
|
||||
}
|
||||
],
|
||||
updateFilter: {
|
||||
update_filter: {
|
||||
must: [
|
||||
{
|
||||
key: "version",
|
||||
|
||||
+2
-2
@@ -27,9 +27,9 @@ client
|
||||
namedVectors(
|
||||
Map.of(
|
||||
"image",
|
||||
List.of(0.2f, 0.1f, 0.3f, 0.9f),
|
||||
vector(List.of(0.2f, 0.1f, 0.3f, 0.9f)),
|
||||
"text",
|
||||
List.of(0.5f, 0.2f, 0.7f, 0.4f, 0.7f, 0.2f, 0.3f, 0.9f))))
|
||||
vector(List.of(0.5f, 0.2f, 0.7f, 0.4f, 0.7f, 0.2f, 0.3f, 0.9f)))))
|
||||
.build()))
|
||||
.get();
|
||||
```
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
```rust
|
||||
use qdrant_client::qdrant::{PointStruct, UpsertPointsBuilder, Vector};
|
||||
use qdrant_client::Qdrant;
|
||||
use qdrant_client::{Payload, Qdrant};
|
||||
|
||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
|
||||
|
||||
+3
-3
@@ -8,9 +8,9 @@ client.upsert("{collection_name}", {
|
||||
{
|
||||
id: 1,
|
||||
vector: [
|
||||
[-0.013, 0.020, -0.007, -0.111, ...],
|
||||
[-0.030, -0.055, 0.001, 0.072, ...],
|
||||
[-0.041, 0.014, -0.032, -0.062, ...]
|
||||
[-0.013, 0.020, -0.007, -0.111],
|
||||
[-0.030, -0.055, 0.001, 0.072],
|
||||
[-0.041, 0.014, -0.032, -0.062]
|
||||
],
|
||||
}
|
||||
]
|
||||
|
||||
+1
-4
@@ -27,10 +27,7 @@ await client.UpsertAsync(
|
||||
Payload =
|
||||
{
|
||||
["city"] = new[] { "Berlin", "Moscow" },
|
||||
["price"] = new Value
|
||||
{
|
||||
ListValue = new ListValue { Values = { new Value[] { 1.99, 2.99 } } }
|
||||
}
|
||||
["price"] = new Value[] { 1.99, 2.99 }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
@@ -1,5 +1,6 @@
|
||||
```java
|
||||
import static io.qdrant.client.PointIdFactory.id;
|
||||
import static io.qdrant.client.ValueFactory.list;
|
||||
import static io.qdrant.client.ValueFactory.value;
|
||||
import static io.qdrant.client.VectorsFactory.vectors;
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
```rust
|
||||
use qdrant_client::qdrant::{PointStruct, UpsertPointsBuilder};
|
||||
use qdrant_client::{Payload, Qdrant, QdrantError};
|
||||
use qdrant_client::{Payload, Qdrant};
|
||||
use serde_json::json;
|
||||
|
||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ client.Upsert(context.Background(), &qdrant.UpsertPoints{
|
||||
Id: qdrant.NewIDNum(1),
|
||||
Vectors: qdrant.NewVectors(0.9, 0.1, 0.1),
|
||||
Payload: qdrant.NewValueMap(map[string]any{"group_id": "user_1"}),
|
||||
}
|
||||
},
|
||||
},
|
||||
ShardKeySelector: &qdrant.ShardKeySelector{
|
||||
ShardKeys: []*qdrant.ShardKey{
|
||||
|
||||
+4
@@ -1,10 +1,14 @@
|
||||
```java
|
||||
import static io.qdrant.client.PointIdFactory.id;
|
||||
import static io.qdrant.client.ShardKeyFactory.shardKey;
|
||||
import static io.qdrant.client.ValueFactory.value;
|
||||
import static io.qdrant.client.VectorsFactory.vectors;
|
||||
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Points.PointStruct;
|
||||
import io.qdrant.client.grpc.Points.ShardKeySelector;
|
||||
import io.qdrant.client.grpc.Points.UpsertPoints;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
```rust
|
||||
use qdrant_client::qdrant::{PointStruct, UpsertPointsBuilder};
|
||||
use qdrant_client::Qdrant;
|
||||
use qdrant_client::qdrant::{PointStruct, ShardKeySelectorBuilder, UpsertPointsBuilder};
|
||||
|
||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
|
||||
|
||||
+4
@@ -1,4 +1,8 @@
|
||||
```java
|
||||
import static io.qdrant.client.PointIdFactory.id;
|
||||
import static io.qdrant.client.ValueFactory.value;
|
||||
import static io.qdrant.client.VectorsFactory.vectors;
|
||||
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Points.PointStruct;
|
||||
|
||||
+1
@@ -3,6 +3,7 @@ import static io.qdrant.client.PointIdFactory.id;
|
||||
import static io.qdrant.client.ValueFactory.value;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
client
|
||||
.overwritePayloadAsync(
|
||||
|
||||
+3
@@ -1,4 +1,7 @@
|
||||
```java
|
||||
import static io.qdrant.client.QueryFactory.nearest;
|
||||
|
||||
import io.qdrant.client.grpc.Points.QueryPointGroups;
|
||||
import io.qdrant.client.grpc.Points.SearchPointGroups;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
-1
@@ -1,6 +1,5 @@
|
||||
```rust
|
||||
use qdrant_client::qdrant::{ContextInputBuilder, DiscoverInputBuilder, QueryPointsBuilder};
|
||||
use qdrant_client::Qdrant;
|
||||
|
||||
client
|
||||
.query(
|
||||
|
||||
-1
@@ -1,6 +1,5 @@
|
||||
```rust
|
||||
use qdrant_client::qdrant::{Condition, Filter, QueryPointsBuilder, SearchParamsBuilder};
|
||||
use qdrant_client::Qdrant;
|
||||
|
||||
client
|
||||
.query(
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
```rust
|
||||
use qdrant_client::Qdrant;
|
||||
use qdrant_client::qdrant::{LookupLocationBuilder, PointId, Query, QueryPointsBuilder};
|
||||
use qdrant_client::qdrant::{LookupLocationBuilder, Query, QueryPointsBuilder};
|
||||
|
||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
|
||||
|
||||
+2
-2
@@ -1,13 +1,13 @@
|
||||
```rust
|
||||
use qdrant_client::Qdrant;
|
||||
use qdrant_client::qdrant::{Condition, Filter, PointId, Query, QueryPointsBuilder};
|
||||
use qdrant_client::qdrant::{PointId, Query, QueryPointsBuilder};
|
||||
|
||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
|
||||
client
|
||||
.query(
|
||||
QueryPointsBuilder::new("{collection_name}")
|
||||
.query(Query::new_nearest(PointId::new("43cf51e2-8777-4f52-bc74-c2cbde0c8b04")))
|
||||
.query(Query::new_nearest(PointId::from("43cf51e2-8777-4f52-bc74-c2cbde0c8b04")))
|
||||
)
|
||||
.await?;
|
||||
```
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
```rust
|
||||
use qdrant_client::Qdrant;
|
||||
use qdrant_client::qdrant::{PrefetchQueryBuilder, Query, QueryPointsBuilder};
|
||||
use qdrant_client::qdrant::{MmrBuilder, Query, QueryPointsBuilder};
|
||||
|
||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ const client = new QdrantClient({ host: "localhost", port: 6333 });
|
||||
|
||||
client.query("{collection_name}", {
|
||||
query: {
|
||||
nearest: [0.01, 0.45, 0.67, ...], // search vector
|
||||
nearest: [0.01, 0.45, 0.67], // search vector
|
||||
mmr: {
|
||||
diversity: 0.5, // 0.0 - relevance; 1.0 - diversity
|
||||
candidates_limit: 100 // num of candidates to preselect
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
```rust
|
||||
use qdrant_client::Qdrant;
|
||||
use qdrant_client::qdrant::{Rrf, PrefetchQueryBuilder, Query, QueryPointsBuilder};
|
||||
use qdrant_client::qdrant::{RrfBuilder, Query, QueryPointsBuilder};
|
||||
|
||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
|
||||
@@ -8,6 +8,6 @@ client.query(
|
||||
QueryPointsBuilder::new("{collection_name}")
|
||||
// .add_prefetch(...) <┐
|
||||
// .add_prefetch(...) <┴─ 2+ prefetches here
|
||||
.query(Query::new_rrf(RrfBuilder::with_k(60))
|
||||
.query(Query::new_rrf(RrfBuilder::with_k(60)))
|
||||
).await?;
|
||||
```
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ await client.QueryAsync(
|
||||
collectionName: "{collection_name}",
|
||||
query: new float[][] {
|
||||
[-0.013f, 0.020f, -0.007f, -0.111f],
|
||||
[-0.030f, -0.055f, 0.001 , 0.072f],
|
||||
[-0.030f, -0.055f, 0.001f, 0.072f],
|
||||
[-0.041f, 0.014f, -0.032f, -0.062f],
|
||||
}
|
||||
);
|
||||
|
||||
+2
@@ -1,6 +1,8 @@
|
||||
```python
|
||||
from qdrant_client import QdrantClient, models
|
||||
|
||||
client = QdrantClient(url="http://localhost:6333")
|
||||
|
||||
sampled = client.query_points(
|
||||
collection_name="{collection_name}",
|
||||
query=models.SampleQuery(sample=models.Sample.RANDOM)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user