Skip to content

Comments

Add showPerformanceDetails option to search endpoints#707

Draft
Dejmenek wants to merge 5 commits intomeilisearch:mainfrom
Dejmenek:addShowPerformanceDetails
Draft

Add showPerformanceDetails option to search endpoints#707
Dejmenek wants to merge 5 commits intomeilisearch:mainfrom
Dejmenek:addShowPerformanceDetails

Conversation

@Dejmenek
Copy link

@Dejmenek Dejmenek commented Feb 3, 2026

Pull Request

Related issue

Fixes #706

What does this PR do?

This PR adds a new showPerformanceDetails option to search endpoints (search, multi-search and similar documents). I've written needed tests to make sure everything works smoothly.

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?

Summary by CodeRabbit

Release Notes

  • New Features

    • Added ability to retrieve performance details in search results. A new flag in search queries allows users to opt-in for performance metrics data alongside results across all search types.
  • Tests

    • Added comprehensive test coverage verifying performance details functionality across basic, paginated, and similar document search scenarios.

Added tests to SearchTests.cs to verify correct handling of the PerformanceDetails property in search results. Tests cover basic, paginated, and similar document searches, both with and without the ShowPerformanceDetails flag. Ensures Meilisearch client returns performance details only when requested.
Added two tests to MultiIndexSearchTests.cs to verify the behavior of the PerformanceDetails property in multi-index search results. One test checks that PerformanceDetails is populated when ShowPerformanceDetails is true, and another ensures it is null when the flag is not set. This ensures correct handling of the PerformanceDetails feature in search queries.
@Dejmenek Dejmenek marked this pull request as draft February 3, 2026 20:48
@coderabbitai
Copy link

coderabbitai bot commented Feb 3, 2026

📝 Walkthrough

Walkthrough

The changes introduce support for the showPerformanceDetails option to search, multi-search, and similar document endpoints. A new ShowPerformanceDetails boolean property is added to query types, while a PerformanceDetails property is added to result types to capture performance trace data as raw dictionary structures.

Changes

Cohort / File(s) Summary
Query Classes
src/Meilisearch/SearchQuery.cs, src/Meilisearch/SimilarDocumentsQuery.cs
Added new ShowPerformanceDetails boolean property with JSON mapping to enable performance detail retrieval in search requests.
Result Classes
src/Meilisearch/SearchResult.cs, src/Meilisearch/PaginatedSearchResult.cs, src/Meilisearch/SimilarDocumentsResult.cs
Extended constructors and added PerformanceDetails property (IReadOnlyDictionary<string, string>) to capture performance trace data from search responses.
Interface
src/Meilisearch/ISearchable.cs
Added PerformanceDetails read-only property to the ISearchable interface to standardize the search result shape.
Tests
tests/Meilisearch.Tests/SearchTests.cs, tests/Meilisearch.Tests/MultiIndexSearchTests.cs
Added 8 new test methods to validate ShowPerformanceDetails behavior across basic search, paginated search, and similar documents operations, verifying both population and absence of performance details based on the flag.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 With metrics in paw, we bound through the search,
Performance details from left to the perch,
Each query now whispers, each result now sings,
Of traces and times on swift rabbit wings!

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 17.65% 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 'Add showPerformanceDetails option to search endpoints' directly and clearly describes the main change - adding the showPerformanceDetails option to search endpoints.
Linked Issues check ✅ Passed All requirements from issue #706 are met: showPerformanceDetails added to search, multi-search, and similar documents; performanceDetails returned as raw data (IReadOnlyDictionary<string, string>); comprehensive test coverage included.
Out of Scope Changes check ✅ Passed All changes are directly scoped to adding showPerformanceDetails support across search endpoints and their corresponding result types, with no unrelated modifications detected.

✏️ 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

Important

Action Needed: IP Allowlist Update

If your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:

  • 136.113.208.247/32 (new)
  • 34.170.211.100/32
  • 35.222.179.152/32

Reviews will stop working after February 8, 2026 if the new IP is not added to your allowlist.


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

@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

🤖 Fix all issues with AI agents
In `@src/Meilisearch/PaginatedSearchResult.cs`:
- Line 26: The XML doc for the PaginatedSearchResult constructor/property
contains a stray double-quote at the end of the <param
name="performanceDetails"></param>" line; remove the trailing double-quote so
the XML doc is well-formed and the <param name="performanceDetails"> tag closes
properly in PaginatedSearchResult.cs.

/// <param name="matchesPosition"></param>
/// <param name="facetStats"></param>
/// <param name="indexUid"></param>
/// <param name="performanceDetails"></param>"
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Remove stray quote in XML doc.
The trailing " in the param doc will render incorrectly.

✅ Fix
-        /// <param name="performanceDetails"></param>"
+        /// <param name="performanceDetails"></param>
📝 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
/// <param name="performanceDetails"></param>"
/// <param name="performanceDetails"></param>
🤖 Prompt for AI Agents
In `@src/Meilisearch/PaginatedSearchResult.cs` at line 26, The XML doc for the
PaginatedSearchResult constructor/property contains a stray double-quote at the
end of the <param name="performanceDetails"></param>" line; remove the trailing
double-quote so the XML doc is well-formed and the <param
name="performanceDetails"> tag closes properly in PaginatedSearchResult.cs.

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