Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement federated multi search #625

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

LukasKalbertodt
Copy link
Contributor

Pull Request

Related issue

Fixes #609

What does this PR do?

This PR adds types and methods to use the federated multi search API. There are multiple ways to add this to this library, depending on how strictly one wants to type everything. I decided to:

  • Add a new FederatedMultiSearchResponse, which also required a new Client::execute_federated_multi_search_query. The response of federated searches is just very different from normal multi searches, and I didn't think having an enum returned by execute_multi_search_query was a particularly nice design (and it would have been a breaking change).
  • Add a federation: Option<FederationHitInfo> to each SearchResult (which is None for non-federated searches). I don't think it's worth to have a dedicated FederatedSearchResult.
  • Add MultiSearchQuery::with_federation which returns a new FederatedMultiSearchQuery. One could also change MultiSearchQuery to be able to represent federated queries, but I had a slight preference for my solution.

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!

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.10.0] Federated search
1 participant