mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-22 21:04:27 +01:00
Make Clippy happy
This commit is contained in:
parent
a385642ec3
commit
d9fea0143f
@ -64,7 +64,7 @@ pub struct SearchQueryGet {
|
|||||||
show_ranking_score_details: Param<bool>,
|
show_ranking_score_details: Param<bool>,
|
||||||
#[deserr(default, error = DeserrQueryParamError<InvalidSearchFacets>)]
|
#[deserr(default, error = DeserrQueryParamError<InvalidSearchFacets>)]
|
||||||
facets: Option<CS<String>>,
|
facets: Option<CS<String>>,
|
||||||
#[deserr(default, error = DeserrQueryParamError<InvalidSearchFacets>)]
|
#[deserr(default, error = DeserrQueryParamError<InvalidSearchFacets>)] // TODO
|
||||||
sort_facet_values_by: Option<FacetValuesSort>,
|
sort_facet_values_by: Option<FacetValuesSort>,
|
||||||
#[deserr( default = DEFAULT_HIGHLIGHT_PRE_TAG(), error = DeserrQueryParamError<InvalidSearchHighlightPreTag>)]
|
#[deserr( default = DEFAULT_HIGHLIGHT_PRE_TAG(), error = DeserrQueryParamError<InvalidSearchHighlightPreTag>)]
|
||||||
highlight_pre_tag: String,
|
highlight_pre_tag: String,
|
||||||
|
@ -236,17 +236,17 @@ impl From<MatchingStrategy> for TermsMatchingStrategy {
|
|||||||
#[derive(Debug, Default, Clone, PartialEq, Eq, Deserr)]
|
#[derive(Debug, Default, Clone, PartialEq, Eq, Deserr)]
|
||||||
#[deserr(rename_all = camelCase)]
|
#[deserr(rename_all = camelCase)]
|
||||||
pub enum FacetValuesSort {
|
pub enum FacetValuesSort {
|
||||||
/// Facet values are sorted by decreasing count.
|
/// Facet values are sorted in alphabetical order, ascending from A to Z.
|
||||||
/// The count is the number of records containing this facet value in the results of the query.
|
|
||||||
#[default]
|
#[default]
|
||||||
Alpha,
|
Alpha,
|
||||||
/// Facet values are sorted in alphabetical order, ascending from A to Z.
|
/// Facet values are sorted by decreasing count.
|
||||||
|
/// The count is the number of records containing this facet value in the results of the query.
|
||||||
Count,
|
Count,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<OrderBy> for FacetValuesSort {
|
impl From<FacetValuesSort> for OrderBy {
|
||||||
fn into(self) -> OrderBy {
|
fn from(val: FacetValuesSort) -> Self {
|
||||||
match self {
|
match val {
|
||||||
FacetValuesSort::Alpha => OrderBy::Lexicographic,
|
FacetValuesSort::Alpha => OrderBy::Lexicographic,
|
||||||
FacetValuesSort::Count => OrderBy::Count,
|
FacetValuesSort::Count => OrderBy::Count,
|
||||||
}
|
}
|
||||||
|
@ -110,8 +110,7 @@ where
|
|||||||
ControlFlow::Break(_) => return Ok(()),
|
ControlFlow::Break(_) => return Ok(()),
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let starting_key =
|
let starting_key = FacetGroupKey { field_id, level: level.0 - 1, left_bound };
|
||||||
FacetGroupKey { field_id, level: level.0 - 1, left_bound: left_bound };
|
|
||||||
for el in db.range(rtxn, &(&starting_key..)).unwrap().take(group_size as usize) {
|
for el in db.range(rtxn, &(&starting_key..)).unwrap().take(group_size as usize) {
|
||||||
let (key, value) = el.unwrap();
|
let (key, value) = el.unwrap();
|
||||||
// The range is unbounded on the right and the group size for the highest level is MAX,
|
// The range is unbounded on the right and the group size for the highest level is MAX,
|
||||||
|
Loading…
Reference in New Issue
Block a user