SearchQueriesWithIndex changes

This commit is contained in:
Louis Dureuil 2024-09-12 17:48:26 +02:00
parent 57f9517a98
commit 7c084b1286
No known key found for this signature in database

View File

@ -441,9 +441,6 @@ pub struct SearchQueryWithIndex {
} }
impl SearchQueryWithIndex { impl SearchQueryWithIndex {
pub fn has_federation_options(&self) -> bool {
self.federation_options.is_some()
}
pub fn has_pagination(&self) -> Option<&'static str> { pub fn has_pagination(&self) -> Option<&'static str> {
if self.offset.is_some() { if self.offset.is_some() {
Some("offset") Some("offset")
@ -458,6 +455,11 @@ impl SearchQueryWithIndex {
} }
} }
pub fn has_facets(&self) -> bool {
let Some(facets) = &self.facets else { return false };
!facets.is_empty()
}
pub fn into_index_query_federation(self) -> (IndexUid, SearchQuery, Option<FederationOptions>) { pub fn into_index_query_federation(self) -> (IndexUid, SearchQuery, Option<FederationOptions>) {
let SearchQueryWithIndex { let SearchQueryWithIndex {
index_uid, index_uid,