diff --git a/meilisearch-http/src/index/search.rs b/meilisearch-http/src/index/search.rs index 0ff6c1bc3..312067472 100644 --- a/meilisearch-http/src/index/search.rs +++ b/meilisearch-http/src/index/search.rs @@ -33,9 +33,8 @@ pub struct SearchQuery { pub attributes_to_crop: Option>, pub crop_length: Option, pub attributes_to_highlight: Option>, - pub filters: Option, pub matches: Option, - pub facet_filters: Option, + pub filter: Option, pub facet_distributions: Option>, } @@ -75,8 +74,8 @@ impl Index { search.limit(query.limit); search.offset(query.offset.unwrap_or_default()); - if let Some(ref facets) = query.facet_filters { - if let Some(facets) = parse_facets(facets, self, &rtxn)? { + if let Some(ref filter) = query.filter { + if let Some(facets) = parse_facets(filter, self, &rtxn)? { search.facet_condition(facets); } } diff --git a/meilisearch-http/src/routes/search.rs b/meilisearch-http/src/routes/search.rs index 86beb2750..5f4e285f8 100644 --- a/meilisearch-http/src/routes/search.rs +++ b/meilisearch-http/src/routes/search.rs @@ -24,9 +24,8 @@ pub struct SearchQueryGet { attributes_to_crop: Option, crop_length: Option, attributes_to_highlight: Option, - filters: Option, + filter: Option, matches: Option, - facet_filters: Option, facet_distributions: Option, } @@ -50,7 +49,7 @@ impl TryFrom for SearchQuery { .facet_distributions .map(|attrs| attrs.split(',').map(String::from).collect::>()); - let facet_filters = match other.facet_filters { + let filter = match other.filter { Some(ref f) => Some(serde_json::from_str(f)?), None => None, }; @@ -63,9 +62,8 @@ impl TryFrom for SearchQuery { attributes_to_crop, crop_length: other.crop_length, attributes_to_highlight, - filters: other.filters, + filter, matches: other.matches, - facet_filters, facet_distributions, }) }