How to set default search value to search box on page load with Algolia Search?

Viewed 193

I have created my Algolia search in “localhost/search” path. I want if some one redirected to that page using “localhost/search?dog” type URL , Then the search box should be filed with dog. Is that possible to do that?

search.addWidget(
 instantsearch.widgets.searchBox({
// defaultSearchVal: defaultSearchVal,//Is there a way to add something like this
container: '#search-searchbar',
placeholder: 'Search into posts...', 
poweredBy: true  

}) );

enter image description here I was created this by reading this algoria example

0 Answers
Related