Skip to content

Releases: weaviate/java-client

6.0.0-beta4 - Error Handling

13 Aug 14:38
e34e09a
Compare
Choose a tag to compare
Pre-release

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

31 Jul 12:42
2e61110
Compare
Choose a tag to compare

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

Full Changelog: 6.0.0-beta2...6.0.0-beta3

5.4.0

23 Jul 10:51
88bdd7e
Compare
Choose a tag to compare

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

Full Changelog: 5.3.0...5.4.0

6.0.0-beta2 - Hybrid Search, Pagination, Batch Operations, Collection Configuration

09 Jul 09:46
c6e18b2
Compare
Choose a tag to compare

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

17 Jun 12:48
ce0df8b
Compare
Choose a tag to compare

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

17 Jun 12:12
541afd8
Compare
Choose a tag to compare

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

Full Changelog: 5.2.1...5.3.0

6.0.0-alpha2

12 May 10:21
b3a5f4e
Compare
Choose a tag to compare
6.0.0-alpha2 Pre-release
Pre-release

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, and img2vec-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

29 Apr 17:11
1192482
Compare
Choose a tag to compare

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

5.2.0 - Dynamic User Management

10 Apr 14:18
1dc69db
Compare
Choose a tag to compare

Dynamic User Management is an extension to the RBAC functionality introduced in Weaviate v1.29, which allows creating new users programmatically as well as managing their roles and API keys.

To avoid name clashes with users authenticated via OIDC, each user is assigned a user type qualifier: db | oidc.
The clients makes working with different types of users easy by providing dedicated methods for each one:

  • users().db() -- dynamically created users and users defined in the server's environment variables
  • users().oidc() -- users using OIDC authentication

To avoid confusion, all users APIs from v5.1.* as well as part of the roles APIs are deprecated in favor of their namespaced counterparts.

Deprecations

  • users().assignedRolesGetter()
  • users().revoker()
  • users().assigner()
  • roles().assignedUsersGetter()

What's Changed

  • feat: support dynamic user management in Weaviate v1.30 by @bevzzz in #369

Full Changelog: 5.1.3...5.2.0

6.0.0-alpha1 - NearVector Search

09 Apr 13:29
ba70b15
Compare
Choose a tag to compare
Pre-release

Preview of the first iteration of the client rewrite, including:

  • Simple collection creation
  • Data management: insert, get, delete
  • Near vector query

What's Changed

  • v6: Collection management and near vector search by @bevzzz in #362

Full Changelog: 5.1.1...6.0.0-alpha1