Skip to content

add show performance details field to related endpoints#938

Open
valkrypton wants to merge 1 commit intomeilisearch:mainfrom
valkrypton:add/showPerformanceDetails
Open

add show performance details field to related endpoints#938
valkrypton wants to merge 1 commit intomeilisearch:mainfrom
valkrypton:add/showPerformanceDetails

Conversation

@valkrypton
Copy link

@valkrypton valkrypton commented Feb 17, 2026

Pull Request

Related issue

Fixes #933

What does this PR do?

  • Adds showPerformanceDetails to all related endpoints
  • Update response class to match the updated response
  • Updated tests to check for the performanceDetailsField

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

    • Users can opt to include performance details with search, multi-search/federation, and similar-document requests; responses will include performance metrics and execution details when enabled.
  • Tests

    • Added integration tests that validate requesting performance details and confirm returned results include the new metrics.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 17, 2026

📝 Walkthrough

Walkthrough

Adds support for requesting and returning raw performance traces: request types gain a showPerformanceDetails Boolean; result models gain a performanceDetails HashMap; integration tests updated to exercise and assert the new option.

Changes

Cohort / File(s) Summary
Request configuration
src/main/java/com/meilisearch/sdk/MultiSearchFederation.java, src/main/java/com/meilisearch/sdk/SearchRequest.java, src/main/java/com/meilisearch/sdk/SimilarDocumentRequest.java
Added showPerformanceDetails Boolean fields and a fluent setter on MultiSearchFederation; SearchRequest.toString() now serializes showPerformanceDetails.
Response models
src/main/java/com/meilisearch/sdk/model/MultiSearchResult.java, src/main/java/com/meilisearch/sdk/model/SearchResult.java, src/main/java/com/meilisearch/sdk/model/SimilarDocumentsResults.java
Added performanceDetails field (HashMap<String, Object>) to hold raw performance trace data returned by the API.
Integration tests
src/test/java/com/meilisearch/integration/SearchTest.java
Tests updated to set showPerformanceDetails(true) for search, multi-search, and similar-docs flows; added testSearchWithPerformanceDetails() and assertions checking presence/non-empty performanceDetails.

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant SDK as "SDK (Request classes)"
  participant Meili as "Meilisearch Server"
  participant Models as "Response models"

  Client->>SDK: build request with showPerformanceDetails=true
  SDK->>Meili: send search/multi-search/similar-docs request (flag included)
  Meili-->>SDK: response including performanceDetails object
  SDK->>Models: deserialize raw performanceDetails into HashMap<String,Object>
  SDK-->>Client: return result containing performanceDetails
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I hopped through lines to poke and see,

a tiny flag for traces came with glee,
raw timings tucked in maps so neat,
now results hum with performance beat,
I nibble bugs and celebrate this feat.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. 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 PR title accurately summarizes the main change: adding showPerformanceDetails field to search-related endpoints.
Linked Issues check ✅ Passed All coding requirements from issue #933 are met: showPerformanceDetails option added to search, multi-search, and similar document endpoints, performanceDetails field added to response classes as raw HashMap data, and test cases validate the functionality.
Out of Scope Changes check ✅ Passed All changes directly support the linked issue objectives; the Hamcrest import refactoring in tests is a minor housekeeping change consistent with the test updates required.

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

✨ Finishing Touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • 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

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: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/test/java/com/meilisearch/integration/SearchTest.java (1)

837-847: ⚠️ Potential issue | 🔴 Critical

Federation test may fail — showPerformanceDetails is not serialized in MultiSearchFederation.toString().

As flagged in MultiSearchFederation.java, the toString() method doesn't include showPerformanceDetails. This means line 837 sets the flag but it's never sent to the server, so getPerformanceDetails() on line 847 will likely be null, causing an NPE on .size().

Consider adding a null-safety assertion (assertThat(results.getPerformanceDetails(), is(notNullValue()))) before checking size, and ensure the serialization bug is fixed first.

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

In `@src/test/java/com/meilisearch/integration/SearchTest.java` around lines 837 -
847, The test sets federation.setShowPerformanceDetails(true) but
MultiSearchFederation.toString() currently omits the showPerformanceDetails
field so the flag never reaches the server and results.getPerformanceDetails()
can be null; update MultiSearchFederation.toString() to serialize
showPerformanceDetails (matching the other federation fields) and then make the
test null-safe by asserting results.getPerformanceDetails() is not null (e.g.,
assertThat(results.getPerformanceDetails(), is(notNullValue()))) before
asserting its size; reference the MultiSearchFederation.toString(),
MultiSearchFederation.setShowPerformanceDetails(), and
MultiSearchResult.getPerformanceDetails() symbols when applying the fixes.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/main/java/com/meilisearch/sdk/model/MultiSearchResult.java`:
- Line 26: The performanceDetails field in MultiSearchResult is typed as
HashMap<String, String> but can contain non-string values; change its
declaration to HashMap<String, Object> and update any associated
accessor/mutator (e.g., getPerformanceDetails, setPerformanceDetails,
constructors, and any JSON (de)serialization annotations or usages) to use
HashMap<String, Object> so heterogeneous values are preserved.

In `@src/main/java/com/meilisearch/sdk/model/SearchResult.java`:
- Line 27: Update the performanceDetails field from HashMap<String, String> to
HashMap<String, Object> to allow non-string values during deserialization:
locate the performanceDetails declaration in the SearchResult class (field name
performanceDetails), and make the same change in MultiSearchResult
(performanceDetails) and SimilarDocumentsResults (performanceDetails); ensure
any getters/setters or usages (e.g., getPerformanceDetails(),
setPerformanceDetails(...)) and relevant imports are updated to use
HashMap<String, Object> (or Map<String, Object>) so deserialization won't fail
if the API returns numbers or nested objects.

In `@src/main/java/com/meilisearch/sdk/model/SimilarDocumentsResults.java`:
- Line 23: In SimilarDocumentsResults change the field declaration
performanceDetails from HashMap<String, String> to HashMap<String, Object> and
update any associated accessor/mutator methods, constructors, builders, and
(de)serialization logic that reference performanceDetails to use HashMap<String,
Object> instead; mirror the same adjustments done in SearchResult.java to ensure
type consistency across the models.

In `@src/test/java/com/meilisearch/integration/SearchTest.java`:
- Around line 1319-1325: In SearchTest, the assertion on searchResult hits uses
hasSize(11) but should expect the default page size of 20; update the assertion
for searchResult.getHits() from hasSize(11) to hasSize(20) so that
SearchRequest.builder().q("a").showPerformanceDetails(true).build() correctly
validates 20 returned hits; keep the other assertions (getEstimatedTotalHits and
getPerformanceDetails) unchanged.

---

Outside diff comments:
In `@src/test/java/com/meilisearch/integration/SearchTest.java`:
- Around line 837-847: The test sets federation.setShowPerformanceDetails(true)
but MultiSearchFederation.toString() currently omits the showPerformanceDetails
field so the flag never reaches the server and results.getPerformanceDetails()
can be null; update MultiSearchFederation.toString() to serialize
showPerformanceDetails (matching the other federation fields) and then make the
test null-safe by asserting results.getPerformanceDetails() is not null (e.g.,
assertThat(results.getPerformanceDetails(), is(notNullValue()))) before
asserting its size; reference the MultiSearchFederation.toString(),
MultiSearchFederation.setShowPerformanceDetails(), and
MultiSearchResult.getPerformanceDetails() symbols when applying the fixes.

int limit;
int estimatedTotalHits;
HashMap<String, FacetsByIndexInfo> facetsByIndex;
HashMap<String, String> performanceDetails;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Same issue: use HashMap<String, Object> for performanceDetails.

See the comment on SearchResult.java — this field likely contains non-string values.

Proposed fix
-    HashMap<String, String> performanceDetails;
+    HashMap<String, Object> performanceDetails;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
HashMap<String, String> performanceDetails;
HashMap<String, Object> performanceDetails;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/java/com/meilisearch/sdk/model/MultiSearchResult.java` at line 26,
The performanceDetails field in MultiSearchResult is typed as HashMap<String,
String> but can contain non-string values; change its declaration to
HashMap<String, Object> and update any associated accessor/mutator (e.g.,
getPerformanceDetails, setPerformanceDetails, constructors, and any JSON
(de)serialization annotations or usages) to use HashMap<String, Object> so
heterogeneous values are preserved.

int limit;
int estimatedTotalHits;
HashMap<String, Object> _vectors;
HashMap<String, String> performanceDetails;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

Meilisearch performanceDetails response format API documentation

💡 Result:

Meilisearch exposes performanceDetails in search-like responses when you enable the request flag showPerformanceDetails: true (added in Meilisearch v1.35.0). The field format is:

  • performanceDetails: object / map of "<span>" -> "<human_duration>" (string durations), e.g.:
    {
      "performanceDetails": {
        "<span>": "<human_duration>"
      }
    }
    The same map appears per-result in multi-search as results[].performanceDetails. [1]

Type-wise, client SDKs model it as a map (e.g., map[string]any in the Go SDK) keyed by span name. [2]

Sources: [1] [2]


🏁 Script executed:

# Find and examine the SearchResult.java file and related model files
fd SearchResult.java
fd MultiSearchResult.java
fd SimilarDocumentsResults.java

Repository: meilisearch/meilisearch-java

Length of output: 387


🏁 Script executed:

# Examine SearchResult.java around line 27
cat -n src/main/java/com/meilisearch/sdk/model/SearchResult.java | head -50

Repository: meilisearch/meilisearch-java

Length of output: 1052


🏁 Script executed:

# Examine MultiSearchResult.java for performanceDetails
cat -n src/main/java/com/meilisearch/sdk/model/MultiSearchResult.java | head -70

Repository: meilisearch/meilisearch-java

Length of output: 1013


🏁 Script executed:

# Examine SimilarDocumentsResults.java for performanceDetails
cat -n src/main/java/com/meilisearch/sdk/model/SimilarDocumentsResults.java | head -70

Repository: meilisearch/meilisearch-java

Length of output: 813


🏁 Script executed:

# Check for any Jackson annotations or custom deserializers
rg -A 5 "performanceDetails" src/main/java/com/meilisearch/sdk/model/

Repository: meilisearch/meilisearch-java

Length of output: 914


🏁 Script executed:

# Check the deserialization configuration, likely in MeilisearchClient or similar
fd -e java | xargs rg -l "ObjectMapper|JsonDeserialize" | head -10

Repository: meilisearch/meilisearch-java

Length of output: 436


🏁 Script executed:

# Check the Jackson configuration
cat -n src/main/java/com/meilisearch/sdk/json/JacksonJsonHandler.java

Repository: meilisearch/meilisearch-java

Length of output: 3989


🏁 Script executed:

# Check if there are any tests that show the performanceDetails usage
rg -B 5 -A 5 "performanceDetails" src/test/

Repository: meilisearch/meilisearch-java

Length of output: 54


🏁 Script executed:

# Check the issue `#933` if referenced in code or docs
rg -i "issue.*933\|#933" --include="*.md" --include="*.java"

Repository: meilisearch/meilisearch-java

Length of output: 513


🏁 Script executed:

# Search for any tests or usage of performanceDetails
fd -e java | xargs rg "performanceDetails"

Repository: meilisearch/meilisearch-java

Length of output: 405


🏁 Script executed:

# Check if there's any documentation about performanceDetails or future compatibility concerns
rg "showPerformanceDetails\|performanceDetails" --type md

Repository: meilisearch/meilisearch-java

Length of output: 54


🏁 Script executed:

# Check what other SDKs do - look at git history or comments mentioning other SDKs
rg -i "go\|node\|rust\|python" src/main/java/com/meilisearch/sdk/model/ -B 2 -A 2

Repository: meilisearch/meilisearch-java

Length of output: 54


🏁 Script executed:

# Check if there are any other fields that model "raw data" or extensible objects
rg "HashMap<String, Object>" src/main/java/com/meilisearch/sdk/model/ -B 1 -A 1

Repository: meilisearch/meilisearch-java

Length of output: 2459


🏁 Script executed:

# Look for any issue tracker references or comments about forward compatibility
rg "future\|forward\|evolve\|extend\|raw" src/main/java/com/meilisearch/sdk/model/SearchResult.java -B 2 -A 2

Repository: meilisearch/meilisearch-java

Length of output: 54


Change performanceDetails from HashMap<String, String> to HashMap<String, Object> for forward compatibility.

While Meilisearch 1.35+ currently returns performanceDetails as string-to-string mappings (e.g., {"<span>": "<human_duration>"), the field is documented as extensible and may evolve to include numeric values or nested objects in future versions. Using HashMap<String, String> would cause deserialization failures if the API changes. The Go SDK uses map[string]any for this reason. This pattern also aligns with other flexible fields in these models (e.g., _vectors, facetDistribution).

Fix applies to:

  • SearchResult.java (line 27)
  • MultiSearchResult.java (line 26)
  • SimilarDocumentsResults.java (line 23)
Proposed fix
-    HashMap<String, String> performanceDetails;
+    HashMap<String, Object> performanceDetails;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
HashMap<String, String> performanceDetails;
HashMap<String, Object> performanceDetails;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/java/com/meilisearch/sdk/model/SearchResult.java` at line 27, Update
the performanceDetails field from HashMap<String, String> to HashMap<String,
Object> to allow non-string values during deserialization: locate the
performanceDetails declaration in the SearchResult class (field name
performanceDetails), and make the same change in MultiSearchResult
(performanceDetails) and SimilarDocumentsResults (performanceDetails); ensure
any getters/setters or usages (e.g., getPerformanceDetails(),
setPerformanceDetails(...)) and relevant imports are updated to use
HashMap<String, Object> (or Map<String, Object>) so deserialization won't fail
if the API returns numbers or nested objects.

int offset;
int limit;
int estimatedTotalHits;
HashMap<String, String> performanceDetails;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Same issue: use HashMap<String, Object> for performanceDetails.

See the comment on SearchResult.java.

Proposed fix
-    HashMap<String, String> performanceDetails;
+    HashMap<String, Object> performanceDetails;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
HashMap<String, String> performanceDetails;
HashMap<String, Object> performanceDetails;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/java/com/meilisearch/sdk/model/SimilarDocumentsResults.java` at line
23, In SimilarDocumentsResults change the field declaration performanceDetails
from HashMap<String, String> to HashMap<String, Object> and update any
associated accessor/mutator methods, constructors, builders, and
(de)serialization logic that reference performanceDetails to use HashMap<String,
Object> instead; mirror the same adjustments done in SearchResult.java to ensure
type consistency across the models.

Comment on lines 1319 to 1325
SearchRequest searchRequest =
SearchRequest.builder().q("a").showPerformanceDetails(true).build();
SearchResult searchResult = (SearchResult) index.search(searchRequest);

assertThat(searchResult.getHits(), hasSize(11));
assertThat(searchResult.getEstimatedTotalHits(), is(equalTo(31)));
assertThat(searchResult.getPerformanceDetails().size(), greaterThan(0));
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# First, find and examine SearchRequest class to understand default limit
fd -t f -n "SearchRequest" --extension java | head -5

Repository: meilisearch/meilisearch-java

Length of output: 302


🏁 Script executed:

# Look at the test file to understand the patterns
rg -n "testSearchOffset|testBasicSearch|offset.*20|hasSize" src/test/java/com/meilisearch/integration/SearchTest.java | head -30

Repository: meilisearch/meilisearch-java

Length of output: 1362


🏁 Script executed:

# Find where SearchRequest is defined and check its defaults
fd -t f "SearchRequest.java" | grep -v test

Repository: meilisearch/meilisearch-java

Length of output: 298


🏁 Script executed:

# Examine SearchRequest.java for default limit
cat src/main/java/com/meilisearch/sdk/SearchRequest.java | head -100

Repository: meilisearch/meilisearch-java

Length of output: 3612


🏁 Script executed:

# View the test context around line 1323
sed -n '1300,1330p' src/test/java/com/meilisearch/integration/SearchTest.java

Repository: meilisearch/meilisearch-java

Length of output: 1265


🏁 Script executed:

# View the test context around line 305 to understand the pattern
sed -n '295,315p' src/test/java/com/meilisearch/integration/SearchTest.java

Repository: meilisearch/meilisearch-java

Length of output: 949


🏁 Script executed:

# Check if there's any special handling in search when showPerformanceDetails is set
rg -n "showPerformanceDetails" src/main/java/com/meilisearch/sdk/ -A 3 -B 3

Repository: meilisearch/meilisearch-java

Length of output: 4591


🏁 Script executed:

# Look at the index.search method to see if it modifies the request
fd -t f "Index.java" | grep -v test | xargs cat | grep -A 20 "public.*search.*SearchRequest"

Repository: meilisearch/meilisearch-java

Length of output: 1015


🏁 Script executed:

# Check if there's any test setup that might affect this specific test
sed -n '1300,1328p' src/test/java/com/meilisearch/integration/SearchTest.java

Repository: meilisearch/meilisearch-java

Length of output: 1265


Test assertion on line 1323 is incorrect — expected hit count should be 20, not 11.

With query "a", no explicit limit (default is 20 per SearchRequest javadoc), and no offset, the search should return 20 hits. The hasSize(11) appears to be a copy-paste error from testSearchOffset (line 79), where offset(20) with 31 total hits produces 31 − 20 = 11 remaining results. Compare with testSearchWithFrequencyMatchingStrategy (line 305), where query "and" correctly returns hasSize(20) with the same default limit applied.

Proposed fix
-        assertThat(searchResult.getHits(), hasSize(11));
+        assertThat(searchResult.getHits(), hasSize(20));
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/test/java/com/meilisearch/integration/SearchTest.java` around lines 1319
- 1325, In SearchTest, the assertion on searchResult hits uses hasSize(11) but
should expect the default page size of 20; update the assertion for
searchResult.getHits() from hasSize(11) to hasSize(20) so that
SearchRequest.builder().q("a").showPerformanceDetails(true).build() correctly
validates 20 returned hits; keep the other assertions (getEstimatedTotalHits and
getPerformanceDetails) unchanged.

@valkrypton valkrypton force-pushed the add/showPerformanceDetails branch from 4199f96 to d323fc5 Compare February 18, 2026 07:45
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: 1

🧹 Nitpick comments (1)
src/main/java/com/meilisearch/sdk/SearchRequest.java (1)

51-57: Minor: Javadoc constructor comment omits showPerformanceDetails.

The constructor doc lists defaults for all serialized fields but showPerformanceDetails is missing.

📝 Suggested Javadoc update
  * Constructor for SearchRequest for building search queries with the default values: offset: 0,
  * limit: 20, attributesToRetrieve: ["*"], attributesToCrop: null, cropLength: 200,
  * attributesToHighlight: null, filter: null, showMatchesPosition: false, facets: null, sort:
- * null, showRankingScore: false, showRankingScoreDetails: false, rankingScoreThreshold: null,
- * retrieveVectors: false
+ * null, showRankingScore: false, showRankingScoreDetails: false, rankingScoreThreshold: null,
+ * retrieveVectors: false, showPerformanceDetails: false
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/java/com/meilisearch/sdk/SearchRequest.java` around lines 51 - 57,
The Javadoc for the SearchRequest constructor omits the default for the
showPerformanceDetails field; update the constructor comment in
SearchRequest.java to include showPerformanceDetails (with its default value)
alongside the other serialized field defaults so the documentation accurately
reflects all fields initialized by the constructor—locate the constructor
comment for SearchRequest and add the showPerformanceDetails default to the
list.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/test/java/com/meilisearch/integration/SearchTest.java`:
- Line 847: Replace the direct size() assertions on the possibly-null map with a
Hamcrest map matcher that handles nulls: change usages of
assertThat(results.getPerformanceDetails().size(), greaterThan(0)) to
assertThat(results.getPerformanceDetails(), aMapWithSize(greaterThan(0))) in
SearchTest (references to getPerformanceDetails), and apply the same replacement
at the other two locations flagged (the occurrences around lines 1114 and 1325).

---

Duplicate comments:
In `@src/main/java/com/meilisearch/sdk/model/MultiSearchResult.java`:
- Line 26: No change needed: the field declaration performanceDetails of type
HashMap<String, Object> in class MultiSearchResult is correct and matches the
fix applied in SearchResult.java; leave the declaration "HashMap<String, Object>
performanceDetails" as-is and no further modifications are required.

In `@src/test/java/com/meilisearch/integration/SearchTest.java`:
- Line 1323: The assertion expecting 11 hits is a copy-paste error; update the
test that asserts on searchResult.getHits() to expect 20 hits instead of 11 (the
test invokes q("a") with default offset and default limit 20, so
searchResult.getHits() should have size 20). Locate the failing assertion in
SearchTest.java referencing searchResult.getHits() (the hasSize(11) call) and
change it to hasSize(20).

---

Nitpick comments:
In `@src/main/java/com/meilisearch/sdk/SearchRequest.java`:
- Around line 51-57: The Javadoc for the SearchRequest constructor omits the
default for the showPerformanceDetails field; update the constructor comment in
SearchRequest.java to include showPerformanceDetails (with its default value)
alongside the other serialized field defaults so the documentation accurately
reflects all fields initialized by the constructor—locate the constructor
comment for SearchRequest and add the showPerformanceDetails default to the
list.

@valkrypton valkrypton force-pushed the add/showPerformanceDetails branch from d323fc5 to 9a70d02 Compare February 18, 2026 08:11
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.

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

Duplicate comments:
In `@src/test/java/com/meilisearch/integration/SearchTest.java`:
- Around line 1319-1325: The assertion for hit count is wrong: update the test
in SearchTest where SearchRequest searchRequest =
SearchRequest.builder().q("a").showPerformanceDetails(true).build() and
SearchResult searchResult = (SearchResult) index.search(searchRequest) to expect
20 hits (change the hasSize matcher from 11 to 20); verify getHits() is asserted
with hasSize(20) to reflect the default limit of 20 when no offset/limit is
provided.

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 1.35] Add showPerformanceDetails option to search endpoints

1 participant

Comments