Clean up the code a bit

This commit is contained in:
Clément Renault 2025-05-28 14:22:53 +02:00
parent 2da64e835e
commit 2821163b95
No known key found for this signature in database
GPG Key ID: F250A4C4E3AE5F5F

View File

@ -247,8 +247,8 @@ async fn process_search_request(
embedder, embedder,
}), }),
limit: limit.unwrap_or_else(DEFAULT_SEARCH_LIMIT), limit: limit.unwrap_or_else(DEFAULT_SEARCH_LIMIT),
sort: sort, sort,
distinct: distinct, distinct,
matching_strategy: matching_strategy matching_strategy: matching_strategy
.map(|ms| match ms { .map(|ms| match ms {
index::MatchingStrategy::Last => MatchingStrategy::Last, index::MatchingStrategy::Last => MatchingStrategy::Last,
@ -256,7 +256,7 @@ async fn process_search_request(
index::MatchingStrategy::Frequency => MatchingStrategy::Frequency, index::MatchingStrategy::Frequency => MatchingStrategy::Frequency,
}) })
.unwrap_or(MatchingStrategy::Frequency), .unwrap_or(MatchingStrategy::Frequency),
attributes_to_search_on: attributes_to_search_on, attributes_to_search_on,
ranking_score_threshold: ranking_score_threshold ranking_score_threshold: ranking_score_threshold
.and_then(|rst| RankingScoreThreshold::try_from(rst).ok()), .and_then(|rst| RankingScoreThreshold::try_from(rst).ok()),
..Default::default() ..Default::default()