Skip to content

Add skipCreation to document updates - #993

Open
Ishubhammohole wants to merge 1 commit into
meilisearch:mainfrom
Ishubhammohole:feature-919-skip-creation
Open

Add skipCreation to document updates#993
Ishubhammohole wants to merge 1 commit into
meilisearch:mainfrom
Ishubhammohole:feature-919-skip-creation

Conversation

@Ishubhammohole

@Ishubhammohole Ishubhammohole commented Sep 14, 2026

Copy link
Copy Markdown

Summary

  • Added backward-compatible skipCreation overloads for add/replace and add/update document calls
  • Forwarded the boolean as the skipCreation query parameter while preserving existing request URLs
  • Added request-level regression tests and updated the documentation code samples

Testing

  • ./gradlew test --tests com.meilisearch.sdk.DocumentsSkipCreationTest -x jacocoTestCoverageVerification — passed (3 tests)
  • ./gradlew spotlessCheck — passed
  • bash ./scripts/lint.sh — passed
  • docker compose run --rm -v gradle-cache:/root/.gradle package ./gradlew test — 115/116 passed; SettingsHandlerTest dictionary reset timed out
  • docker compose run --rm -v gradle-cache:/root/.gradle package ./gradlew test --tests com.meilisearch.sdk.SettingsHandlerTest -x jacocoTestCoverageVerification — passed on immediate rerun (3 tests), confirming the timeout was transient

AI-assisted development was used to inspect the existing overload and URL-building patterns, implement the scoped change, and draft focused tests. The final diff and test results were reviewed before submission.

Fixes #919

Summary by CodeRabbit

  • New Features

    • Added an option to skip document creation when adding or updating documents.
    • The option is available for both index-level operations and requests with advanced formatting and metadata settings.
    • When enabled, requests include the corresponding server-side setting; existing methods continue to work without it.
  • Documentation

    • Updated code samples to demonstrate using the new option with document add and update operations.

@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 9bef3f3b-f9c5-45fe-b1b8-f04520b8e471

📥 Commits

Reviewing files that changed from the base of the PR and between 740d3f6 and 0d82598.

📒 Files selected for processing (4)
  • .code-samples.meilisearch.yaml
  • src/main/java/com/meilisearch/sdk/Documents.java
  • src/main/java/com/meilisearch/sdk/Index.java
  • src/test/java/com/meilisearch/sdk/DocumentsSkipCreationTest.java

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

The SDK adds skipCreation overloads for document add and update operations. Index forwards the flag to request builders. Tests verify query parameters and legacy behavior. The document examples now pass the flag.

Changes

skipCreation document operations

Layer / File(s) Summary
Document request overloads
src/main/java/com/meilisearch/sdk/Documents.java
Documents adds skipCreation overloads for add and update requests. Shared helpers build the POST and PUT requests.
Index API wiring
src/main/java/com/meilisearch/sdk/Index.java
Index adds short and full overloads for addDocuments and updateDocuments, then forwards skipCreation to Documents.
Request validation and examples
src/test/java/com/meilisearch/sdk/DocumentsSkipCreationTest.java, .code-samples.meilisearch.yaml
MockWebServer tests verify skipCreation=true, skipCreation=false with existing parameters, and omission for legacy calls. The examples pass true to both operations.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to 0d825

The new document-operation overloads preserve existing request URLs while sending skipCreation when requested. No actionable merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 63.16% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 19 functions across 3 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the addition of the skipCreation option to document operations. It is concise, but it does not explicitly mention document replacement operations.
Linked Issues check ✅ Passed The PR satisfies the coding requirements in issue #919. Index and Documents now provide skipCreation overloads for add/replace and add/update document operations. The request helpers forward `sk…
Out of Scope Changes check ✅ Passed The changes stay within issue #919. The implementation, request-level regression tests, and updates to add_or_replace_documents_1 and add_or_update_documents_1 directly support the requested SDK p…
Full details: Docstring Coverage

Explanation

Docstring coverage is 63.16% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 19 functions across 3 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Meilisearch v1.31] Allow skipCreation when adding/replacing documents

1 participant