How to insert a search term on load?

What I’m trying to do
When a user does a search from the header search bar we might send them to the search result page, which I am building with Algolia Vue Instant Search. Coming to the page the search term they used should be inserted into the Algolia search input field and update the search results.

How to do this?

  1. Can I update the search input field somehow on load?
  2. Should the value be inserted by the Angolia backend configuration?

I hope it’s clear what I am trying to do.

Hi there,

Thank you for your question. If I understood your question correctly, you want to fill the search input on page load with a predefined value.
This is possible, and it doesn’t have to be through the backend configuration of your Algolia account. You should be able to set the value property on the ais-search-box widget to fill the query on page load.

Let me know how it goes and if you have any other questions!


1 Like