Skip to content

Commit 2241daa

Browse files
authored
Merge pull request #461 from weaviate/v6-user-testing-feedback
v6: Implement users' feedback
2 parents e7c1101 + da953d6 commit 2241daa

46 files changed

Lines changed: 1317 additions & 500 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/test.yaml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v4
14+
with:
15+
ref: ${{ github.sha }}
1416
- name: Login to Docker Hub
1517
if: ${{ !github.event.pull_request.head.repo.fork }}
1618
uses: docker/login-action@v2

‎src/it/java/io/weaviate/containers/Weaviate.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public WeaviateClient getNewClient(Function<Config.Custom, ObjectBuilder<Config>
7878
.grpcHost(host)
7979
.httpPort(getMappedPort(8080))
8080
.grpcPort(getMappedPort(50051)));
81-
return WeaviateClient.custom(customFn);
81+
return WeaviateClient.connectToCustom(customFn);
8282
}
8383

8484
public static Weaviate createDefault() {

‎src/it/java/io/weaviate/integration/AggregationITest.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import io.weaviate.ConcurrentTest;
1515
import io.weaviate.client6.v1.api.WeaviateClient;
1616
import io.weaviate.client6.v1.api.collections.Property;
17-
import io.weaviate.client6.v1.api.collections.Vectorizers;
17+
import io.weaviate.client6.v1.api.collections.VectorConfig;
1818
import io.weaviate.client6.v1.api.collections.Vectors;
1919
import io.weaviate.client6.v1.api.collections.aggregate.Aggregate;
2020
import io.weaviate.client6.v1.api.collections.aggregate.AggregateResponseGroup;
@@ -35,7 +35,7 @@ public static void beforeAll() throws IOException {
3535
.properties(
3636
Property.text("category"),
3737
Property.integer("price"))
38-
.vectors(Vectorizers.selfProvided()));
38+
.vectorConfig(VectorConfig.selfProvided()));
3939

4040
var things = client.collections.use(COLLECTION);
4141
for (var category : List.of("Shoes", "Hat", "Jacket")) {

‎src/it/java/io/weaviate/integration/CollectionsITest.java‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
import io.weaviate.client6.v1.api.collections.CollectionConfig;
1313
import io.weaviate.client6.v1.api.collections.InvertedIndex;
1414
import io.weaviate.client6.v1.api.collections.Property;
15+
import io.weaviate.client6.v1.api.collections.ReferenceProperty;
1516
import io.weaviate.client6.v1.api.collections.Replication;
16-
import io.weaviate.client6.v1.api.collections.Vectorizer;
17-
import io.weaviate.client6.v1.api.collections.Vectorizers;
17+
import io.weaviate.client6.v1.api.collections.VectorConfig;
1818
import io.weaviate.client6.v1.api.collections.config.Shard;
1919
import io.weaviate.client6.v1.api.collections.config.ShardStatus;
2020
import io.weaviate.client6.v1.api.collections.vectorindex.Hnsw;
@@ -30,18 +30,18 @@ public void testCreateGetDelete() throws IOException {
3030
client.collections.create(collectionName,
3131
col -> col
3232
.properties(Property.text("username"), Property.integer("age"))
33-
.vectors(Vectorizers.selfProvided()));
33+
.vectorConfig(VectorConfig.selfProvided()));
3434

3535
var thingsCollection = client.collections.getConfig(collectionName);
3636

3737
Assertions.assertThat(thingsCollection).get()
3838
.hasFieldOrPropertyWithValue("collectionName", collectionName)
39-
.extracting(CollectionConfig::vectors, InstanceOfAssertFactories.map(String.class, Vectorizer.class))
39+
.extracting(CollectionConfig::vectors, InstanceOfAssertFactories.map(String.class, VectorConfig.class))
4040
.as("default vector").extractingByKey("default")
4141
.satisfies(defaultVector -> {
4242
Assertions.assertThat(defaultVector)
4343
.as("has none vectorizer").isInstanceOf(SelfProvidedVectorizer.class);
44-
Assertions.assertThat(defaultVector).extracting(Vectorizer::vectorIndex)
44+
Assertions.assertThat(defaultVector).extracting(VectorConfig::vectorIndex)
4545
.isInstanceOf(Hnsw.class);
4646
});
4747

@@ -59,7 +59,7 @@ public void testCrossReferences() throws IOException {
5959
// Act: Create Things collection with owner -> owners
6060
var nsThings = ns("Things");
6161
client.collections.create(nsThings,
62-
col -> col.references(Property.reference("ownedBy", nsOwners)));
62+
col -> col.references(ReferenceProperty.to("ownedBy", nsOwners)));
6363
var things = client.collections.use(nsThings);
6464

6565
// Assert: Things --ownedBy-> Owners

‎src/it/java/io/weaviate/integration/DataITest.java‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
import io.weaviate.client6.v1.api.WeaviateApiException;
1616
import io.weaviate.client6.v1.api.WeaviateClient;
1717
import io.weaviate.client6.v1.api.collections.Property;
18-
import io.weaviate.client6.v1.api.collections.Vectorizers;
18+
import io.weaviate.client6.v1.api.collections.ReferenceProperty;
19+
import io.weaviate.client6.v1.api.collections.VectorConfig;
1920
import io.weaviate.client6.v1.api.collections.Vectors;
2021
import io.weaviate.client6.v1.api.collections.WeaviateObject;
2122
import io.weaviate.client6.v1.api.collections.data.BatchReference;
@@ -116,8 +117,8 @@ private static void createTestCollections() throws IOException {
116117
Property.text("name"),
117118
Property.integer("age"))
118119
.references(
119-
Property.reference("hasAwards", awardsGrammy, awardsOscar))
120-
.vectors(Vectorizers.selfProvided(VECTOR_INDEX)));
120+
ReferenceProperty.to("hasAwards", awardsGrammy, awardsOscar))
121+
.vectorConfig(VectorConfig.selfProvided(VECTOR_INDEX)));
121122
}
122123

123124
@Test
@@ -128,7 +129,7 @@ public void testReferences_AddReplaceDelete() throws IOException {
128129
client.collections.create(nsPersons,
129130
collection -> collection
130131
.properties(Property.text("name"))
131-
.references(Property.reference("hasFriend", nsPersons)));
132+
.references(ReferenceProperty.to("hasFriend", nsPersons)));
132133

133134
var persons = client.collections.use(nsPersons);
134135
var john = persons.data.insert(Map.of("name", "john"));
@@ -232,8 +233,8 @@ public void testUpdate() throws IOException {
232233
client.collections.create(nsBooks,
233234
collection -> collection
234235
.properties(Property.text("title"), Property.integer("year"))
235-
.references(Property.reference("writtenBy", nsAuthors))
236-
.vectors(Vectorizers.selfProvided()));
236+
.references(ReferenceProperty.to("writtenBy", nsAuthors))
237+
.vectorConfig(VectorConfig.selfProvided()));
237238

238239
var authors = client.collections.use(nsAuthors);
239240
var walter = authors.data.insert(Map.of("name", "walter scott"));
@@ -364,7 +365,7 @@ public void testReferenceAddMany() throws IOException {
364365

365366
client.collections.create(nsAirports);
366367
client.collections.create(nsCities, c -> c
367-
.references(Property.reference("hasAirports", nsAirports)));
368+
.references(ReferenceProperty.to("hasAirports", nsAirports)));
368369

369370
var airports = client.collections.use(nsAirports);
370371
var cities = client.collections.use(nsCities);

‎src/it/java/io/weaviate/integration/ReferencesITest.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public void testReferences() throws IOException {
4848
Property.text("name"),
4949
Property.integer("age"))
5050
.references(
51-
Property.reference("hasAwards", nsGrammy, nsOscar)));
51+
ReferenceProperty.to("hasAwards", nsGrammy, nsOscar)));
5252

5353
var artists = client.collections.use(nsArtists);
5454
var grammies = client.collections.use(nsGrammy);
@@ -129,15 +129,15 @@ public void testNestedReferences() throws IOException {
129129
// Act: create Artists collection with hasAwards reference
130130
client.collections.create(nsGrammy,
131131
col -> col
132-
.references(Property.reference("presentedBy", nsAcademy)));
132+
.references(ReferenceProperty.to("presentedBy", nsAcademy)));
133133

134134
client.collections.create(nsArtists,
135135
col -> col
136136
.properties(
137137
Property.text("name"),
138138
Property.integer("age"))
139139
.references(
140-
Property.reference("hasAwards", nsGrammy)));
140+
ReferenceProperty.to("hasAwards", nsGrammy)));
141141

142142
var artists = client.collections.use(nsArtists);
143143
var grammies = client.collections.use(nsGrammy);

‎src/it/java/io/weaviate/integration/SearchITest.java‎

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
import io.weaviate.client6.v1.api.WeaviateApiException;
2121
import io.weaviate.client6.v1.api.WeaviateClient;
2222
import 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;
2425
import io.weaviate.client6.v1.api.collections.Vectors;
2526
import io.weaviate.client6.v1.api.collections.WeaviateMetadata;
2627
import 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);

‎src/main/java/io/weaviate/client6/v1/api/Config.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public static class Local extends Builder<Local> {
185185
public Local() {
186186
scheme("http");
187187
host("localhost");
188-
httpPort(8080);
188+
port(8080);
189189
grpcPort(50051);
190190
}
191191

@@ -200,7 +200,7 @@ public Local host(String host) {
200200
}
201201

202202
/** Override default HTTP port. */
203-
public Local httpPort(int port) {
203+
public Local port(int port) {
204204
this.httpPort = port;
205205
return this;
206206
}

‎src/main/java/io/weaviate/client6/v1/api/InstanceMetadata.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ public record InstanceMetadata(
88
@SerializedName("hostname") String hostName,
99
@SerializedName("version") String version,
1010
@SerializedName("modules") Map<String, Object> modules,
11-
@SerializedName("grpcMaxMessageSize") Long grpcMaxMessageSize) {
11+
@SerializedName("grpcMaxMessageSize") Integer grpcMaxMessageSize) {
1212
}

‎src/main/java/io/weaviate/client6/v1/api/WeaviateApiException.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package io.weaviate.client6.v1.api;
22

33
/**
4-
* Exception class thrown by client API message when the request's reached the
5-
* server, but the operation did not complete successfully either either due to
6-
* a bad request or a server error.
4+
* Exception class thrown by client when the request had reached the
5+
* server, but the operation did not complete successfully either
6+
* due to a bad request or a server error.
77
*/
88
public class WeaviateApiException extends WeaviateException {
99
private final String errorMessage;

0 commit comments

Comments
 (0)