mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 11:57:07 +02: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:
commit
634201244c
2 changed files with 6 additions and 1 deletions
|
@ -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();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue