Add API search setting

This commit is contained in:
ManyTheFish 2023-06-07 11:24:40 +02:00
parent a3716c5678
commit 461b5118bd
7 changed files with 22 additions and 2 deletions

View file

@ -70,6 +70,8 @@ pub struct SearchQueryGet {
crop_marker: String,
#[deserr(default, error = DeserrQueryParamError<InvalidSearchMatchingStrategy>)]
matching_strategy: MatchingStrategy,
#[deserr(default, error = DeserrQueryParamError<InvalidRestrictSearchableAttributes>)]
pub restrict_searchable_attributes: Option<CS<String>>,
}
impl From<SearchQueryGet> for SearchQuery {
@ -102,6 +104,9 @@ impl From<SearchQueryGet> for SearchQuery {
highlight_post_tag: other.highlight_post_tag,
crop_marker: other.crop_marker,
matching_strategy: other.matching_strategy,
restrict_searchable_attributes: other
.restrict_searchable_attributes
.map(|o| o.into_iter().collect()),
}
}
}