@@ -36,7 +36,7 @@ This project contains a java client for the [Qdrant vector database](https://qdr
36
36
<dependency >
37
37
<groupId >io.metaloom.qdrant</groupId >
38
38
<artifactId >qdrant-java-grpc-client</artifactId >
39
- <version >0.13.0-SNAPSHOT </version >
39
+ <version >0.13.0</version >
40
40
</dependency >
41
41
```
42
42
@@ -46,7 +46,7 @@ or for the HTTP client
46
46
<dependency >
47
47
<groupId >io.metaloom.qdrant</groupId >
48
48
<artifactId >qdrant-java-http-client</artifactId >
49
- <version >0.13.0-SNAPSHOT </version >
49
+ <version >0.13.0</version >
50
50
</dependency >
51
51
```
52
52
@@ -74,8 +74,14 @@ try (QDrantGRPCClient client = QDrantGRPCClient.builder()
74
74
.setDistance(Distance . Euclid )
75
75
.build();
76
76
77
+ // Add the params to a map
78
+ VectorParamsMap paramsMap = VectorParamsMap . newBuilder()
79
+ .putMap(" firstVector" , params)
80
+ .putMap(" secondVector" , params)
81
+ .build();
82
+
77
83
// Create new collections - blocking
78
- client. createCollection(" test1" , params ). sync();
84
+ client. createCollection(" test1" , paramsMap ). sync();
79
85
// .. or via Future API
80
86
client. createCollection(" test2" , params). async(). get();
81
87
// .. or via RxJava API
@@ -92,7 +98,7 @@ try (QDrantGRPCClient client = QDrantGRPCClient.builder()
92
98
payload. put(" color" , ModelHelper . value(" blue" ));
93
99
94
100
// Now construct the point
95
- PointStruct point = ModelHelper . point (42L + i, vector, payload);
101
+ PointStruct point = ModelHelper . namedPoint (42L + i, " firstVector " , vector, payload);
96
102
// .. and insert it
97
103
client. upsertPoint(" test1" , point, true ). sync();
98
104
}
@@ -102,7 +108,7 @@ try (QDrantGRPCClient client = QDrantGRPCClient.builder()
102
108
103
109
// Now run KNN search
104
110
float [] searchVector = new float [] { 0.43f , 0.09f , 0.41f , 1.35f };
105
- List<ScoredPoint > searchResults = client. searchPoints(" test1" , searchVector, 2 , null ). sync(). getResultList();
111
+ List<ScoredPoint > searchResults = client. searchPoints(" test1" , " firstVector " , searchVector, 2 , null ). sync(). getResultList();
106
112
for (ScoredPoint result : searchResults) {
107
113
System . out. println(" Found: [" + result. getId(). getNum() + " ] " + result. getScore());
108
114
}
0 commit comments