Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Official Weaviate Java Client

License

NotificationsYou must be signed in to change notification settings

weaviate/java-client

A Java native client for Weaviate.

Usage

To start using Weaviate Java client add this dependency topom.xml:

<dependency>    <groupId>io.weaviate</groupId>    <artifactId>client</artifactId>    <version>5.5.0</version></dependency>

For applications on Java 9 or above

The client utilizes Gson for JSON serialization/deserialization and Gson uses reflection of internaljava.lang classesto do it. This is not allowed by default in Java 9 and above.

To work around this, it's necessary to add this JVM commandline argument:

--add-opens=java.base/java.lang=ALL-UNNAMED

If you're using Gradle, you can add this instead to yourapplication block in yourbuild.gradle.kts file:

applicationDefaultJvmArgs+=listOf("--add-opens=java.base/java.lang=ALL-UNNAMED",)

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

  1. Add dependency to your java project.

  2. Connect to Weaviate onlocalhost:8080 and fetch meta information

packageio.weaviate;importio.weaviate.client.Config;importio.weaviate.client.WeaviateClient;importio.weaviate.client.base.Result;importio.weaviate.client.v1.misc.model.Meta;publicclassApp {publicstaticvoidmain(String[]args) {Configconfig =newConfig("http","localhost:8080");WeaviateClientclient =newWeaviateClient(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

Build Status

About

Official Weaviate Java Client

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Contributors18


[8]ページ先頭

©2009-2025 Movatter.jp