mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 20:07:09 +02:00
Rename parse_facets into parse_filter
This commit is contained in:
parent
d9c0190497
commit
5e656bb58a
1 changed files with 4 additions and 4 deletions
|
@ -85,7 +85,7 @@ impl Index {
|
||||||
search.offset(query.offset.unwrap_or_default());
|
search.offset(query.offset.unwrap_or_default());
|
||||||
|
|
||||||
if let Some(ref filter) = query.filter {
|
if let Some(ref filter) = query.filter {
|
||||||
if let Some(facets) = parse_facets(filter, self, &rtxn)? {
|
if let Some(facets) = parse_filter(filter, self, &rtxn)? {
|
||||||
search.filter(facets);
|
search.filter(facets);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -464,19 +464,19 @@ impl<'a, A: AsRef<[u8]>> Formatter<'a, A> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn parse_facets(
|
fn parse_filter(
|
||||||
facets: &Value,
|
facets: &Value,
|
||||||
index: &Index,
|
index: &Index,
|
||||||
txn: &RoTxn,
|
txn: &RoTxn,
|
||||||
) -> anyhow::Result<Option<FilterCondition>> {
|
) -> anyhow::Result<Option<FilterCondition>> {
|
||||||
match facets {
|
match facets {
|
||||||
Value::String(expr) => Ok(Some(FilterCondition::from_str(txn, index, expr)?)),
|
Value::String(expr) => Ok(Some(FilterCondition::from_str(txn, index, expr)?)),
|
||||||
Value::Array(arr) => parse_facets_array(txn, index, arr),
|
Value::Array(arr) => parse_filter_array(txn, index, arr),
|
||||||
v => bail!("Invalid facet expression, expected Array, found: {:?}", v),
|
v => bail!("Invalid facet expression, expected Array, found: {:?}", v),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn parse_facets_array(
|
fn parse_filter_array(
|
||||||
txn: &RoTxn,
|
txn: &RoTxn,
|
||||||
index: &Index,
|
index: &Index,
|
||||||
arr: &[Value],
|
arr: &[Value],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue