Do not load results of page load (empty query)
See original GitHub issueDo you want to request a feature or report a bug?
feature
Bug: What is the current behavior?
Currently, there is no easy way to hide results on page load (empty query). I believe this is pretty common request.
Bug: What is the expected behavior?
The page should not display results, but it also shouldn’t load data. If you sinmple display: none
images and such will be fetched.
Bug: What is the proposed solution?
Either add a parameter to <ais-results>
for example or at least document how to achieve it (as I believe this is not straight forward).
Related question: https://stackoverflow.com/questions/49069732/how-do-i-set-algolia-to-not-return-any-results-if-the-query-is-blank-laravel-v
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
SharePoint Search prevent showing results when loading page
I have a site with two webparts (search input field and search results). On each pageload it's searching for an empty string and...
Read more >React - Query Parameters Are Empty on Page Load
When I refresh the page, the query string is not empty and the search results appear. Any ideas?
Read more >Empty or insufficient results - Algolia
The first step is to review your current solution. Rework your content to ensure good data; Make sure your basic search and index...
Read more >Work items and direct links query results empty
API returns 200, but 'workItemRelations' is empty list. After refreshing it does not still load, only after some time it starts returning correctly...
Read more >Programmable Search Element Control API
All JavaScript is loaded asynchronously, so page load time is reduced. You can embed Programmable Search Engine components (search boxes and search results...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have the same question: is there a way to render the search box but not automatically display the results when the search page loads?
Essentially, I don’t want results displayed until the user actually starts typing in the box.
I can hide the results, but I’m not clear on how I trap the first keypress in the search box. Checking for
v-on:keyup
doesn’t work.Is there an easy way to simply not render any results until the user starts to actually type?
EDIT: The SO link in the OPs original post works. That’s what I was looking for. Thanks.
@Haroenv Great stuff! You guys are pumping out code 😃
I managed a solution (without a core hack) by combining the suggestion from that stackoverflow link with ith a local
query
that only change the “algolia”query
when not empty. Until the next version comes out, this is good enough.