Hi all,
in my application we are using Search UI with App Search connector. The default behavior of Search UI seems to match all documents if an empty query is fired.
Search API | App Search documentation [8.10] | Elastic
In our use case no query should be fired OR no results should be displayed if the user enters an empty or whitespaces only query string. (The user should also be able to delete the query per button in the UI. At the moment a query is performed then.)
So, is it possible to change that default behavior in Search UI or App Search or Enterprise Search/Elasticsearch? Or what other options I may have?
The best case would be that no query is performed if the search term is empty or whitespaces only.
But if it is not possible to avoid a query what options I have then? We will try to play a bit around with initialState and an "impossible" search term (e.g. an GUID which is unusal). SearchProvider | Documentation (elastic.co)
I saw also that other users modified the SearchBox. Reset filters to initial state on setSearchTerm · Issue #619 · elastic/search-ui · GitHub
There is also an beforeSearchCall option which may help - but I've never used them. App Search Connector | Documentation (elastic.co)
But maybe there is a "no-workaround" solution?
Best regards
Sebastian