diff --git a/src/results/aggregation_models.rs b/src/results/aggregation_models.rs index 307cef9..6766fae 100644 --- a/src/results/aggregation_models.rs +++ b/src/results/aggregation_models.rs @@ -155,7 +155,6 @@ pub struct SearchResults { pub page_query: String, pub style: Style, pub engine_errors_info: Vec, - pub empty_result_set: bool, } impl SearchResults { @@ -179,7 +178,6 @@ impl SearchResults { page_query, style: Style::new("".to_string(), "".to_string()), engine_errors_info, - empty_result_set: false, } } @@ -187,14 +185,4 @@ impl SearchResults { pub fn add_style(&mut self, style: Style) { self.style = style; } - - /// A function which checks whether the results stored are empty or not. - pub fn is_empty_result_set(&self) -> bool { - self.results.is_empty() - } - - /// A setter function which sets the empty_result_set to true. - pub fn set_empty_result_set(&mut self) { - self.empty_result_set = true; - } } diff --git a/src/server/routes.rs b/src/server/routes.rs index de9ab77..e846fd9 100644 --- a/src/server/routes.rs +++ b/src/server/routes.rs @@ -161,12 +161,6 @@ async fn results( } }; results_json.add_style(config.style.clone()); - // check whether the results grabbed from the upstream engines are empty or - // not if they are empty then set the empty_result_set option to true in - // the result json. - if results_json.is_empty_result_set() { - results_json.set_empty_result_set(); - } redis_cache.cache_results(serde_json::to_string(&results_json)?, &url)?; Ok(results_json) }