#community-help

Parameters for Quick Start Search Query

TLDR A asked how to auto-run a search query. Kishore Nallan suggested the 'additionalSearchParameters' field, while Jason proposed using 'routing: true'.

Powered by Struct AI
6
23mo
Solved
Join the chat
Feb 12, 2022 (23 months ago)
A
Photo of md5-fe034fbff44e9cae037b7bb23a5080c4
A
10:58 AM
Q: can I call the search page with a parameter containing a pre-defined query text in order to start the search immediately with this query parameter?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
10:59 AM
In instantsearch.js?
A
Photo of md5-fe034fbff44e9cae037b7bb23a5080c4
A
10:59 AM
well, in my app.js loaded by the search form
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
11:00 AM
In additionalSearchParameters try setting the query key to a default query string.
A
Photo of md5-fe034fbff44e9cae037b7bb23a5080c4
A
11:01 AM
ah, right
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
03:02 PM
A Another option is to set routing: true in instantsearch, but not sure if that will work in your case given that the search experience is inside your CMS. More context here: https://www.algolia.com/doc/guides/building-search-ui/going-further/routing-urls/js/#basic-urls