mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-12-25 14:10:06 +01: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"
|
checksum = "9fe9037165d7023b1228bc4ae9a2fa1a2b0095eca6c2998c624723dfd01314a5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"num-traits",
|
"num-traits",
|
||||||
"serde",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -702,7 +702,7 @@ async fn main() -> anyhow::Result<()> {
|
|||||||
|
|
||||||
let number_of_candidates = candidates.len();
|
let number_of_candidates = candidates.len();
|
||||||
let facets = if query.facet_distribution == Some(true) {
|
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 {
|
} else {
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
|
@ -351,7 +351,7 @@ impl Index {
|
|||||||
Ok(self.documents_ids(rtxn).map(|docids| docids.len() as usize)?)
|
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)
|
FacetDistribution::new(rtxn, self)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ pub fn run(opt: Opt) -> anyhow::Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if opt.print_facet_distribution {
|
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)?;
|
serde_json::to_writer(&mut stdout, &facets)?;
|
||||||
let _ = writeln!(&mut stdout);
|
let _ = writeln!(&mut stdout);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user