From 2abf44562385cd391d5ffb0b6042751032326f11 Mon Sep 17 00:00:00 2001 From: Ivan Despot <66276597+g-despot@users.noreply.github.com> Date: Wed, 6 May 2026 12:55:11 +0200 Subject: [PATCH] Rename Java v6 --- .github/workflows/docs_tests.yml | 12 +- CLAUDE.md | 8 +- _includes/code/connections/connect.java | 181 ------------------ _includes/code/connections/oidc-connect.mdx | 2 +- _includes/code/connections/timeouts-cloud.mdx | 2 +- .../code/connections/timeouts-custom.mdx | 2 +- _includes/code/connections/timeouts-local.mdx | 2 +- .../howto/manage-data.create.with.geo.mdx | 2 +- .../manage-data.read.check.existence.mdx | 2 +- .../code/howto/manage-data.shards.inspect.mdx | 2 +- .../code/howto/manage-data.shards.update.mdx | 2 +- _includes/code/java-v6/pom.xml | 2 +- _includes/code/nodes.mdx | 2 +- _includes/code/quickstart.byov.schema.mdx | 2 +- ...uickstart.import.questions-and-vectors.mdx | 2 +- _includes/code/quickstart/clients.install.mdx | 2 +- .../code/quickstart/clients.install.new.mdx | 2 +- _includes/code/quickstart/connect.partial.mdx | 2 +- .../local.quickstart.create_collection.mdx | 2 +- .../local.quickstart.import_objects.mdx | 2 +- .../quickstart/local.quickstart.is_ready.mdx | 2 +- .../local.quickstart.query.neartext.mdx | 2 +- .../quickstart/local.quickstart.query.rag.mdx | 2 +- .../quickstart.create_collection.mdx | 2 +- .../quickstart/quickstart.import_objects.mdx | 2 +- .../code/quickstart/quickstart.is_ready.mdx | 2 +- .../quickstart/quickstart.query.neartext.mdx | 2 +- .../code/quickstart/quickstart.query.rag.mdx | 2 +- .../quickstart.short.create_collection.mdx | 2 +- ...ckstart.short.import-vectors.query.rag.mdx | 2 +- ...short.import_vectors.create_collection.mdx | 2 +- ....short.import_vectors.query.nearvector.mdx | 2 +- ...ickstart.short.local.create_collection.mdx | 2 +- ...t.short.local.import-vectors.query.rag.mdx | 2 +- ...local.import_vectors.create_collection.mdx | 2 +- ....local.import_vectors.query.nearvector.mdx | 2 +- .../quickstart.short.local.query.neartext.mdx | 2 +- .../quickstart.short.local.query.rag.mdx | 2 +- .../quickstart.short.query.neartext.mdx | 2 +- .../quickstart/quickstart.short.query.rag.mdx | 2 +- .../code/replication.get.object.by.id.mdx | 2 +- .../code/schema.things.properties.add.mdx | 2 +- _includes/code/tutorial.schema.create.mdx | 2 +- .../code/tutorial.schema.index-settings.mdx | 2 +- .../code/tutorial.schema.multi-tenancy.mdx | 2 +- .../tutorial.schema.properties.options.mdx | 2 +- _includes/schema-delete-class.mdx | 2 +- ...viate-embeddings-vectorizer-parameters.mdx | 2 +- docs/deploy/configuration/backups.md | 26 +-- .../installation-guides/digitalocean.md | 2 +- docs/weaviate/client-libraries/index.mdx | 4 +- docs/weaviate/client-libraries/java/index.mdx | 4 +- .../compression/bq-compression.md | 6 +- .../compression/multi-vectors.md | 2 +- .../compression/pq-compression.md | 8 +- .../compression/rq-compression.md | 22 +-- .../compression/sq-compression.md | 6 +- .../configuration/compression/uncompressed.md | 2 +- .../configuration/rbac/manage-groups.mdx | 10 +- .../configuration/rbac/manage-roles.mdx | 38 ++-- .../configuration/rbac/manage-users.mdx | 20 +- docs/weaviate/connections/connect-cloud.mdx | 4 +- docs/weaviate/connections/connect-custom.mdx | 4 +- docs/weaviate/connections/connect-local.mdx | 8 +- .../manage-collections/collection-aliases.mdx | 14 +- .../collection-operations.mdx | 14 +- .../manage-collections/cross-references.mdx | 24 +-- .../generative-reranker-models.mdx | 8 +- .../manage-collections/inverted-index.mdx | 8 +- docs/weaviate/manage-collections/migrate.mdx | 20 +- .../manage-collections/multi-node-setup.mdx | 6 +- .../manage-collections/multi-tenancy.mdx | 24 +-- .../manage-collections/tenant-states.mdx | 8 +- .../manage-collections/time-to-live.mdx | 6 +- .../manage-collections/vector-config.mdx | 18 +- docs/weaviate/manage-objects/create.mdx | 14 +- docs/weaviate/manage-objects/delete.mdx | 10 +- docs/weaviate/manage-objects/import.mdx | 22 +-- .../manage-objects/read-all-objects.mdx | 6 +- docs/weaviate/manage-objects/read.mdx | 6 +- docs/weaviate/manage-objects/update.mdx | 8 +- .../weaviate/embeddings-multimodal.md | 10 +- .../model-providers/weaviate/embeddings.md | 12 +- docs/weaviate/search/aggregate.md | 16 +- docs/weaviate/search/basics.md | 18 +- docs/weaviate/search/bm25.md | 24 +-- docs/weaviate/search/filters.md | 30 +-- docs/weaviate/search/generative.md | 16 +- docs/weaviate/search/hybrid.md | 32 ++-- docs/weaviate/search/image.md | 6 +- docs/weaviate/search/multi-vector.md | 14 +- docs/weaviate/search/similarity.md | 20 +- .../starter-guides/custom-vectors.mdx | 4 +- docs/weaviate/starter-guides/generative.md | 26 +-- .../weaviate/tutorials/collection-aliases.mdx | 16 +- pytest.ini | 2 +- src/theme/Tabs/index.js | 2 +- tests/README.md | 10 +- tests/{test_java_v6.py => test_java.py} | 28 +-- tools/add_csharp.py | 44 ++--- 100 files changed, 411 insertions(+), 592 deletions(-) delete mode 100644 _includes/code/connections/connect.java rename tests/{test_java_v6.py => test_java.py} (81%) diff --git a/.github/workflows/docs_tests.yml b/.github/workflows/docs_tests.yml index 88cc279f..aa529ac3 100644 --- a/.github/workflows/docs_tests.yml +++ b/.github/workflows/docs_tests.yml @@ -332,8 +332,8 @@ jobs: done docker system prune -f --volumes 2>/dev/null || true - test-java-v6: - name: Test Java v6 + test-java: + name: Test Java runs-on: ubuntu-latest timeout-minutes: 30 @@ -431,7 +431,7 @@ jobs: - name: Record test start time run: echo "TEST_START_TIME=$(date +%s)" >> $GITHUB_ENV - - name: Run Java v6 tests + - name: Run Java tests id: run-tests continue-on-error: true env: @@ -448,8 +448,8 @@ jobs: HUGGINGFACE_API_KEY: ${{ secrets.HUGGINGFACE_API_KEY }} ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} run: | - echo "🧪 Running Java v6 tests..." - uv run pytest -m "java_v6" -v --tb=short --durations=10 -s --junitxml=pytest-results.xml + echo "🧪 Running Java tests..." + uv run pytest -m "java" -v --tb=short --durations=10 -s --junitxml=pytest-results.xml echo "✅ Tests completed" - name: Handle test results @@ -457,7 +457,7 @@ jobs: uses: ./.github/actions/handle-test-results with: test-outcome: ${{ steps.run-tests.outcome }} - test-type: 'Java-v6' + test-type: 'Java' languages-tested: 'Java' slack-bot-token: ${{ secrets.TESTING_CI_SLACK_BOT }} diff --git a/CLAUDE.md b/CLAUDE.md index 7ddd7a62..8916fffd 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -59,7 +59,7 @@ tests/start-weaviate.sh tests/stop-weaviate.sh ``` -#### Java v6 Tests +#### Java Tests ```bash cd _includes/code/java-v6 mvn clean install @@ -212,7 +212,7 @@ Code snippets are organized by language under `_includes/code/`: |----------|--------------|----------------|---------------|-------------| | Python | `_includes/code/howto/*.py` | pytest (in `/tests`) | `weaviate-client` from PyPI (`pyproject.toml`) | `uv run python _includes/code/howto/.py` | | TypeScript | `_includes/code/howto/*.ts` | Inline assertions (no test runner) | `weaviate-client` from npm (`package.json`) | `npx tsx _includes/code/howto/.ts` | -| Java v6 | `_includes/code/java-v6/src/test/java/*.java` | JUnit 5 + AssertJ | `io.weaviate:client6` from Maven/local (`pom.xml`) | `cd _includes/code/java-v6 && mvn test -Dtest=` | +| Java | `_includes/code/java-v6/src/test/java/*.java` | JUnit 5 + AssertJ | `io.weaviate:client6` from Maven/local (`pom.xml`) | `cd _includes/code/java-v6 && mvn test -Dtest=` | | C# | `_includes/code/csharp/*.cs` | xunit | Local project ref to `../../csharp-client/` (`WeaviateProject.Tests.csproj`) | `dotnet test _includes/code/csharp/WeaviateProject.Tests.csproj --filter "FullyQualifiedName~"` | | Go | `_includes/code/howto/go/docs/*.go` | Go testing | `github.com/weaviate/weaviate-go-client` | `cd _includes/code/howto/go/docs && go test` | @@ -220,7 +220,7 @@ Code snippets are organized by language under `_includes/code/`: - **Python**: Version pinned in `pyproject.toml`. Install via `uv sync`. - **TypeScript**: Version in root `package.json` (`devDependencies`). Uses `tsx` to run `.ts` files directly. -- **Java v6**: Version in `_includes/code/java-v6/pom.xml`. For unreleased features, switch to SNAPSHOT: build the local client at `/Users/ivandespot/dev/java-client` with `mvn install -DskipTests -Dmaven.javadoc.skip=true`, then update the pom.xml version. +- **Java**: Version in `_includes/code/java-v6/pom.xml`. For unreleased features, switch to SNAPSHOT: build the local client at `/Users/ivandespot/dev/java-client` with `mvn install -DskipTests -Dmaven.javadoc.skip=true`, then update the pom.xml version. - **C#**: References a local project at `../../../../csharp-client/` (i.e., `/Users/ivandespot/dev/csharp-client`). For unreleased features, checkout the appropriate branch in that repo (e.g., `git checkout v1.0.1`). The .NET 9.0 SDK is required. - **Go**: Version in `_includes/code/howto/go/docs/go.mod`. @@ -250,7 +250,7 @@ import PyCode from '!!raw-loader!/_includes/code/howto/manage-data.ttl.py'; - `(await collection.aggregate.overAll()).totalCount` - Config: `await collection.config.get()` returns object with camelCase fields -**Java v6** (`client6`): +**Java** (`client6`): - `WeaviateClient client = WeaviateClient.connectToLocal()` - `client.collections.create("Name", c -> c.properties(Property.date("fieldName")).objectTtl(ttl -> ttl.deleteByCreationTime().defaultTtlSeconds(3600)))` - `collection.config.get()` returns `Optional` — must call `.get().get()` to unwrap diff --git a/_includes/code/connections/connect.java b/_includes/code/connections/connect.java deleted file mode 100644 index 93e16663..00000000 --- a/_includes/code/connections/connect.java +++ /dev/null @@ -1,181 +0,0 @@ -// THIS FILE HASN'T BEEN TESTED TO RUN END-TO-END - -///////////////////// -/// Cloud connect /// -///////////////////// - -// START APIKeyWCD -// Set these environment variables -// WEAVIATE_HOSTNAME Your Weaviate instance hostname -// WEAVIATE_API_KEY Your Weaviate instance API key - -package your.application; - -import io.weaviate.client.Config; -import io.weaviate.client.WeaviateClient; -import io.weaviate.client.WeaviateAuthClient; - -public class App -{ - public static void main( String[] args ) throws Exception - { - - String scheme = "https"; - String host = System.getenv("WEAVIATE_HOSTNAME"); - String apiKey = System.getenv("WEAVIATE_API_KEY"); - - Config config = new Config(scheme, host); - WeaviateClient client = WeaviateAuthClient.apiKey(config, apiKey); - } -} -// END APIKeyWCD - -// START ThirdPartyAPIKeys -// Set these environment variables -// WEAVIATE_HOSTNAME Your Weaviate instance hostname -// WEAVIATE_API_KEY Your Weaviate instance API key -// COHERE_API_KEY Your Cohere API key - -package your.application; - -import java.util.HashMap; -import java.util.Map; -import io.weaviate.client.Config; -import io.weaviate.client.WeaviateClient; -import io.weaviate.client.WeaviateAuthClient; - -public class App -{ - public static void main( String[] args ) throws Exception - { - - String scheme = "https"; - String host = System.getenv("WEAVIATE_HOSTNAME"); - String apiKey = System.getenv("WEAVIATE_API_KEY"); - String cohereKey = System.getenv("COHERE_API_KEY"); - - Map headers = new HashMap() { { - put("X-Cohere-Api-Key", cohereKey); - } }; - - Config config = new Config(scheme, host, headers); - WeaviateClient client = WeaviateAuthClient.apiKey(config, apiKey); - } -} -// END ThirdPartyAPIKeys - -////////////////// -/// Local auth /// -////////////////// - -// START LocalAuth -// Set this environment variable -// WEAVIATE_API_KEY your Weaviate instance API key - -package your.application; - -import io.weaviate.client.Config; -import io.weaviate.client.WeaviateClient; -import io.weaviate.client.WeaviateAuthClient; - -public class App -{ - public static void main( String[] args ) throws Exception - { - - String scheme = "http"; - String host = "localhost:8080"; - String apiKey = System.getenv("WEAVIATE_API_KEY"); - - Config config = new Config(scheme, host); - WeaviateClient client = WeaviateAuthClient.apiKey(config, apiKey); - } -} -// END LocalAuth - -///////////////////// -/// Local no auth /// -///////////////////// - -// START LocalNoAuth -package your.application; - -import io.weaviate.client.Config; -import io.weaviate.client.WeaviateClient; - -public class App -{ - public static void main( String[] args ) throws Exception - { - - String scheme = "http"; - String host = "localhost:8080"; - - Config config = new Config(scheme, host); - WeaviateClient client = new WeaviateClient(config); - } -} -// END LocalNoAuth - -////////////////////////// -/// Custom URL or port /// -////////////////////////// - -// START CustomURL -package your.application; - -import io.weaviate.client.Config; -import io.weaviate.client.WeaviateClient; - -public class App -{ - public static void main( String[] args ) throws Exception - { - - String scheme = "http"; - String host = "localhost:8080"; - // The Java client doesn't use the gRPC port - - Config config = new Config(scheme, host); - WeaviateClient client = new WeaviateClient(config); - } -} -// END CustomURL - -////////////////////// -/// Local 3d party /// -////////////////////// - -// START LocalThirdPartyAPIKeys -// Set this environment variable -// COHERE_API_KEY your Cohere API key - -package your.application; - -import java.util.HashMap; -import java.util.Map; -import io.weaviate.client.Config; -import io.weaviate.client.WeaviateClient; - -public class App -{ - public static void main( String[] args ) throws Exception - { - - String scheme = "http"; - String host = "localhost:8080"; - String cohereKey = System.getenv("COHERE_API_KEY"); - - Map headers = new HashMap() { { - put("X-Cohere-Api-Key", cohereKey); - } }; - - Config config = new Config(scheme, host, headers); - WeaviateClient client = new WeaviateClient(config); - } -} -// END LocalThirdPartyAPIKeys - - -// OIDC examples for Java are now in the Java v6 client. -// See _includes/code/java-v6/src/test/java/ConnectionTest.java (OIDCConnect marker). diff --git a/_includes/code/connections/oidc-connect.mdx b/_includes/code/connections/oidc-connect.mdx index 0a5800ae..d05b5b98 100644 --- a/_includes/code/connections/oidc-connect.mdx +++ b/_includes/code/connections/oidc-connect.mdx @@ -33,7 +33,7 @@ import CSharpCode from '!!raw-loader!/_includes/code/csharp/ConnectionTest.cs'; language="go" /> - + - + - + - + - + - + - + - + - + org.slf4j slf4j-simple diff --git a/_includes/code/nodes.mdx b/_includes/code/nodes.mdx index 7b7e3ab5..2325027a 100644 --- a/_includes/code/nodes.mdx +++ b/_includes/code/nodes.mdx @@ -64,7 +64,7 @@ func main() { ``` - + - + - + - + Add this dependency to your project:

diff --git a/_includes/code/quickstart/clients.install.new.mdx b/_includes/code/quickstart/clients.install.new.mdx index d3d6dc95..2c9d638c 100644 --- a/_includes/code/quickstart/clients.install.new.mdx +++ b/_includes/code/quickstart/clients.install.new.mdx @@ -23,7 +23,7 @@ go get github.com/weaviate/weaviate-go-client/v5 ```
- + ```xml diff --git a/_includes/code/quickstart/connect.partial.mdx b/_includes/code/quickstart/connect.partial.mdx index f954dc9c..f2eb0b5d 100644 --- a/_includes/code/quickstart/connect.partial.mdx +++ b/_includes/code/quickstart/connect.partial.mdx @@ -39,7 +39,7 @@ import HostnameWarning from "/_includes/wcs/hostname-warning.mdx"; /> - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + ```java // Java support coming soon @@ -160,7 +160,7 @@ The TypeScript client v3 uses gRPC by default. The legacy TypeScript client does not support gRPC. - + The Java client v6 uses gRPC by default. @@ -246,7 +246,7 @@ Weaviate generates an UUID for each object. Object IDs must be unique. If you se language="go" /> - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + Coming soon - + - + - + - + - + ```java // Coming soon @@ -174,7 +174,7 @@ If you prefer to store the raw multi-vector embeddings without MUVERA compressio // Coming soon ``` - + ```java // Coming soon @@ -264,7 +264,7 @@ The query below returns the `n` most similar objects from the database, set by ` language="goraw" /> - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + ```xml @@ -184,7 +184,7 @@ This [`nearVector`](/weaviate/search/similarity#search-with-a-vector) query supp language="ts" /> - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + .*?)', tabs_block, re.DOTALL + # Find the Java tab. We assume TabItems are not nested within each other. + java_tab_match = re.search( + r'(.*?)', tabs_block, re.DOTALL ) - if not java6_tab_match: + if not java_tab_match: return tabs_block - java6_tab_text = java6_tab_match.group(1) + java_tab_text = java_tab_match.group(1) - # Extract start and end markers from within the Java v6 tab text. + # Extract start and end markers from within the Java tab text. marker_match = re.search( - r'startMarker="([^"]+)"[\s\S]*?endMarker="([^"]+)"', java6_tab_text, re.DOTALL + r'startMarker="([^"]+)"[\s\S]*?endMarker="([^"]+)"', java_tab_text, re.DOTALL ) if not marker_match: - # Cannot proceed if markers aren't found in the Java v6 tab. + # Cannot proceed if markers aren't found in the Java tab. return tabs_block start_marker, end_marker = marker_match.groups() @@ -89,18 +89,18 @@ def add_csharp_tab_to_block(tabs_block_match): ).strip() # Determine the correct insertion point. - # We insert after the Java v6 tab, OR after the regular Java tab - # if it immediately follows the Java v6 tab. + # We insert after the Java tab, OR after the regular Java tab + # if it immediately follows the Java tab. - end_of_java6_match = java6_tab_match.end() - rest_of_block_after_java6 = tabs_block[end_of_java6_match:] + end_of_java_match = java_tab_match.end() + rest_of_block_after_java = tabs_block[end_of_java_match:] # Check if the next element is a regular Java tab. - if re.match(r'\s*.*?)', - rest_of_block_after_java6, + rest_of_block_after_java, re.DOTALL, ) if java_tab_match: @@ -110,9 +110,9 @@ def add_csharp_tab_to_block(tabs_block_match): java_tab_text, f"{java_tab_text}\n {csharp_tab_text}" ) - # If no regular Java tab followed, insert after the Java v6 tab. - # Replace the Java v6 tab with itself plus the new C# tab. - return tabs_block.replace(java6_tab_text, f"{java6_tab_text}\n {csharp_tab_text}") + # If no regular Java tab followed, insert after the Java tab. + # Replace the Java tab with itself plus the new C# tab. + return tabs_block.replace(java_tab_text, f"{java_tab_text}\n {csharp_tab_text}") def process_file_content(content): @@ -170,7 +170,7 @@ def process_directory(directory_path, file_extensions, dry_run=True): def main(): parser = argparse.ArgumentParser( - description="Adds C# TabItem blocks after Java v6/Java tabs in documentation files." + description="Adds C# TabItem blocks after Java/Java tabs in documentation files." ) parser.add_argument("directory", help="Directory to process") parser.add_argument(