Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
FederatedMultiSearchResponse
, which also required a newClient::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 byexecute_multi_search_query
was a particularly nice design (and it would have been a breaking change).federation: Option<FederationHitInfo>
to eachSearchResult
(which isNone
for non-federated searches). I don't think it's worth to have a dedicatedFederatedSearchResult
.MultiSearchQuery::with_federation
which returns a newFederatedMultiSearchQuery
. One could also changeMultiSearchQuery
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:
Thank you so much for contributing to Meilisearch!