Skip to content

Commit

Permalink
Fixed a compilation error introduced by new types
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderStorm committed May 6, 2024
1 parent d711772 commit b52c079
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions server/main-api/src/search/search_executor/query.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -150,15 +150,15 @@ 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
.with_filter(&self.filters.buildings)
.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)
Expand Down

0 comments on commit b52c079

Please sign in to comment.