Skip to content

Conversation

@ElyarSadig
Copy link
Collaborator

@ElyarSadig ElyarSadig commented Aug 30, 2025

Pull Request

Related issue

Fixes #697

What does this PR do?

  • Update AddDocuments examples.

PR checklist

Please check if your PR fulfills the following requirements:

  • 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

    • Adding documents now supports an optional options parameter for greater control.
  • Documentation

    • Updated README Table of Contents (title casing, indentation, and improved anchors).
    • Clarified installation heading with version requirement (>= 1.20).
    • Renamed “Benchmark performance” to “Benchmark Performance.”
    • Updated code examples to include the new optional parameter when adding documents.

@coderabbitai
Copy link

coderabbitai bot commented Aug 30, 2025

Walkthrough

Updates README Table of Contents and headings; fixes README code sample to call AddDocuments with a second argument. Updates doc.go example to pass a second argument to AddDocuments. Notes a change to the exported AddDocuments method signature to include an options parameter.

Changes

Cohort / File(s) Summary
Documentation TOC and formatting
README.md
Updated TOC links, capitalization, and indentation; renamed several entries; adjusted “Benchmark Performance” anchor; added/adjusted a top-level TOC link.
AddDocuments usage and signature
README.md, doc.go
Example calls changed from AddDocuments(documents) to AddDocuments(documents, nil); documented exported method signature now includes an options parameter: AddDocuments(documents []map[string]interface{}, options *AddDocumentsOptions).

Sequence Diagram(s)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Assessment against linked issues

Objective Addressed Explanation
Fix incorrect AddDocuments usage in README sample (#697)

Assessment against linked issues: Out-of-scope changes

Poem

I twitch my ears at docs made bright,
Two args now hop into the light.
TOC trails neatly, paws in line—
Benchmarks bounded, titles fine.
With nil in paw, I press “commit,”
Thump-thump! The samples finally fit.

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@ElyarSadig ElyarSadig requested a review from ja7ad August 30, 2025 19:05
@codecov
Copy link

codecov bot commented Aug 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.80%. Comparing base (27f41cc) to head (3223b8a).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #706   +/-   ##
=======================================
  Coverage   85.80%   85.80%           
=======================================
  Files          22       22           
  Lines        3614     3614           
=======================================
  Hits         3101     3101           
  Misses        366      366           
  Partials      147      147           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

@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)
doc.go (1)

23-23: Clarify what the nil stands for.
A short note will prevent confusion about when to replace nil with a real value.

Apply this diff to the example block:

-//  task, err := idx.AddDocuments(documents, nil)
+//  // Pass nil to use defaults. Replace nil with the appropriate second argument for your version (e.g., primary key or options).
+//  task, err := idx.AddDocuments(documents, nil)
README.md (3)

97-105: Add a one-line hint about the second parameter.
Readers won’t know when to keep nil vs. provide a value.

Apply this diff inside the code sample:

-    task, err := index.AddDocuments(documents, nil)
+    // Pass nil to use defaults. Replace nil with the appropriate second argument for your version (e.g., primary key or options).
+    task, err := index.AddDocuments(documents, nil)

37-42: Fix TOC nested list indentation (markdownlint MD007).
Use 2-space indents for sub-items.

Apply this diff:

-    - [Add documents](#add-documents)
-    - [Basic Search](#basic-search)
-    - [Custom Search](#custom-search)
-    - [Custom Search With Filters](#custom-search-with-filters)
-    - [Customize Client](#customize-client)
-    - [Make SDK Faster](#make-sdk-faster)
+  - [Add documents](#add-documents)
+  - [Basic Search](#basic-search)
+  - [Custom Search](#custom-search)
+  - [Custom Search With Filters](#custom-search-with-filters)
+  - [Customize Client](#customize-client)
+  - [Make SDK Faster](#make-sdk-faster)

33-33: Remove the self-linking TOC entry.
Redundant and a minor distraction.

Apply this diff:

-- [Table of Contents](#table-of-contents)
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 27f41cc and 3223b8a.

📒 Files selected for processing (2)
  • README.md (2 hunks)
  • doc.go (1 hunks)
🧰 Additional context used
🪛 LanguageTool
README.md

[grammar] ~33-~33: There might be a mistake here.
Context: ... Table of Contents - Table of Contents - 📖 Documentation - [🔧...

(QB_NEW_EN)


[grammar] ~34-~34: There might be a mistake here.
Context: ...(#table-of-contents) - 📖 Documentation - [🔧 Installation (>= 1.20)](#-installati...

(QB_NEW_EN)


[grammar] ~35-~35: There might be a mistake here.
Context: ...mentation) - 🔧 Installation (>= 1.20) - 🚀 Getting started ...

(QB_NEW_EN)


[grammar] ~36-~36: There might be a mistake here.
Context: ...20)](#-installation--120) - 🚀 Getting started - Add documents - [Ba...

(QB_NEW_EN)


[grammar] ~37-~37: There might be a mistake here.
Context: ... started](#-getting-started) - Add documents - Basic Search - [Cust...

(QB_NEW_EN)


[grammar] ~38-~38: There might be a mistake here.
Context: ...nts](#add-documents) - Basic Search - Custom Search - [Cu...

(QB_NEW_EN)


[grammar] ~39-~39: There might be a mistake here.
Context: ...rch](#basic-search) - Custom Search - [Custom Search With Filters](#custom-sear...

(QB_NEW_EN)


[grammar] ~40-~40: There might be a mistake here.
Context: ...earch) - Custom Search With Filters - Customize Client ...

(QB_NEW_EN)


[grammar] ~41-~41: There might be a mistake here.
Context: ...ch-with-filters) - Customize Client - Make SDK Faster - [🤖...

(QB_NEW_EN)


[grammar] ~42-~42: There might be a mistake here.
Context: ...customize-client) - Make SDK Faster - [🤖 Compatibility with Meilisearch](#-com...

(QB_NEW_EN)


[grammar] ~43-~43: There might be a mistake here.
Context: ...er) - 🤖 Compatibility with Meilisearch - [⚡️ Benchmark Performance](#️-benchmark-p...

(QB_NEW_EN)


[grammar] ~44-~44: There might be a mistake here.
Context: ...meilisearch) - ⚡️ Benchmark Performance - 💡 Learn more - [⚙️ Contr...

(QB_NEW_EN)

🪛 markdownlint-cli2 (0.17.2)
README.md

37-37: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


38-38: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


39-39: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


40-40: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


41-41: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


42-42: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


97-97: Hard tabs
Column: 1

(MD010, no-hard-tabs)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: integration-tests (go current version)
  • GitHub Check: integration-tests (go latest version)
🔇 Additional comments (4)
doc.go (1)

23-23: LGTM: example now compiles with the current signature.
The explicit nil fixes the README/guide mismatch reported in the linked issue.

README.md (3)

97-105: LGTM: passing a second argument removes the compile error.
This aligns the sample with the actual method signature.


35-35: Verify anchor slugs for emoji headings.
GitHub’s slug generation around emoji and special chars can be finicky—please preview that these links resolve.

If any link is broken, adjust the fragment to match the rendered slug in GitHub’s preview for:

  • Installation (>= 1.20)
  • ⚡️ Benchmark Performance

Also applies to: 44-44


97-105: All AddDocuments calls use the updated two-argument signature; no one-arg instances found.

@ja7ad ja7ad added the documentation Improvements or additions to documentation label Aug 30, 2025
@ja7ad ja7ad added this pull request to the merge queue Aug 30, 2025
Merged via the queue into meilisearch:main with commit fa5ea28 Aug 30, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong using of AddDocuments in the **README.md**

2 participants