mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-23 02:27:40 +08:00
Rename the Index facets method into facets_distribution
This commit is contained in:
parent
433ac8c38a
commit
65b821b192
1
http-ui/Cargo.lock
generated
1
http-ui/Cargo.lock
generated
@ -1335,7 +1335,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9fe9037165d7023b1228bc4ae9a2fa1a2b0095eca6c2998c624723dfd01314a5"
|
||||
dependencies = [
|
||||
"num-traits",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -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
|
||||
};
|
||||
|
@ -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)
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user