mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
Considere an empty query search as a placeholder search #916
This commit is contained in:
parent
63868b2600
commit
90226dc8a9
2 changed files with 34 additions and 28 deletions
|
@ -105,8 +105,12 @@ impl SearchQuery {
|
|||
.schema(&reader)?
|
||||
.ok_or(Error::internal("Impossible to retrieve the schema"))?;
|
||||
|
||||
let mut search_builder = index.new_search(self.q.clone());
|
||||
let query = self
|
||||
.q
|
||||
.clone()
|
||||
.and_then(|q| if q.is_empty() { None } else { Some(q) });
|
||||
|
||||
let mut search_builder = index.new_search(query);
|
||||
if let Some(offset) = self.offset {
|
||||
search_builder.offset(offset);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue