Skip to content

docs: improve documentation#954

Open
dahlinomine wants to merge 1 commit intomeilisearch:mainfrom
dahlinomine:docs/improve-readme-1774601859
Open

docs: improve documentation#954
dahlinomine wants to merge 1 commit intomeilisearch:mainfrom
dahlinomine:docs/improve-readme-1774601859

Conversation

@dahlinomine
Copy link
Copy Markdown

@dahlinomine dahlinomine commented Mar 27, 2026

Summary

This PR improves the README documentation for this project.

Changes: Improve documentation


This contribution was made as part of an open-source documentation improvement initiative. All changes are meant to be helpful additions to the project.

Summary by CodeRabbit

  • Documentation
    • Streamlined the Getting Started guide with a straightforward Client initialization example.
    • Removed sections covering Customization, advanced configuration, and reference documentation.
    • Updated code block formatting and improved overall documentation clarity.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 27, 2026

📝 Walkthrough

Walkthrough

The README.md has been substantially simplified, reducing documentation from 236 to 6 lines. Changes include updating the Gradle syntax highlighting, removing the okhttp peer-dependency warning, condensing the getting started section into a single initialization example, and removing customization, learning resources, and detailed contribution guidance sections.

Changes

Cohort / File(s) Summary
Documentation Simplification
README.md
Updated Gradle code block language from groovy to gradle, removed okhttp peer-dependency warning, replaced extensive "Getting started" section with single Client initialization example, removed "Customization" section (JSON handlers), removed "Learn more" section (external guides), simplified "Contributing" section, and removed trailing newline marker.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 Hop, hop, hooray! The docs now shine so bright,
Simplified and lean, easier to recite,
From verbose guides to steps that gleam,
A cleaner README—our streamlined dream!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'docs: improve documentation' is vague and generic, using non-descriptive terms that don't convey specific information about what was actually improved in the README. Consider a more specific title that describes the actual changes, such as 'docs: simplify README with basic client initialization example' or 'docs: streamline README by removing advanced customization sections'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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
Copy Markdown
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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@README.md`:
- Around line 75-82: The PR removed essential "Getting started" content from
README (leaving only the Client initialization example), breaking onboarding;
restore the removed sections or explicitly link to their new locations: re-add
examples for adding documents and performing searches (including filters, custom
queries, and pagination), the "Customization" section describing JSON handler
configuration, the "Learn more" guide links, and the detailed contribution
guidelines, or if moved to other files/dirs, update the README's Getting started
section to point to those exact docs; use the existing client initialization
snippet (Client/Config) as the lead-in and ensure the README clearly shows how
to go from instantiating the client to indexing and searching so new users can
follow end-to-end.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5c9c4750-7d9b-4cbc-889d-c93684d8056a

📥 Commits

Reviewing files that changed from the base of the PR and between 53ddbf9 and ba69c1e.

📒 Files selected for processing (1)
  • README.md

Comment on lines +75 to 82
To get started, you first need to initialize the Meilisearch client.

```java
package com.meilisearch.sdk;

import org.json.JSONArray;
import org.json.JSONObject;

import java.util.ArrayList;
import com.meilisearch.sdk.Client;
import com.meilisearch.sdk.Config;

class TestMeilisearch {
public static void main(String[] args) throws Exception {

JSONArray array = new JSONArray();
ArrayList items = new ArrayList() {{
add(new JSONObject().put("id", "1").put("title", "Carol").put("genres",new JSONArray("[\"Romance\",\"Drama\"]")));
add(new JSONObject().put("id", "2").put("title", "Wonder Woman").put("genres",new JSONArray("[\"Action\",\"Adventure\"]")));
add(new JSONObject().put("id", "3").put("title", "Life of Pi").put("genres",new JSONArray("[\"Adventure\",\"Drama\"]")));
add(new JSONObject().put("id", "4").put("title", "Mad Max: Fury Road").put("genres",new JSONArray("[\"Adventure\",\"Science Fiction\"]")));
add(new JSONObject().put("id", "5").put("title", "Moana").put("genres",new JSONArray("[\"Fantasy\",\"Action\"]")));
add(new JSONObject().put("id", "6").put("title", "Philadelphia").put("genres",new JSONArray("[\"Drama\"]")));
}};

array.put(items);
String documents = array.getJSONArray(0).toString();
Client client = new Client(new Config("http://localhost:7700", "masterKey"));

// An index is where the documents are stored.
Index index = client.index("movies");

// If the index 'movies' does not exist, Meilisearch creates it when you first add the documents.
index.addDocuments(documents); // => { "taskUid": 0 }
}
}
```

With the `taskUid`, you can check the status (`enqueued`, `canceled`, `processing`, `succeeded` or `failed`) of your documents addition using the [task endpoint](https://www.meilisearch.com/docs/reference/api/tasks).

#### Basic Search <!-- omit in toc -->

A basic search can be performed by calling `index.search()` method, with a simple string query.

```java
import com.meilisearch.sdk.model.SearchResult;

// Meilisearch is typo-tolerant:
SearchResult results = index.search("carlo");
System.out.println(results);
```

- Output:

```
SearchResult(hits=[{id=1.0, title=Carol, genres:[Romance, Drama]}], offset=0, limit=20, estimatedTotalHits=1, facetDistribution=null, processingTimeMs=3, query=carlo)
```

#### Custom Search <!-- omit in toc -->

If you want a custom search, the easiest way is to create a `SearchRequest` object, and set the parameters that you need.<br>
All the supported options are described in the [search parameters](https://www.meilisearch.com/docs/reference/api/search#search-parameters) section of the documentation.

```java
import com.meilisearch.sdk.SearchRequest;

// ...

SearchResult results = (SearchResult) index.search(
new SearchRequest("of")
.setShowMatchesPosition(true)
.setAttributesToHighlight(new String[]{"title"})
);
System.out.println(results.getHits());
```

- Output:

```json
[{
"id":3,
"title":"Life of Pi",
"genres":["Adventure","Drama"],
"_formatted":{
"id":3,
"title":"Life <em>of</em> Pi",
"genres":["Adventure","Drama"]
},
"_matchesPosition":{
"title":[{
"start":5.0,
"length":2.0
}]
}
}]
```
#### Custom Search With Filters <!-- omit in toc -->

If you want to enable filtering, you must add your attributes to the `filterableAttributes` index setting.

```java
index.updateFilterableAttributesSettings(new String[]
{
"id",
"genres"
});
```

You only need to perform this operation once.

Note that Meilisearch will rebuild your index whenever you update `filterableAttributes`. Depending on the size of your dataset, this might take time. You can track the process using the [task status](https://www.meilisearch.com/docs/reference/api/tasks).

Then, you can perform the search:

```java
index.search(
new SearchRequest("wonder")
.setFilter(new String[] {"id > 1 AND genres = Action"})
);
Client client = new Client(new Config("http://localhost:7700", "masterKey"));
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Critical documentation removal contradicts PR objective.

This PR claims to "improve documentation" but actually removes essential content that enables developers to use the library. The "Getting started" section has been reduced to only client initialization, removing:

  • How to add documents (core functionality)
  • How to perform searches (primary use case)
  • Search examples with filters, custom queries, and pagination
  • The entire "Customization" section (JSON handler configuration)
  • The "Learn more" section with links to guides
  • Detailed contribution guidelines

This massive reduction (236 to 6 lines per the summary) severely degrades the developer experience for new users who need working examples to get started. The README should help users quickly understand how to use the library, not just how to instantiate a client.

Please clarify the reasoning for removing this critical documentation. If the intent is to move content elsewhere, that should be clearly communicated with appropriate links.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` around lines 75 - 82, The PR removed essential "Getting started"
content from README (leaving only the Client initialization example), breaking
onboarding; restore the removed sections or explicitly link to their new
locations: re-add examples for adding documents and performing searches
(including filters, custom queries, and pagination), the "Customization" section
describing JSON handler configuration, the "Learn more" guide links, and the
detailed contribution guidelines, or if moved to other files/dirs, update the
README's Getting started section to point to those exact docs; use the existing
client initialization snippet (Client/Config) as the lead-in and ensure the
README clearly shows how to go from instantiating the client to indexing and
searching so new users can follow end-to-end.

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.

1 participant