2020import io .weaviate .client6 .v1 .api .WeaviateApiException ;
2121import io .weaviate .client6 .v1 .api .WeaviateClient ;
2222import io .weaviate .client6 .v1 .api .collections .Property ;
23- import io .weaviate .client6 .v1 .api .collections .Vectorizers ;
23+ import io .weaviate .client6 .v1 .api .collections .ReferenceProperty ;
24+ import io .weaviate .client6 .v1 .api .collections .VectorConfig ;
2425import io .weaviate .client6 .v1 .api .collections .Vectors ;
2526import io .weaviate .client6 .v1 .api .collections .WeaviateMetadata ;
2627import io .weaviate .client6 .v1 .api .collections .WeaviateObject ;
@@ -133,7 +134,7 @@ private static Map<String, float[]> populateTest(int n) throws IOException {
133134 private static void createTestCollection () throws IOException {
134135 client .collections .create (COLLECTION , cfg -> cfg
135136 .properties (Property .text ("category" ))
136- .vectors ( Vectorizers .selfProvided (VECTOR_INDEX )));
137+ .vectorConfig ( VectorConfig .selfProvided (VECTOR_INDEX )));
137138 }
138139
139140 @ Test
@@ -142,7 +143,7 @@ public void testNearText() throws IOException {
142143 client .collections .create (nsSongs ,
143144 col -> col
144145 .properties (Property .text ("title" ))
145- .vectors ( Vectorizers .text2vecContextionary ()));
146+ .vectorConfig ( VectorConfig .text2vecContextionary ()));
146147
147148 var songs = client .collections .use (nsSongs );
148149 var submarine = songs .data .insert (Map .of ("title" , "Yellow Submarine" ));
@@ -164,13 +165,13 @@ public void testNearText() throws IOException {
164165
165166 @ Test
166167 public void testNearText_groupBy () throws IOException {
167- var vectorizer = Vectorizers .text2vecContextionary ();
168+ var vectorizer = VectorConfig .text2vecContextionary ();
168169
169170 var nsArtists = ns ("Artists" );
170171 client .collections .create (nsArtists ,
171172 col -> col
172173 .properties (Property .text ("name" ))
173- .vectors (vectorizer ));
174+ .vectorConfig (vectorizer ));
174175
175176 var artists = client .collections .use (nsArtists );
176177 var beatles = artists .data .insert (Map .of ("name" , "Beatles" ));
@@ -180,8 +181,8 @@ public void testNearText_groupBy() throws IOException {
180181 client .collections .create (nsSongs ,
181182 col -> col
182183 .properties (Property .text ("title" ))
183- .references (Property . reference ("performedBy" , nsArtists ))
184- .vectors (vectorizer ));
184+ .references (ReferenceProperty . to ("performedBy" , nsArtists ))
185+ .vectorConfig (vectorizer ));
185186
186187 var songs = client .collections .use (nsSongs );
187188 songs .data .insert (Map .of ("title" , "Yellow Submarine" ),
@@ -208,7 +209,7 @@ public void testNearImage() throws IOException {
208209 .properties (
209210 Property .text ("breed" ),
210211 Property .blob ("img" ))
211- .vectors ( Vectorizers .img2vecNeural (
212+ .vectorConfig ( VectorConfig .img2vecNeural (
212213 i2v -> i2v .imageFields ("img" ))));
213214
214215 var cats = client .collections .use (nsCats );
@@ -390,7 +391,7 @@ public void testNearObject() throws IOException {
390391 client .collections .create (nsAnimals ,
391392 collection -> collection
392393 .properties (Property .text ("kind" ))
393- .vectors ( Vectorizers .text2vecContextionary ()));
394+ .vectorConfig ( VectorConfig .text2vecContextionary ()));
394395
395396 var animals = client .collections .use (nsAnimals );
396397
@@ -419,7 +420,7 @@ public void testHybrid() throws IOException {
419420 client .collections .create (nsHobbies ,
420421 collection -> collection
421422 .properties (Property .text ("name" ), Property .text ("description" ))
422- .vectors ( Vectorizers .text2vecContextionary ()));
423+ .vectorConfig ( VectorConfig .text2vecContextionary ()));
423424
424425 var hobbies = client .collections .use (nsHobbies );
425426
@@ -452,7 +453,7 @@ public void testBadRequest() throws IOException {
452453 client .collections .create (nsThings ,
453454 collection -> collection
454455 .properties (Property .text ("name" ))
455- .vectors ( Vectorizers .text2vecContextionary ()));
456+ .vectorConfig ( VectorConfig .text2vecContextionary ()));
456457
457458 var things = client .collections .use (nsThings );
458459 var balloon = things .data .insert (Map .of ("name" , "balloon" ));
@@ -469,7 +470,7 @@ public void testBadRequest_async() throws Throwable {
469470 async .collections .create (nsThings ,
470471 collection -> collection
471472 .properties (Property .text ("name" ))
472- .vectors ( Vectorizers .text2vecContextionary ()))
473+ .vectorConfig ( VectorConfig .text2vecContextionary ()))
473474 .join ();
474475
475476 var things = async .collections .use (nsThings );
@@ -490,7 +491,7 @@ public void testMetadataAll() throws IOException {
490491 client .collections .create (nsThings ,
491492 c -> c
492493 .properties (Property .text ("name" ))
493- .vectors ( Vectorizers .text2vecContextionary (
494+ .vectorConfig ( VectorConfig .text2vecContextionary (
494495 t2v -> t2v .sourceProperties ("name" ))));
495496
496497 var things = client .collections .use (nsThings );
0 commit comments