Rename the Index facets method into facets_distribution

This commit is contained in:
Clément Renault 2021-01-27 14:15:33 +01:00
parent 433ac8c38a
commit 65b821b192
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4
4 changed files with 3 additions and 4 deletions

1
http-ui/Cargo.lock generated
View File

@ -1335,7 +1335,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9fe9037165d7023b1228bc4ae9a2fa1a2b0095eca6c2998c624723dfd01314a5"
dependencies = [
"num-traits",
"serde",
]
[[package]]

View File

@ -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
};

View File

@ -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)
}

View File

@ -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);
}