Skip to content

Add support for showPerformanceDetails in search endpoints#468

Open
ikramhasan wants to merge 1 commit intomeilisearch:mainfrom
ikramhasan:i_466
Open

Add support for showPerformanceDetails in search endpoints#468
ikramhasan wants to merge 1 commit intomeilisearch:mainfrom
ikramhasan:i_466

Conversation

@ikramhasan
Copy link

@ikramhasan ikramhasan commented Feb 4, 2026

Pull Request

Add support for showPerformanceDetails

Related issue

Resolves #466

What does this PR do?

  • Add showPerformanceDetails request parameter to SearchQuery and IndexSearchQuery
  • Add performanceDetails response field to Searcheable, SearchResult, and PaginatedSearchResult as raw Map<String, dynamic>?
  • Applies to search and multi-search endpoints
  • Add test cases

Tested with this code:

import 'package:meilisearch/meilisearch.dart';

void main() async {
  var client = MeiliSearchClient('http://localhost:7700', 'aSampleMasterKey');
  final index = client.index('movies');

  final searchResult = await index.search(
    'Taisto Kasurinen',
    SearchQuery(showPerformanceDetails: true),
  );

  final multiSearchResult = await client.multiSearch(
    MultiSearchQuery(
      queries: [
        IndexSearchQuery(
          query: 'Taisto Kasurinen',
          indexUid: index.uid,
          showPerformanceDetails: true,
        ),
      ],
    ),
  );

  print(searchResult.performanceDetails);
  print(multiSearchResult.results.first.performanceDetails);
}

Result:

{wait for permit: 45.38µs, search > tokenize: 102.29µs, search > resolve universe: 379.29µs, search > keyword search: 39.04µs, search > format: 38.13µs, search: 789.34µs}
{wait for permit: 50.71µs, search > tokenize: 86.67µs, search > resolve universe: 459.13µs, search > keyword search: 41.21µs, search > format: 38.54µs, search: 846.04µs}

Summary by CodeRabbit

  • New Features

    • Added optional performance metrics in search results. Users can now request performance details to monitor query execution (requires Meilisearch 1.35.0+).
  • Tests

    • Added test coverage for performance details functionality across single and multi-index searches.

@coderabbitai
Copy link

coderabbitai bot commented Feb 4, 2026

📝 Walkthrough

Walkthrough

The PR adds support for Meilisearch 1.35.0's showPerformanceDetails option to search and multi-search endpoints. It introduces a query parameter to request performance details and threads the returned performance data (as raw Map data) through result classes, with accompanying tests.

Changes

Cohort / File(s) Summary
Query Parameters
lib/src/query_parameters/search_query.dart, lib/src/query_parameters/index_search_query.dart
Added showPerformanceDetails boolean parameter to query classes with version guard (1.35.0+), serialized in buildMap, and supported in copyWith for query construction.
Result Base Class
lib/src/results/searchable.dart
Added performanceDetails field (Map<String, dynamic>?) as a required constructor parameter to the abstract Searchable base class.
Result Implementations
lib/src/results/search_result.dart, lib/src/results/paginated_search_result.dart
Updated constructor and fromMap/map methods to propagate performanceDetails through result instances.
Helper Utilities
lib/src/results/searchable_helpers.dart
Added private _readPerformanceDetails helper function to extract and cast the performanceDetails field from response maps.
Tests
test/search_test.dart, test/multi_index_search_test.dart
Added test coverage for showPerformanceDetails parameter behavior, validating that performanceDetails is present when requested and null otherwise.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A feature hopped in, performance in sight,
Details now showable, metrics so bright,
Through queries and results, the data takes flight,
Meilisearch 1.35, shining with light!
Raw maps carry secrets, untamed and free.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and clearly describes the main change: adding showPerformanceDetails support to search endpoints, which matches the primary objective of the pull request.
Linked Issues check ✅ Passed The PR implements all coding requirements from issue #466: adds showPerformanceDetails parameter to search/multi-search, exposes performanceDetails as raw Map data, and includes test cases for the new functionality.
Out of Scope Changes check ✅ Passed All changes are directly scoped to implementing showPerformanceDetails support in search endpoints; no unrelated modifications detected.
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
  • 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
Contributor

@Strift Strift left a comment

Choose a reason for hiding this comment

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

Hello @ikramhasan, and thank you for your contribution 🙌

LGTM!

Unfortunately, the tests are failing right now, and I don't have time to investigate further. Any help would be appreciated 🙏

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

2 participants