mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-07-27 00:31:02 +00:00
250: Add the limit field to http-ui r=Kerollmops a=irevoire 251: Fix the limit r=Kerollmops a=irevoire There was no check on the limit and thus if a user specified a very large number this line could cause a panic. Co-authored-by: Tamo <tamo@meilisearch.com>
This commit is contained in:
@ -687,6 +687,7 @@ async fn main() -> anyhow::Result<()> {
|
||||
filters: Option<String>,
|
||||
facet_filters: Option<Vec<UntaggedEither<Vec<String>, String>>>,
|
||||
facet_distribution: Option<bool>,
|
||||
limit: Option<usize>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
@ -739,6 +740,10 @@ async fn main() -> anyhow::Result<()> {
|
||||
search.filter(condition);
|
||||
}
|
||||
|
||||
if let Some(limit) = query.limit {
|
||||
search.limit(limit);
|
||||
}
|
||||
|
||||
let SearchResult { matching_words, candidates, documents_ids } =
|
||||
search.execute().unwrap();
|
||||
|
||||
|
Reference in New Issue
Block a user