From 65b821b192105da64daacae5d8dcf7812598b2ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Wed, 27 Jan 2021 14:15:33 +0100 Subject: [PATCH] Rename the Index facets method into facets_distribution --- http-ui/Cargo.lock | 1 - http-ui/src/main.rs | 2 +- src/index.rs | 2 +- src/subcommand/search.rs | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/http-ui/Cargo.lock b/http-ui/Cargo.lock index 06ed2cf1a..29e04d714 100644 --- a/http-ui/Cargo.lock +++ b/http-ui/Cargo.lock @@ -1335,7 +1335,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9fe9037165d7023b1228bc4ae9a2fa1a2b0095eca6c2998c624723dfd01314a5" dependencies = [ "num-traits", - "serde", ] [[package]] diff --git a/http-ui/src/main.rs b/http-ui/src/main.rs index 54f87c3e6..5c61d3e75 100644 --- a/http-ui/src/main.rs +++ b/http-ui/src/main.rs @@ -702,7 +702,7 @@ async fn main() -> anyhow::Result<()> { let number_of_candidates = candidates.len(); let facets = if query.facet_distribution == Some(true) { - Some(index.facets(&rtxn).candidates(candidates).execute().unwrap()) + Some(index.facets_distribution(&rtxn).candidates(candidates).execute().unwrap()) } else { None }; diff --git a/src/index.rs b/src/index.rs index 6020e332c..c0dd22986 100644 --- a/src/index.rs +++ b/src/index.rs @@ -351,7 +351,7 @@ impl Index { Ok(self.documents_ids(rtxn).map(|docids| docids.len() as usize)?) } - pub fn facets<'a>(&'a self, rtxn: &'a RoTxn) -> FacetDistribution<'a> { + pub fn facets_distribution<'a>(&'a self, rtxn: &'a RoTxn) -> FacetDistribution<'a> { FacetDistribution::new(rtxn, self) } diff --git a/src/subcommand/search.rs b/src/subcommand/search.rs index 178ef9941..0a150209e 100644 --- a/src/subcommand/search.rs +++ b/src/subcommand/search.rs @@ -76,7 +76,7 @@ pub fn run(opt: Opt) -> anyhow::Result<()> { } if opt.print_facet_distribution { - let facets = index.facets(&rtxn).candidates(result.candidates).execute()?; + let facets = index.facets_distribution(&rtxn).candidates(result.candidates).execute()?; serde_json::to_writer(&mut stdout, &facets)?; let _ = writeln!(&mut stdout); }