Releases: weaviate/java-client
6.0.0-M1 - ORM, Aliases, OIDC, Sort, Tenants, Tokenization
Join us in celebrating our first milestone release! ◝(ᵔᵕᵔ)◜
This release includes many fixes and feedback points we've received from our early users and adds support for several collection-management APIs, like Aliases and Tenants. Furthermore, we're introducing our minimal ORM to let you read and write Weaviate objects into native Java records.
We've updated our README and written a lot of Javadoc. Check them out to learn more about using the new features.
What's Changed
- v6: Release SNAPSHOT versions by @bevzzz in #446
- v6: make b/k1 params in invertedIndex::bm25 type
float
by @bevzzz in #447 - v6: Per-collection-handle tenant by @bevzzz in #445
- v6: Extend supported data types by @bevzzz in #448
- v6: Support OIDC authentication by @bevzzz in #438
- v6: Support aliases by @bevzzz in #449
- v6: update dependencies by @bevzzz in #451
- v6: Add
sourceProperties
to text-based vectorizers by @bevzzz in #450 - v6: Add sorting to
query.fetchObjects
by @bevzzz in #460 - v6: Per-property tokenization method by @bevzzz in #462
- v6: Metadata fields by @bevzzz in #463
- v6: Implement users' feedback by @bevzzz in #461
- v6: ORM by @bevzzz in #459
- v6: Support ContainsNone and Not operators by @bevzzz in #469
- v6: Fix copying / collecting maps with null values by @bevzzz in #470
- v6: Update README.md and write Javadoc by @bevzzz in #468
- v6: Assertions by @bevzzz in #471
- v6: Handle missing properties in ORM scanning by @bevzzz in #472
Full Changelog: 6.0.0-beta4...6.0.0-M1
5.5.0 - RBAC Groups, ContainsNone and Not Filters
What's Changed
- chore: update dependencies by @bevzzz in #452
- test: add unit test for batch reply unmarshalling by @bevzzz in #453
- feat: add ContainsNone operator by @bevzzz in #455
- feat: add
overwriteAlias
to backup restore by @bevzzz in #454 - feat: add 'groups' namespace by @bevzzz in #456
Full Changelog: 5.4.0...5.5.0
6.0.0-beta4 - Error Handling
This release introduces several exception types to facilitate error handling and propagation when working with client6
.
For example, most of the methods which result in calling one of Weaviate's public APIs (REST and gRPC) will throw WeaviateApiException
if an error response code is returned. You can get more information about the underlying error by calling its public methods, e.g. .httpStatusCode()
or .getError()
.
Errors which occur during pagination are wrapped in PaginationException
, which contains the information necessary to resume pagination.
try {
things.paginate().forEach(page -> {...});
} catch (PaginationException e) {
if (e.getCause() instanceof TimeoutException) {
// There was a network latency spike, let's continue after a brief pause
Thread.sleep(100);
things.paginate(p -> p.fromCursor(e.getCursor()))
.forEach(page -> {...});
}
}
Finally, use WeaviateException
to catch any exceptions thrown by Weaviate client.
Notice too, that checked IOException
which all synchronous methods throw must be handled separately. They indicate errors that are not specific to Weaviate, such as bad network, failed TLS handshakes, etc.
Minor improvements
Starting with beta4
, the shaded version of the library published under all
classifier will have all of it's gRPC dependencies (io.grpc.*
and com.google.protobuf.*
) relocated to avoid version conflicts with user's own dependencies.
What's Changed
- v6: Relocate gRPC dependencies in a shaded library version by @bevzzz in #439
- v6: Throw WeaviateApiException for error status codes by @bevzzz in #437
Full Changelog: 6.0.0-beta3...6.0.0-beta4
6.0.0-beta3 - Custom TrustStore, Fat JARs, Metadata Fields
This iteration is all about QoL improvements:
Efficient vectors. We switched to float[]
for representing embeddings to make the client more memory-efficient and GC-friendly.
Custom TrustStore. Users which manage their own SSL certificates can teach the client about them by passing a TrustManagerFactory.
Do more with less. Use collection.size()
convenience method to count all objects in the collection idiomatically.
Complete metadata. Request score
and explainScore
metadata for Hybrid / BM25 queries.
Go big or go home. Every release comes with a shaded version of the lib, for users packaging their applications in uber-JARs.
What's Changed
- v6: Start MockServer on a random port by @bevzzz in #417
- v6: Add
limit
to GroupBy parameter in Aggregate queries by @bevzzz in #416 - Fix incorrect httpPort assignment and other issues in
src/main/java/io/weaviate/client6/v1/api/Config.java
by @yazan-abu-obaideh in #426 - v6: add CollectionHandle
.size()
shortcut by @bevzzz in #432 - v6: Remaining metadata fields by @bevzzz in #434
- v6: Use float[] instead of Float[] for vectors by @bevzzz in #428
- fix(v6): add defensive checks to JSON deserialization by @bevzzz in #435
- v6: Custom TrustStore by @bevzzz in #427
- 🔒 chore(v6): upgrade all dependencies to their latest stable versions by @bevzzz in #431
- v6: include a shaded version of client6 in deployment bundle by @bevzzz in #429
New Contributors
- @yazan-abu-obaideh made their first contribution in #426
Full Changelog: 6.0.0-beta2...6.0.0-beta3
5.4.0
This release adds support for these Weaviate v1.32 features:
- Collection alias: manage collection aliases and associated RBAC permissions-
- Rotational Quantization: enable RQ in collection configuration
- RBAC Restore Options: control if roles and db-users should be included in backup restores
- Replication API: balance the load on the cluster nodes by moving shard replicas
What's Changed
- Add RQ by @robbespo00 in #398
- feat: Support collection aliases by @bevzzz in #409
- 🔒 chore(security): upgrade dependencies by @bevzzz in #413
- Configure alias permissions per collection by @bevzzz in #414
- Add backup restore options for users and roles by @bevzzz in #415
- feat: add replication API by @bevzzz in #410
- Update release configuration for main release branch by @bevzzz in #419
Full Changelog: 5.3.0...5.4.0
6.0.0-beta2 - Hybrid Search, Pagination, Batch Operations, Collection Configuration
Beta 2 expands the API coverage of client6
to serve most of the common production use cases. We now have complete support for all query types, notably Hybrid Search, provide sync and async Pagination APIs, and support Batch inserts and deletes.
Collection configuration and existing objects can now be updated; data can also be replaced entirely.
🚚 Batch Operations
var things = client.collections.use("Things");
// Insert multiple objects
var balloons = List.of("red", "blue", "green").stream()
.map(colour -> Map.of("colour", colour))
.toList();
var inserted = things.data.insertMany(balloons);
// Delete objects that match a condition (make a dry run to see the effect)
things.data.deleteMany(Where.property("price").gte(20), del -> del.dryRun(true));
// Create multiple references
var redBalloon = things.query.byId("red-balloon-uuid");
things.data.referenceAddMany(BatchReference.objects(redBalloon, "belongsTo", clownA, clownB));
🔍 Hybrid, NearObject, and Near Queries
things.query.hybrid("red balloons", hybrid -> hybrid.alpha(.2f).fusionType(Hybrid.FusionType.RANKED));
things.query.nearObject(blueBalloona.uuid());
things.query.nearVideo(base64_encoded_video);
🗂️ Pagination
Synchronous pagination lets you iterate through objects in the traditional for-loop or using the Stream API.
var all = client.paginate(p -> p.pageSize(100));
for (var object : all) {
System.out.println("uuid="+object.uuid());
}
var first300 = all.stream().take(300).toList();
Asynchronous pagination accepts per-object and per-page (for batch processing) callbacks:
var all = async.paginate();
all.forEach(object -> { ... }); // WeaviateObject
all.forPage(page -> { ... }); // List<WeaviateObject>
💡Vectorizer-first
While the choice of a vector index configuration might be more foundational to your data model conceptually, falling back to the default HNSW is often a sound choice in practice. As a user, it is useful to be able to concentrate on selecting the right vectorizer model and so, our new API puts the vectorizer first.
// Previously:
client.collections.create("MyThings", collection -> collection
.vectors(named -> named
.vector("title_vector", Hnsw.of(new Text2VecWeaviateVectorizer()))
.vector("image_vector", Hnsw.of(new Img2VecNeuralVectorizer()))
)
);
// With beta2 onwards:
client.collections.create("MyThings", collection -> collection
.vectors(
Vectorizer.text2vecWeaviate("title_vector", t2v -> t2v.vectorizeCollectionName(false)),
Vectorizer.img2vecNeaural("image_vector", i2v -> i2v.imageFields("thumbnail", "img"))
);
If needed, select a different index type or change default HNSW configuration explicitly:
Vectorizer.text2vecWeaviate("image_flat", i2v -> i2v.vectorIndex(Flat.of()))
What's Changed
- v6: Add, replace, and delete object references by @bevzzz in #393
- v6: list, deleteAll, exists methods for
collections
namespace by @bevzzz in #394 - v6: Add missing
data
methods by @bevzzz in #395 - v6: NearObject, Near, and Hybrid queries by @bevzzz in #396
- v6: Complete collection configuration and missing
config
functionality by @bevzzz in #397 - v6: Get and update shard status by @bevzzz in #401
- v6: Batch Operations (InsertMany, DeleteMany, AddReferencesMany) by @bevzzz in #400
- v6: Improved configuration options for WeaviateClient(-Async) by @bevzzz in #407
- v6: Create vector index Vectorizer-first style by @bevzzz in #406
- v6: Pagination by @bevzzz in #399
- v6: Update release configuration by @bevzzz in #408
Full Changelog: 6.0.0-beta1...6.0.0-beta2
6.0.0-beta1 - Async Client, Filters, BM25 and FetchObjects Queries, API-Key Authorization
The first beta of client6
has arrived!
🔑 Use the new API Key authorization to securely connect to your Weaviate instance:
final var client = new WeaviateClient(
Config.of("https", cfg -> cfg
.httpHost("localhost").httpPort(443)
.grpcHost("localhost").grpcPort(433)
.authorization(Authorization.apiKey("my-api-key"))));
Similarly to Python and TS, client6
offers convenient helper .local()
and .wcd()
methods for connecting to you local instance or the one running in the Weaviate Cloud.
🔍 Search and retrieve objects using bm25
and fetchObjects
queries:
final var books = client.collection.use("Books");
var crimeFiction = books.query.bm25("Sherlock Holmes", q -> q.queryProperties("main_character"));
var newestBooks = books.query.fetchObjects(
query -> query
.where(Where.property("yearPublished").gte(2024))
.limit(200));
Explore other filters and query parameters by downloading the latest version from your local Maven Ce.....
💥 The first beta of client6
has arrived (asynchronously!!!) 💥
The Async Client presents the same familiar API. Its methods return an instance of CompletableFuture
so they can be easily integrated with the existing processing pipelines. try
it out!
// WeaviateClient and WeaviateClientAsync implement Closable
try (final var asyncClient = client.async()) {
final var things = asyncClient.collections.use("Things");
things.data.insert(Map.of("shape", "square"))
.thenAccept(square -> System.out.println("square has id=" + square.metadata().uuid()));
}
What's Changed
- v6: Add async client to gRPC endpoints (query / aggregate) by @bevzzz in #383
- v6: Refactor REST endpoints and JSON de-/serialization by @bevzzz in #387
- v6: Filters and fetchObjects query by @bevzzz in #388
- v6: Authorization and connection helpers by @bevzzz in #389
- v6: add BM25 query by @bevzzz in #390
- v6: fix async toolchain by @bevzzz in #392
Full Changelog: 6.0.0-alpha2...6.0.0-beta1
5.3.0 - MUVERA, BM25 Search Operator
The 5.3.0
release adds support for several major features introduced in Weaviate v1.31.0
: BM25 And/Or search operators and MUVERA encoding for multi-vector indices.
We've also extended the collection management API with an ability to add named vectors to existing collections with client.schema().vectorAdder()
.
What's Changed
- Add muvera config by @robbespo00 in #382
- chore: add tests from WeaviateObject.Adapter by @bevzzz in #384
- Adding named vectors to collections by @bevzzz in #385
- feat: add searchOperator (minimum_should_match) to bm25 and hybrid arguments by @bevzzz in #386
New Contributors
- @robbespo00 made their first contribution in #382
Full Changelog: 5.2.1...5.3.0
6.0.0-alpha2
Further expanding the surface covered by the v6
client. Notably:
- Aggregations for TEXT and INT properties with optional NearVector filter
- Reference properties: creating, inserting, retrieving in queries
- BLOB data type and NearImage search
- Partial support for NearText search (not possible to select target vectors)
- New vectorizers:
text2vec-contextionary
,text2vec-weaviate
,multi2vec-clip
, andimg2vec-neural
What's Changed
- v6: Aggregate API by @bevzzz in #364
- v6: Cross-references in collection definition and queries by @bevzzz in #368
- v6: Implement feedback from Iteration I by @bevzzz in #381
Full Changelog: 6.0.0-alpha1...6.0.0-alpha2
5.2.1 - Security patches
Upgrade httpclient
dependency to v5.4.3
which includes a fix for a high-severity vulnerability.
What's Changed
Full Changelog: 5.2.0...5.2.1