Skip to content

Conversation

@tibisabau
Copy link

@tibisabau tibisabau commented Jan 27, 2026

Pull Request

Related issue

Fixes #919.

What does this PR do?

  • Adds support for the skipCreation parameter introduced in Meilisearch v1.31.0
  • Allows users to skip document creation when using addDocuments and updateDocuments methods, while still allowing updates to existing documents
  • Updates code examples to demonstrate the new parameter usage

The code in this pull request was generated by GitHub Copilot with the Claude Sonnet 4.5 model.

PR checklist

Please check if your PR fulfills the following requirements:

  • Did you use any AI tool while implementing this PR (code, tests, docs, etc.)? If yes, disclose it in the PR description and describe what it was used for. AI usage is allowed when it is disclosed.
  • Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
  • Have you read the contributing guidelines?
  • Have you made sure that the title is accurate and descriptive of the changes?

Thank you so much for contributing to Meilisearch!

Summary by CodeRabbit

  • New Features

    • Added skipCreation parameter option to control whether document operations create new documents or only update existing ones.
  • Tests

    • Added integration tests for skipCreation behavior across add and update operations.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 27, 2026

📝 Walkthrough

Walkthrough

This PR adds support for the skipCreation parameter to the Meilisearch Java SDK's document operations. New 6-parameter method overloads are introduced in Documents and Index classes to accept a skipCreation Boolean flag, which is passed through to API calls. Integration tests and code samples are updated accordingly.

Changes

Cohort / File(s) Summary
Core API Extensions
src/main/java/com/meilisearch/sdk/Documents.java, src/main/java/com/meilisearch/sdk/Index.java
Added 6-parameter overloads for addDocuments and updateDocuments methods accepting skipCreation Boolean parameter; existing 4-parameter overloads now delegate to new overloads with null skipCreation value; URL construction extended to include skipCreation parameter when provided.
Integration Tests
src/test/java/com/meilisearch/integration/DocumentsTest.java
Added four new tests: testAddDocumentsWithSkipCreationTrue/False and testUpdateDocumentsWithSkipCreationTrue/False to verify creation behavior with skipCreation flag enabled and disabled.
Code Examples
.code-samples.meilisearch.yaml
Updated add_or_replace_documents_1 and add_or_update_documents_1 sample code with trailing skipCreation parameter (false) and updated document title to "Shazam ⚡️".

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • curquiza

Poem

🐰 A hoppy hop, parameters take flight,
SkipCreation bounds through the code so bright,
Documents dance with new overloads,
Tests verify the creation roads,
Meilisearch hops to v1.31, what a delight! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding support for the skipCreation parameter in document operations.
Linked Issues check ✅ Passed All coding requirements from issue #919 are met: skipCreation parameter support added to addDocuments/updateDocuments in Documents and Index classes, test cases added, and code examples updated.
Out of Scope Changes check ✅ Passed All changes directly relate to implementing skipCreation support for document operations, with no extraneous modifications beyond the linked issue scope.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

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