meilisearch-rust icon indicating copy to clipboard operation
meilisearch-rust copied to clipboard

[v1.10.0] Federated search

Open brunoocasali opened this issue 1 year ago • 1 comments

Following this central issue

Explanation of the feature

Pass new search parameters to multiSearch method to get one single list of result Ensure the queries passed can accept the federationOptions search parameter No need to handle the case of errors, Meilisearch does it

Usage: https://meilisearch.notion.site/v1-10-federated-search-698dfe36ab6b4668b044f735fb40f0b2?pvs=74

TODO

  • [ ] Add a new search parameter named federation to the multiSearch method
  • [ ] Add the capability to have a new search parameter to the search query named federationOptions
  • [ ] Add tests

⚠️ Please do 1 PR for all of these changes, and not several.

brunoocasali avatar Aug 27 '24 11:08 brunoocasali

@brunoocasali How should this work in the case of the rust-sdk? We currently return

https://docs.rs/meilisearch-sdk/latest/meilisearch_sdk/search/struct.MultiSearchResponse.html

pub struct MultiSearchResponse<T> {
    pub results: Vec<SearchResults<T>>,
}

=> adding an (serde-untagged) Enum in its place would be Breaking.

Alternatively, should I add another method next to https://docs.rs/meilisearch-sdk/latest/meilisearch_sdk/client/struct.Client.html#method.execute_multi_search_query

pub async fn execute_multi_search_query<T: 'static + DeserializeOwned + Send + Sync>(
        &self,
        body: &MultiSearchQuery<'_, '_, Http>,
    ) -> Result<MultiSearchResponse<T>, Error> {

For example with this signature

pub async fn execute_federated_multi_search_query<T: 'static + DeserializeOwned + Send + Sync>(
        &self,
        body: &MultiSearchQuery<'_, '_, Http>,
        federationOptions: TODO,
    ) -> Result<MultiSearchResponse<T>, Error> {

CommanderStorm avatar Aug 29 '24 19:08 CommanderStorm