rename facets to facetsDistribution

This commit is contained in:
mpostma 2020-05-26 17:56:07 +02:00
parent c1a2c7b610
commit b6570f7016
3 changed files with 17 additions and 17 deletions

View file

@ -248,7 +248,7 @@ impl<'a> SearchBuilder<'a> {
exhaustive_nb_hits: search_result.exhaustive_nb_hit,
processing_time_ms: time_ms,
query: self.query.to_string(),
facets: search_result.facets,
facets_distribution: search_result.facets,
};
Ok(results)
@ -334,7 +334,7 @@ pub struct SearchResult {
pub processing_time_ms: usize,
pub query: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub facets: Option<HashMap<String, HashMap<String, usize>>>,
pub facets_distribution: Option<HashMap<String, HashMap<String, usize>>>,
}
/// returns the start index and the length on the crop.

View file

@ -33,7 +33,7 @@ struct SearchQuery {
filters: Option<String>,
matches: Option<bool>,
facet_filters: Option<String>,
facets: Option<String>,
facets_distribution: Option<String>,
}
#[get("/indexes/{index_uid}/search", wrap = "Authentication::Public")]
@ -94,7 +94,7 @@ async fn search_with_url_query(
}
}
if let Some(facets) = &params.facets {
if let Some(facets) = &params.facets_distribution {
match index.main.attributes_for_faceting(&reader)? {
Some(ref attrs) => {
let field_ids = prepare_facet_list(&facets, &schema, attrs)?;