Skip to content

Conversation

@yamiSukehiro2907
Copy link

@yamiSukehiro2907 yamiSukehiro2907 commented Nov 18, 2025

Fixes #888


πŸš€ Meilisearch Java SDK – Support for Meilisearch 1.18

What does this PR do?

This PR adds full support for Meilisearch 1.18 features in the Java SDK.
It implements:


1. queryVector support in search responses

  • When a search request includes retrieveVectors=true, Meilisearch now returns a new queryVector field.
  • The SDK has been updated to deserialize this field inside SearchResult.
  • Users can now access it via getQueryVector().
  • Added a new test:
    • SearchResultQueryVectorTest

2. Index renaming using PATCH /indexes/:uid

  • Updated IndexesHandler.updateIndex() to accept a new indexUid parameter for renaming.
  • Example request supported:
{ "indexUid": "indexB" }
  • Added test:

    • IndexRenameTest

3. Index renaming using swap-indexes

  • Updated SwapIndexesParams to include rename.
  • Updated IndexesHandler.swapIndexes() to send the rename flag.
  • Supports usage like:
[
  {
    "indexes": ["indexA", "indexB"],
    "rename": true
  }
]
  • Added test:

    • SwapIndexRenameTest

4. Code sample update

  • Added a new example under the rename_an_index_1 key in
    .code-samples.meilisearch.yaml
  • The example matches the official CURL snippet for renaming via index update.

Summary of changes

Source

  • SearchResult.java
  • IndexesHandler.java
  • SwapIndexesParams.java
  • Index.java (if updated method exposed)

Tests

  • SearchResultQueryVectorTest.java
  • IndexRenameTest.java
  • SwapIndexRenameTest.java

Documentation

  • .code-samples.meilisearch.yaml

PR Checklist

  • Implements all Meilisearch 1.18 features required by the issue
  • Tests added for all new behavior
  • All tests pass (./gradlew clean build)
  • Formatting applied (spotlessApply)
  • Descriptive and accurate PR title
  • No breaking changes introduced

Summary by CodeRabbit

  • New Features

    • Index renaming capability (direct UID updates)
    • Query vectors included in search results
    • Rename option added to index-swap operations
    • New code sample demonstrating index rename usage
  • Tests

    • Added tests covering index rename, swap-with-rename scenarios, and queryVector mapping
  • Chores

    • Release version bumped to 1.26.0

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 18, 2025

Walkthrough

Adds support for index renaming via a new IndexesHandler.updateIndexUid and Client.updateIndex overload, adds a queryVector field to search result models, introduces a rename flag to SwapIndexesParams, adds unit tests for these features, and includes sample/metadata files and a MockWebServer test dependency.

Changes

Cohort / File(s) Summary
Index renaming implementation
src/main/java/com/meilisearch/sdk/IndexesHandler.java, src/main/java/com/meilisearch/sdk/Client.java
Added updateIndexUid(String uid, String indexUid) to IndexesHandler and an overloaded Client.updateIndex(String uid, String primaryKey, String indexUid) that delegates to updateIndexUid when indexUid is non-null.
Search result models
src/main/java/com/meilisearch/sdk/model/SearchResult.java, src/main/java/com/meilisearch/sdk/model/SearchResultPaginated.java
Added queryVector field (ArrayList<Float>) to both classes to capture vector query results.
Swap indexes params
src/main/java/com/meilisearch/sdk/model/SwapIndexesParams.java
Added protected rename (Boolean) field (Lombok accessors present) to include rename flag in swap-indexes payloads.
Unit tests (index rename & vectors & swap rename)
src/test/java/com/meilisearch/sdk/IndexRenameTest.java, src/test/java/com/meilisearch/sdk/SearchResultQueryVectorTest.java, src/test/java/com/meilisearch/sdk/SwapIndexesRenameTest.java
Added tests using MockWebServer: verify PATCH /indexes/{uid} rename payload and responses, verify queryVector deserialization into SearchResult, and verify swap-indexes POST payloads include rename flag and multiple index pairs.
Build/test dependency
build.gradle
Added testImplementation dependency: com.squareup.okhttp3:mockwebserver:4.12.0.
Samples & metadata
.code-samples.meilisearch.yaml, data.ms/VERSION, data.ms/instance-uid
Added a code sample entry (rename_an_index_1), version file 1.26.0, and an instance UUID file.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant IndexesHandler
    participant API as Meilisearch API

    Note over Client,API: Index rename via PATCH
    Client->>Client: updateIndex("indexA", null, "indexB")
    Client->>IndexesHandler: updateIndexUid("indexA","indexB")
    IndexesHandler->>API: PATCH /indexes/indexA { "indexUid":"indexB" }
    API-->>IndexesHandler: 202 TaskInfo
    IndexesHandler-->>Client: TaskInfo
Loading
sequenceDiagram
    participant SearchAPI
    participant GsonHandler as GsonJsonHandler
    participant SearchResult

    Note over SearchAPI,SearchResult: queryVector mapping
    SearchAPI->>GsonHandler: JSON with "queryVector":[0.1,0.2,0.3]
    GsonHandler->>SearchResult: Populate fields
    SearchResult->>SearchResult: queryVector = [0.1F,0.2F,0.3F]
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Areas to focus:
    • Client.java / IndexesHandler.java: null-handling and correct PATCH payload & path composition.
    • Model field additions (SearchResult*, SwapIndexesParams): JSON mapping, Lombok visibility, and backward compatibility.
    • Tests: MockWebServer request assertions (method, path, headers, body) and response parsing.
    • Build file: ensure test dependency version aligns with project test toolchain.

Suggested labels

enhancement

Suggested reviewers

  • brunoocasali

Poem

🐰 I hopped a patch from A to B with cheer,

renaming indexes, no need to fear.
Vectors now dance in each search's reply,
Tests stand guard as the changes hop by. πŸ₯•

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 21.05% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
βœ… Passed checks (4 passed)
Check name Status Explanation
Description Check βœ… Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check βœ… Passed All requirements from issue #888 are met: queryVector field added to SearchResult and SearchResultPaginated [#888], index renaming via PATCH added to IndexesHandler and Client [#888], index renaming via swap added with rename flag to SwapIndexesParams [#888], comprehensive tests included, and code sample added [#888].
Out of Scope Changes check βœ… Passed All changes directly support Meilisearch 1.18 feature requirements: queryVector support, index renaming via PATCH, index renaming via swap, tests, code samples, and mock-webserver dependency for testing.
Title check βœ… Passed The PR title clearly and specifically summarizes the main changes: adding support for Meilisearch 1.18 features (queryVector and index renaming), which aligns with the primary objectives and file modifications.
✨ Finishing touches
  • πŸ“ Generate docstrings
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

πŸ“ Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests β€” including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. πŸ“ Description β€” Summarize the main change in 50–60 words, explaining what was done.
  2. πŸ““ References β€” List relevant issues, discussions, documentation, or related PRs.
  3. πŸ“¦ Dependencies & Requirements β€” Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. πŸ“Š Contributor Summary β€” Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. βœ”οΈ Additional Notes β€” Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❀️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (5)
src/main/java/com/meilisearch/sdk/model/SearchResultPaginated.java (1)

26-26: Consider adding test coverage for queryVector in paginated results

The queryVector field is consistent with SearchResult and will be exposed via Lombok getters, which is good. To avoid regressions, I’d add a small test that deserializes a paginated search response including queryVector and asserts the values, similar to SearchResultQueryVectorTest.

src/main/java/com/meilisearch/sdk/model/SwapIndexesParams.java (1)

13-13: Document the semantics of the rename flag on swap-indexes params

The rename flag integrates nicely with the existing chained params and will serialize as "rename": true when set. To help users discover it, consider expanding the class-level or method-level docs (and any public docs) to briefly explain that when rename is true, the swap also renames the indexes according to Meilisearch 1.18 semantics.

src/main/java/com/meilisearch/sdk/IndexesHandler.java (1)

124-136: Index rename handler is correct; consider a small guard for invalid input

updateIndexUid correctly constructs a {"indexUid": "<newUid>"} body and PATCHes /indexes/{uid}, matching the intended rename flow and the pattern used by updatePrimaryKey.

You might optionally add a simple precondition (e.g., reject null/blank indexUid) to fail fast if this method is ever called directly with invalid input, instead of relying solely on the Client overload to guard it.

src/main/java/com/meilisearch/sdk/Client.java (1)

168-175: Overloaded updateIndex works; consider clarifying behavior and API shape

The new overload cleanly routes:

  • to updateIndexUid when indexUid != null (rename), and
  • to updatePrimaryKey otherwise (primary key update),

so behavior is correct and non-breaking for existing callers.

Two optional improvements to consider:

  • Clarify the Javadoc to explicitly describe the precedence (β€œif indexUid is non-null, the primary key argument is ignored”) so callers don’t assume both can be updated in one call.
  • Long term, a dedicated renameIndex(String uid, String indexUid) entry point could make the API more explicit than a tri-parameter overload that multiplexes two concerns.
src/test/java/com/meilisearch/sdk/SearchResultQueryVectorTest.java (1)

12-31: Consider adding edge case tests.

The test validates the happy path for queryVector deserialization. Consider adding test cases for edge scenarios:

  • queryVector field is absent (should be null or empty)
  • queryVector is null in JSON
  • queryVector is an empty array

This ensures robust handling of various API response formats.

πŸ“œ Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 45861af and a6bf507.

πŸ“’ Files selected for processing (11)
  • .code-samples.meilisearch.yaml (1 hunks)
  • data.ms/VERSION (1 hunks)
  • data.ms/instance-uid (1 hunks)
  • src/main/java/com/meilisearch/sdk/Client.java (2 hunks)
  • src/main/java/com/meilisearch/sdk/IndexesHandler.java (1 hunks)
  • src/main/java/com/meilisearch/sdk/model/SearchResult.java (1 hunks)
  • src/main/java/com/meilisearch/sdk/model/SearchResultPaginated.java (1 hunks)
  • src/main/java/com/meilisearch/sdk/model/SwapIndexesParams.java (1 hunks)
  • src/test/java/com/meilisearch/sdk/IndexRenameTest.java (1 hunks)
  • src/test/java/com/meilisearch/sdk/SearchResultQueryVectorTest.java (1 hunks)
  • src/test/java/com/meilisearch/sdk/SwapIndexRenameTest.java (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (3)
src/test/java/com/meilisearch/sdk/SearchResultQueryVectorTest.java (1)
src/main/java/com/meilisearch/sdk/json/GsonJsonHandler.java (1)
  • GsonJsonHandler (12-56)
src/test/java/com/meilisearch/sdk/SwapIndexRenameTest.java (1)
src/main/java/com/meilisearch/sdk/http/CustomOkHttpClient.java (1)
  • CustomOkHttpClient (18-126)
src/test/java/com/meilisearch/sdk/IndexRenameTest.java (1)
src/main/java/com/meilisearch/sdk/http/CustomOkHttpClient.java (1)
  • CustomOkHttpClient (18-126)
πŸ”‡ Additional comments (5)
data.ms/VERSION (1)

1-1: Ensure VERSION value stays in sync with published SDK version

1.26.0 looks fine as a data marker, but please double-check it matches the actual SDK version used in packaging (e.g., Maven coordinates, release notes) so tests and metadata don’t drift.

data.ms/instance-uid (1)

1-1: UUID fixture looks fine

Static instance UID value is acceptable as a deterministic fixture; no functional issues from this change.

.code-samples.meilisearch.yaml (1)

857-858: Rename sample correctly targets the new updateIndex overload

The rename_an_index_1 snippet uses client.updateIndex("indexA", null, "indexB");, which cleanly maps to β€œrename indexA to indexB” while leaving the primary key untouched. This aligns with the new overload semantics and fits well with the surrounding samples.

src/main/java/com/meilisearch/sdk/model/SearchResult.java (1)

21-21: queryVector field addition is consistent and testable

Adding ArrayList<Float> queryVector; alongside existing response fields is consistent with the current model style and should deserialize correctly given the existing JSON mapping and the dedicated test.

src/main/java/com/meilisearch/sdk/Client.java (1)

13-13: Wildcard java.util import is acceptable given multiple usages

Switching to import java.util.*; is harmless here, since the class already depends on several java.util types (Map, HashMap, Date, TimeZone, UUID). No action needed unless your style guide prefers explicit imports.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (3)
src/test/java/com/meilisearch/sdk/IndexRenameTest.java (1)

62-80: Optional: align second test’s HTTP assertions with the first.

The second test correctly verifies path and payload for different names. For symmetry and slightly stronger coverage, you could also assert the HTTP method and Authorization header as in the first test.

-        RecordedRequest request = mockServer.takeRequest();
-        assertThat(request.getPath(), equalTo("/indexes/oldIndex"));
-
-        String requestBody = request.getBody().readUtf8();
+        RecordedRequest request = mockServer.takeRequest();
+        assertThat(request.getMethod(), equalTo("PATCH"));
+        assertThat(request.getPath(), equalTo("/indexes/oldIndex"));
+        assertThat(request.getHeader("Authorization"), equalTo("Bearer masterKey"));
+
+        String requestBody = request.getBody().readUtf8();
         assertThat(requestBody, containsString("\"indexUid\":\"newIndex\""));
src/test/java/com/meilisearch/sdk/SwapIndexesRenameTest.java (2)

72-99: Non-rename swap test is good; header assertion is an optional enhancement.

The test correctly covers rename=false, index names, and taskUid. For parity with the first test, you might also assert the Authorization header, but the current coverage is acceptable.

-        RecordedRequest request = mockServer.takeRequest();
-        assertThat(request.getMethod(), equalTo("POST"));
-        assertThat(request.getPath(), equalTo("/swap-indexes"));
-
-        String requestBody = request.getBody().readUtf8();
+        RecordedRequest request = mockServer.takeRequest();
+        assertThat(request.getMethod(), equalTo("POST"));
+        assertThat(request.getPath(), equalTo("/swap-indexes"));
+        assertThat(request.getHeader("Authorization"), equalTo("Bearer masterKey"));
+
+        String requestBody = request.getBody().readUtf8();
         assertThat(requestBody, containsString("\"rename\":false"));

101-132: Consider slightly strengthening multi-pair swap assertions and reducing JSON-shape brittleness.

The multi-pair test correctly verifies both index pairs and that the payload is a JSON array. To make it a bit more robust and explicit you could:

  • Trim the body before startsWith/endsWith so a trailing newline won’t break the test.
  • Optionally assert both "rename":true and "rename":false are present to ensure per-pair flags are serialized.
-        String requestBody = request.getBody().readUtf8();
-
-        assertThat(requestBody, containsString("\"indexA\""));
-        assertThat(requestBody, containsString("\"indexB\""));
-        assertThat(requestBody, containsString("\"indexC\""));
-        assertThat(requestBody, containsString("\"indexD\""));
-        assertThat(requestBody, startsWith("["));
-        assertThat(requestBody, endsWith("]"));
+        String requestBody = request.getBody().readUtf8();
+
+        assertThat(requestBody, containsString("\"indexA\""));
+        assertThat(requestBody, containsString("\"indexB\""));
+        assertThat(requestBody, containsString("\"indexC\""));
+        assertThat(requestBody, containsString("\"indexD\""));
+        assertThat(requestBody, containsString("\"rename\":true"));
+        assertThat(requestBody, containsString("\"rename\":false"));
+
+        String trimmedBody = requestBody.trim();
+        assertThat(trimmedBody, startsWith("["));
+        assertThat(trimmedBody, endsWith("]"));
πŸ“œ Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between a6bf507 and 2a5ec2f.

πŸ“’ Files selected for processing (3)
  • build.gradle (1 hunks)
  • src/test/java/com/meilisearch/sdk/IndexRenameTest.java (1 hunks)
  • src/test/java/com/meilisearch/sdk/SwapIndexesRenameTest.java (1 hunks)
βœ… Files skipped from review due to trivial changes (1)
  • build.gradle
πŸ”‡ Additional comments (4)
src/test/java/com/meilisearch/sdk/IndexRenameTest.java (2)

18-38: MockWebServer setup/teardown and Config wiring look correct.

Creating a per-test MockWebServer, trimming the trailing slash from the base URL, and shutting the server down in @AfterEach is clean and consistent; no issues here.


40-60: Rename test cleanly exercises IndexesHandler.updateIndexUid over HTTP.

The test validates:

  • Response mapping via TaskInfo.getTaskUid()
  • HTTP verb (PATCH), path (/indexes/indexA), and Authorization header
  • JSON payload including "indexUid":"indexB"

This gives good coverage of the new rename behavior in the handler.

src/test/java/com/meilisearch/sdk/SwapIndexesRenameTest.java (2)

19-39: Client + MockWebServer wiring is straightforward and consistent.

Using Config with the trimmed mock base URL and constructing a Client per test, plus proper MockWebServer lifecycle, looks good.


41-70: Swap-with-rename test validates all critical request/response aspects.

You’re asserting:

  • POST /swap-indexes
  • Authorization header
  • JSON body including "rename":true and both index names
  • TaskInfo deserialization via taskUid

This is solid coverage for the new rename=true behavior.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (4)
src/test/java/com/meilisearch/sdk/IndexRenameTest.java (2)

40-82: Consider consolidating with @ParameterizedTest.

Both test methods have identical structure and differ only in the index names and expected taskUid. Using @ParameterizedTest with @MethodSource or @CsvSource would reduce duplication and make it easier to add more test cases.

Example refactor:

@ParameterizedTest
@CsvSource({
    "indexA, indexB, 123",
    "oldIndex, newIndex, 456"
})
void testRenameIndex(String oldUid, String newUid, int expectedTaskUid) throws Exception {
    String responseJson = String.format(
        "{\"taskUid\":%d,\"indexUid\":\"%s\",\"status\":\"enqueued\",\"type\":\"indexUpdate\",\"enqueuedAt\":\"2024-01-01T00:00:00Z\"}",
        expectedTaskUid, newUid);
    mockServer.enqueue(new MockResponse()
        .setResponseCode(202)
        .setBody(responseJson)
        .addHeader("Content-Type", "application/json"));

    TaskInfo result = handler.updateIndexUid(oldUid, newUid);

    assertThat(result, is(notNullValue()));
    assertThat(result.getTaskUid(), is(equalTo(expectedTaskUid)));

    RecordedRequest request = mockServer.takeRequest();
    assertThat(request.getMethod(), equalTo("PATCH"));
    assertThat(request.getPath(), equalTo("/indexes/" + oldUid));
    assertThat(request.getHeader("Authorization"), equalTo("Bearer masterKey"));

    String requestBody = request.getBody().readUtf8();
    assertThat(requestBody, containsString("\"indexUid\":\"" + newUid + "\""));
}

40-82: Consider adding error case tests.

The tests cover happy path scenarios well but don't verify error handling. Consider adding tests for:

  • 404 response when the source index doesn't exist
  • 400 response for invalid index names
  • 409 response when the target index name already exists
  • Null or empty string handling

Example error case test:

@Test
void testRenameIndexNotFound() throws Exception {
    String errorJson = "{\"message\":\"Index `nonexistent` not found.\",\"code\":\"index_not_found\",\"type\":\"invalid_request\",\"link\":\"https://docs.meilisearch.com/errors#index_not_found\"}";
    mockServer.enqueue(new MockResponse()
        .setResponseCode(404)
        .setBody(errorJson)
        .addHeader("Content-Type", "application/json"));

    // Assert that appropriate exception is thrown
    assertThrows(MeilisearchApiException.class, () -> {
        handler.updateIndexUid("nonexistent", "newName");
    });
}
src/test/java/com/meilisearch/sdk/SwapIndexesRenameTest.java (2)

41-100: Consider consolidating with @ParameterizedTest.

The first two test methods have nearly identical structure and differ only in the rename flag value and expected taskUid. Using @ParameterizedTest would reduce duplication.

Example refactor:

@ParameterizedTest
@CsvSource({
    "true, indexA, indexB, 789",
    "false, indexC, indexD, 790"
})
void testSwapIndexesWithRenameFlag(boolean rename, String indexA, String indexB, int expectedTaskUid) throws Exception {
    String responseJson = String.format(
        "{\"taskUid\":%d,\"status\":\"enqueued\",\"type\":\"indexSwap\",\"enqueuedAt\":\"2024-01-01T00:00:00Z\"}",
        expectedTaskUid);
    mockServer.enqueue(new MockResponse()
        .setResponseCode(202)
        .setBody(responseJson)
        .addHeader("Content-Type", "application/json"));

    SwapIndexesParams[] params = {
        new SwapIndexesParams()
            .setIndexes(new String[]{indexA, indexB})
            .setRename(rename)
    };

    TaskInfo result = client.swapIndexes(params);

    assertThat(result, is(notNullValue()));
    assertThat(result.getTaskUid(), is(equalTo(expectedTaskUid)));

    RecordedRequest request = mockServer.takeRequest();
    assertThat(request.getMethod(), equalTo("POST"));
    assertThat(request.getPath(), equalTo("/swap-indexes"));

    String requestBody = request.getBody().readUtf8();
    assertThat(requestBody, containsString("\"rename\":" + rename));
    assertThat(requestBody, containsString(indexA));
    assertThat(requestBody, containsString(indexB));
}

41-137: Consider adding error and edge case tests.

The tests cover happy path scenarios effectively but don't verify error handling or edge cases. Consider adding tests for:

  • 404 response when one of the indexes doesn't exist
  • 400 response for invalid payloads (e.g., empty indexes array, single index, mismatched array lengths)
  • Empty SwapIndexesParams[] array
  • Null values in the params

Example edge case test:

@Test
void testSwapIndexesWithEmptyArray() throws Exception {
    SwapIndexesParams[] params = {};
    
    // Verify behavior - should it throw an exception or send empty array?
    // This depends on the API specification
}

@Test
void testSwapIndexesNotFound() throws Exception {
    String errorJson = "{\"message\":\"Index `nonexistent` not found.\",\"code\":\"index_not_found\",\"type\":\"invalid_request\"}";
    mockServer.enqueue(new MockResponse()
        .setResponseCode(404)
        .setBody(errorJson)
        .addHeader("Content-Type", "application/json"));

    SwapIndexesParams[] params = {
        new SwapIndexesParams()
            .setIndexes(new String[]{"nonexistent", "indexB"})
            .setRename(true)
    };

    assertThrows(MeilisearchApiException.class, () -> {
        client.swapIndexes(params);
    });
}
πŸ“œ Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 2a5ec2f and 9a991c4.

πŸ“’ Files selected for processing (2)
  • src/test/java/com/meilisearch/sdk/IndexRenameTest.java (1 hunks)
  • src/test/java/com/meilisearch/sdk/SwapIndexesRenameTest.java (1 hunks)
πŸ”‡ Additional comments (1)
src/test/java/com/meilisearch/sdk/SwapIndexesRenameTest.java (1)

102-137: Excellent test coverage for multiple index pairs.

This test effectively validates that multiple swap operations are serialized correctly as a JSON array. The array structure validation (lines 134-136) is particularly valuable, ensuring the request body is properly formatted as an array rather than individual objects.

@curquiza curquiza changed the title Feat/support meilisearch 1.18 Add features of meilisearch 1.18 (queryVector and index renaming) Nov 21, 2025
@curquiza curquiza added the enhancement New feature or request label Nov 21, 2025
Copy link
Member

@curquiza curquiza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @yamiSukehiro2907 can you remove the data.ms?

Also, can you fix the tests in the CI?

Thanks for your pR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[v1.18.0] Add queryVector to search responses and support index renaming

2 participants