Skip to content

aliszka/weaviate-java-client

 
 

Repository files navigation

Weaviate Java client Weaviate logo

A Java native client for weaviate.

Usage

In order to get start using the java client one needs to add it's dependency:

<dependency>
  <groupId>technology.semi.weaviate</groupId>
  <artifactId>client</artifactId>
  <version>3.4.2</version>
</dependency>

Here's a simple code to start up working with Java client:

  1. Add dependency to your java project.

  2. Connect to Weaviate on localhost:8080 and fetch meta information

import technology.semi.weaviate.client.Config;
import technology.semi.weaviate.client.WeaviateClient;
import technology.semi.weaviate.client.base.Result;
import technology.semi.weaviate.client.v1.misc.model.Meta;

public class App {
  public static void main(String[] args) {
    Config config = new Config("http", "localhost:8080");
    WeaviateClient client = new WeaviateClient(config);
    Result<Meta> meta = client.misc().metaGetter().run();
    if (meta.hasErrors()) {
      System.out.printf("Error: %s\n", meta.getError().getMessages());
    } else {
      System.out.printf("meta.hostname: %s\n", meta.getResult().getHostname());
      System.out.printf("meta.version: %s\n", meta.getResult().getVersion());
      System.out.printf("meta.modules: %s\n", meta.getResult().getModules());
    }
  }
}

Documentation

Support

Contributing

Build Status

Branch Status
Main Build Status

About

Official Weaviate Java Client

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 99.8%
  • Shell 0.2%