samos123 / weaviate-java-client

Official Weaviate Java Client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Java 99.9%Language:Shell 0.1%