From b52c0790b21e86423e74047dda7cce9d7b5c80af Mon Sep 17 00:00:00 2001 From: Frank Elsinga Date: Mon, 6 May 2024 14:01:18 +0200 Subject: [PATCH] Fixed a compilation error introduced by new types --- .../main-api/src/search/search_executor/query.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/server/main-api/src/search/search_executor/query.rs b/server/main-api/src/search/search_executor/query.rs index 2d57c9bbd..4249848af 100644 --- a/server/main-api/src/search/search_executor/query.rs +++ b/server/main-api/src/search/search_executor/query.rs @@ -1,11 +1,11 @@ +use meilisearch_sdk::client::Client; use meilisearch_sdk::errors::Error; use meilisearch_sdk::indexes::Index; use meilisearch_sdk::search::{MultiSearchResponse, SearchQuery, Selectors}; -use meilisearch_sdk::Client; use serde::Deserialize; -use crate::search::search_executor::parser::{Filter, ParsedQuery, TextToken}; use crate::search::SanitisedSearchQueryArgs; +use crate::search::search_executor::parser::{Filter, ParsedQuery, TextToken}; #[derive(Deserialize, Default, Clone, Debug)] #[allow(dead_code)] @@ -67,7 +67,7 @@ impl GeoEntryQuery { let q_default = self.prompt_for_querying(); let ms_url = std::env::var("MIELI_URL").unwrap_or_else(|_| "http://localhost:7700".to_string()); - let client = Client::new(ms_url, std::env::var("MEILI_MASTER_KEY").ok()); + let client = Client::new(ms_url, std::env::var("MEILI_MASTER_KEY").ok())?; let entries = client.index("entries"); // due to lifetime shenanigans this is added here (I can't make it move down to the other statements) @@ -129,7 +129,7 @@ impl GeoEntryQuery { .join(" ") } - fn common_query<'b: 'a, 'a>(&'b self, entries: &'a Index) -> SearchQuery<'a> { + fn common_query<'b: 'a, 'a>(&'b self, entries: &'a Index) -> SearchQuery<'a, meilisearch_sdk::DefaultHttpClient> { SearchQuery::new(entries) .with_facets(Selectors::Some(&["facet"])) .with_highlight_pre_tag(&self.highlighting.0) @@ -138,7 +138,7 @@ impl GeoEntryQuery { .build() } - fn merged_query<'a>(&'a self, entries: &'a Index, query: &'a str) -> SearchQuery<'a> { + fn merged_query<'a>(&'a self, entries: &'a Index, query: &'a str) -> SearchQuery<'a, meilisearch_sdk::DefaultHttpClient> { let mut s = self .common_query(entries) .with_query(query) @@ -150,7 +150,7 @@ impl GeoEntryQuery { s } - fn buildings_query<'a>(&'a self, entries: &'a Index, query: &'a str) -> SearchQuery<'a> { + fn buildings_query<'a>(&'a self, entries: &'a Index, query: &'a str) -> SearchQuery<'a, meilisearch_sdk::DefaultHttpClient> { self.common_query(entries) .with_query(query) .with_limit(2 * self.args.limit_buildings) // we might do reordering later @@ -158,7 +158,7 @@ impl GeoEntryQuery { .build() } - fn rooms_query<'a>(&'a self, entries: &'a Index, query: &'a str) -> SearchQuery<'a> { + fn rooms_query<'a>(&'a self, entries: &'a Index, query: &'a str) -> SearchQuery<'a, meilisearch_sdk::DefaultHttpClient> { self.common_query(entries) .with_query(query) .with_limit(self.args.limit_rooms)