question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Do not load results of page load (empty query)

See original GitHub issue

Do 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:closed
  • Created 6 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
cschwedacommented, Apr 20, 2018

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.

2reactions
fractalfcommented, May 3, 2018

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found