Repository navigation
Conversation
19d8c0e to
8bb99ea
Compare
8bb99ea to
10b63eb
Compare
b757459 to
3fd0e32
Compare
There was a problem hiding this comment.
I compared a minimal program (connect → create collection → upsert → search) written against QdrantClient and against QdrantServerlessClient. Search is identical, but the other steps diverge more than they need to:
1. Connect
// regular
new QdrantClient(QdrantGrpcClient.newBuilder(host, 6334, true).withApiKey(apiKey).build());
// serverless
new QdrantServerlessClient(QdrantServerlessClient.newGrpcClientBuilder(host).withApiKey(apiKey).build());QdrantServerlessClient.newGrpcClientBuilder
vs
QdrantGrpcClient.newBuilder
Why not same naming pattern?
2. Create collection
// regular
client.createCollectionAsync("docs",
VectorParams.newBuilder().setSize(4).setDistance(Distance.Cosine).build()).get();
// serverless
client.createCollectionAsync("docs",
CollectionConfig.newBuilder()
.putDenseVectors("", DenseVectorConfig.newBuilder()
.setSize(4).setDistance(Distance.COSINE).build())
.build()).get();.putDenseVectors("", DenseVectorConfig.newBuilder()
does default vector require explicit "" name? With the regular client, the common single-vector case doesn't need any name.
3. Upsert
// regular
client.upsertAsync("docs", List.of(point)).get(); // wait=true is set for you
// serverless
client.upsertAsync(UpsertPoints.newBuilder()
.setCollectionName("docs")
.setWait(true) // easy to forget, defaults to false
.addPoints(point)
.build()).get();upsertAsync
should be same, why it is not the same for serverless? The (collectionName, points) overload is missing here, so code can't be moved between the two clients without rewriting it, and forgetting setWait(true) silently changes behaviour.
Written with Overlord from https://overlord.qdrant.tech/r/997/t/6611
|
I have added The serverless client now also has all the On the builder name: |
generall
left a comment
There was a problem hiding this comment.
Creating a collection with the unnamed default vector should not require users to know the "" key convention.
The new createCollectionAsync(name, DenseVectorConfig) overload hides it only when the collection has no payload indexes. Serverless has no separate createPayloadIndexAsync: indexes can only be declared in CollectionConfig.payload_indexes. So the most common real setup, a default vector plus a couple of indexes, still needs:
CollectionConfig.newBuilder()
.putDenseVectors("", DenseVectorConfig.newBuilder()...build())
.putPayloadIndexes("color", ServerlessPayloadIndexFactory.keyword())
.build()The PR's own test does this (QdrantServerlessClientTest.java:167).
Please provide a first-class way to set the default vector that composes with payload indexes and sparse vectors. For example:
- an overload
createCollectionAsync(name, DenseVectorConfig, Map<String, PayloadIndexConfig>)(plus the timeout variant), and/or - a factory such as
ServerlessCollectionConfigFactory.defaultVector(DenseVectorConfig)that returns aCollectionConfig.Builder, so callers can chain.putPayloadIndexes(...)/.putSparseVectors(...).
With either, user code never has to spell out "".
Written with Overlord from https://overlord.qdrant.tech/r/997/t/6611
| public ListenableFuture<CreateCollectionResponse> createCollectionAsync( | ||
| String collectionName, DenseVectorConfig vector, @Nullable Duration timeout) { | ||
| return createCollectionAsync( | ||
| collectionName, CollectionConfig.newBuilder().putDenseVectors("", vector).build(), timeout); |
There was a problem hiding this comment.
This hides "" only when there are no payload indexes. As soon as an index is needed, which on serverless can only be declared at creation time, users are back to putDenseVectors("", ...) by hand. Could the default-vector path also accept payload indexes, or could a config builder/factory with the default vector already set be exposed?
Written with Overlord from https://overlord.qdrant.tech/r/997/t/6611
The CI credentials are set for the integration tests.