Skip to content

Latest commit

 

History

History
62 lines (45 loc) · 2.14 KB

README.md

File metadata and controls

62 lines (45 loc) · 2.14 KB

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.5.0</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