Skip to content

Conversation

@Mubelotix
Copy link
Collaborator

@Mubelotix Mubelotix commented Jul 10, 2025

Pull Request

Rework of PR #512

Related issue

Fixes #503

What does this PR do?

  • Add functionality to use the facet-search API
  • Add code samples for the new method

PR checklist

Please check if your PR fulfills the following requirements:

  • 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

    • Introduced support for performing facet searches on indexes, allowing users to search and filter facet values with various query and filter options.
    • Added new response formats to display facet values and counts.
    • Provided code samples demonstrating how to use the new facet search functionality with and without filters.
    • Added support for a new "Chat Completions" action for key permissions.
  • Tests

    • Added comprehensive tests to ensure the reliability and correctness of the new facet search feature.

@coderabbitai

This comment was marked as off-topic.

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

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 90a153c and f7d92b1.

📒 Files selected for processing (3)
  • .code-samples.meilisearch.yaml (1 hunks)
  • src/indexes.rs (1 hunks)
  • src/search.rs (2 hunks)
🧰 Additional context used
🧠 Learnings (3)
.code-samples.meilisearch.yaml (1)
Learnt from: LukasKalbertodt
PR: meilisearch/meilisearch-rust#625
File: src/search.rs:368-370
Timestamp: 2025-06-12T13:28:23.700Z
Learning: In the Meilisearch Rust client, `SearchQuery` serializes its per-query federation settings under the key `federationOptions`; only the top-level multi-search parameter is named `federation`.
src/indexes.rs (1)
Learnt from: LukasKalbertodt
PR: meilisearch/meilisearch-rust#625
File: src/search.rs:368-370
Timestamp: 2025-06-12T13:28:23.700Z
Learning: In the Meilisearch Rust client, `SearchQuery` serializes its per-query federation settings under the key `federationOptions`; only the top-level multi-search parameter is named `federation`.
src/search.rs (1)
Learnt from: LukasKalbertodt
PR: meilisearch/meilisearch-rust#625
File: src/search.rs:368-370
Timestamp: 2025-06-12T13:28:23.700Z
Learning: In the Meilisearch Rust client, `SearchQuery` serializes its per-query federation settings under the key `federationOptions`; only the top-level multi-search parameter is named `federation`.
🪛 GitHub Actions: Tests
src/indexes.rs

[error] 319-319: Cannot find function request in this scope. The function request is called but not defined or imported.


[error] 329-329: Mismatched types error: expected reference &Index<ReqwestClient>, found &Index<Http>. The argument to FacetSearchQuery::new is incorrect due to type parameter mismatch.

🔇 Additional comments (3)
src/indexes.rs (1)

282-314: Excellent documentation with comprehensive example.

The documentation provides a complete usage example including the necessary setup steps (setting filterable attributes) and demonstrates the expected workflow. This follows the established patterns in the codebase well.

src/search.rs (2)

797-810: LGTM!

The response types are well-structured with appropriate serde annotations and match the expected API response format.


1458-1570: Excellent test coverage!

The tests comprehensively cover all facet search functionality including basic search, queries, filters, and matching strategies. They follow the established testing patterns and include proper assertions.

@Mubelotix Mubelotix changed the base branch from main to dev July 10, 2025 09:53
@Mubelotix Mubelotix merged commit 6eb41e8 into dev Jul 10, 2025
7 checks passed
@Mubelotix Mubelotix deleted the facet-search branch July 10, 2025 09:54
@coderabbitai coderabbitai bot mentioned this pull request Nov 3, 2025
3 tasks
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.

[v1.3] Search in facet values facetSearch

4 participants