Skip to content

Add showPerformanceDetails option to search endpoint#503

Open
claudeaceae wants to merge 1 commit intomeilisearch:mainfrom
claudeaceae:feat/show-performance-details
Open

Add showPerformanceDetails option to search endpoint#503
claudeaceae wants to merge 1 commit intomeilisearch:mainfrom
claudeaceae:feat/show-performance-details

Conversation

@claudeaceae
Copy link
Copy Markdown

@claudeaceae claudeaceae commented Feb 9, 2026

Summary

Adds support for the showPerformanceDetails option introduced in Meilisearch v1.35.0, as described in #501.

When showPerformanceDetails is set to true, the search response includes a performanceDetails object containing performance trace data. Per the issue guidelines, the response is returned as raw [String: String] data without typed accessors, since the fields are subject to change.

Changes

  • Added showPerformanceDetails: Bool? to SearchParameters
  • Added performanceDetails: [String: String]? to Searchable<T> (SearchResult)
  • Added unit test validating the parameter and response parsing

Scope note

This PR covers the search endpoint. The SDK does not currently have multi-search (#379) or similar documents (#445) endpoints implemented, so showPerformanceDetails support for those can be added when those features are implemented.

Related to #501 (search portion)

Test plan

  • Unit test added for search with performance details
  • Validates parameter encoding and response decoding
  • Existing tests unaffected

Add the showPerformanceDetails boolean parameter to SearchParameters and
the performanceDetails response field to Searchable, as introduced in
Meilisearch v1.35.0.

The performanceDetails field is returned as [String: String] raw data
per the issue requirement to not add typed accessors, since the fields
are subject to change.

Closes meilisearch#501 (search endpoint only — multi-search and similar documents
endpoints are not yet implemented in this SDK).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 9, 2026

📝 Walkthrough

Walkthrough

The changes implement support for the showPerformanceDetails option in search functionality. A new optional showPerformanceDetails parameter was added to SearchParameters, and a corresponding optional performanceDetails field was added to SearchResult to capture raw performance trace data from search responses.

Changes

Cohort / File(s) Summary
Search Model Updates
Sources/MeiliSearch/Model/SearchParameters.swift, Sources/MeiliSearch/Model/SearchResult.swift
Added showPerformanceDetails: Bool? parameter to SearchParameters with updated initializer, Query enum, and CodingKeys. Added performanceDetails: [String: String]? property to SearchResult's Searchable generic class with corresponding CodingKeys entry to capture raw performance data.
Search Tests
Tests/MeiliSearchUnitTests/SearchTests.swift
Added new test case testSearchWithPerformanceDetails that constructs a JSON response with performance details, enables the showPerformanceDetails flag, executes the search, and validates that the response includes non-nil performance details with expected field values.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A dash of performance in every search today,
Raw details captured along the way,
No types to bind, just data so free,
The future awaits, as it may be,
Swift speeds enhanced, for all to see! 🚀

🚥 Pre-merge checks | ✅ 2 | ❌ 3
❌ Failed checks (3 warnings)
Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR only implements the search endpoint but issue #501 requires implementation for search, multi-search, and similar documents endpoints. Implement showPerformanceDetails support for multi-search and similar documents endpoints as specified in issue #501, or update the issue scope if those are out of scope.
Out of Scope Changes check ⚠️ Warning The test file contains a duplicate testSearchWithPerformanceDetails test case, which is unrelated to the PR's stated objectives. Remove the duplicate test case in Tests/MeiliSearchUnitTests/SearchTests.swift to avoid redundant test execution.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding the showPerformanceDetails option to the search endpoint.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

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.

2 participants