mirror of
https://github.com/qdrant/landing_page.git
synced 2026-09-27 23:18:29 +02:00
* Make Bulk Upload tutorial code snippets testable * Align Bulk Upload tutorial with agent skill * Update Bulk Upload tutorial * Update title * Remove 'Disable Indexing' section
34 lines
1.4 KiB
Java
34 lines
1.4 KiB
Java
package com.example.snippets_amalgamation;
|
|
|
|
import io.qdrant.client.QdrantClient;
|
|
import io.qdrant.client.QdrantGrpcClient;
|
|
import io.qdrant.client.grpc.Collections.CreateCollection;
|
|
import io.qdrant.client.grpc.Collections.Distance;
|
|
import io.qdrant.client.grpc.Collections.VectorParams;
|
|
import io.qdrant.client.grpc.Collections.VectorsConfig;
|
|
|
|
public class Snippet {
|
|
public static void run() throws Exception {
|
|
// @hide-start
|
|
QdrantClient client =
|
|
new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build());
|
|
// @hide-end
|
|
|
|
client
|
|
.createCollectionAsync(
|
|
CreateCollection.newBuilder()
|
|
.setCollectionName("{collection_name}")
|
|
.setVectorsConfig(
|
|
VectorsConfig.newBuilder()
|
|
.setParams(
|
|
VectorParams.newBuilder()
|
|
.setSize(768)
|
|
.setDistance(Distance.Cosine)
|
|
.build())
|
|
.build())
|
|
.setShardNumber(2)
|
|
.build())
|
|
.get();
|
|
}
|
|
}
|