docs: Go, Java, C# snippets

Signed-off-by: Anush008 <anushshetty90@gmail.com>
This commit is contained in:
Anush008
2025-11-17 12:45:26 +05:30
parent 31c7db602b
commit 2d2cb57abe
4 changed files with 47 additions and 24 deletions
@@ -2,21 +2,17 @@
import java.util.List;
import java.util.Map;
import static io.qdrant.client.ShardKeyFactory.shardKey;
import io.qdrant.client.QdrantClient;
import io.qdrant.client.QdrantGrpcClient;
import io.qdrant.client.grpc.Points.PointStruct;
import io.qdrant.client.ShardKeyFactory.shardKey;
import io.qdrant.client.grpc.Points.ShardKeySelector;
QdrantClient client =
new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build());
ShardKeySelector.Builder shardkeySelectorBuilder = ShardKeySelector.newBuilder();
shardkeySelectorBuilder.addShardKeys(shardKey("user_1"));
shardkeySelectorBuilder.setFallback(shardKey("default"));
ShardKeySelector shardKeySelector = shardkeySelectorBuilder.build();
client
.upsertAsync(
UpsertPoints.newBuilder()
@@ -27,11 +23,12 @@ client
.setId(id(1))
.setVectors(vectors(0.9f, 0.1f, 0.1f))
.putAllPayload(Map.of("group_id", value("user_1")))
.build()
)
)
.setShardKeySelector(shardKeySelector)
.build()
)
.build()))
.setShardKeySelector(
ShardKeySelector.newBuilder()
.addShardKeys(shardKey("user_1"))
.setFallback(shardKey("default"))
.build())
.build())
.get();
```