#community-help

Modifying Index Name Dynamically in Instant Search Adapter

TLDR KARTHICK wanted to make indexName dynamic in typesense instant search adapter. Jason suggested instantiating the adapter dynamically, while Ivan recommended multi-index search and using multiple pairs of index + hits widgets.

Powered by Struct AI
+11
slightly_smiling_face1
9
9mo
Solved
Join the chat
Dec 09, 2022 (9 months ago)
KARTHICK
Photo of md5-9885c2d5db3a85d24bc9c11809bcaf50
KARTHICK
04:37 AM
I have used the typesense instant search adapter in the front end.where i have hardcoded the indexName that needs to be changed dynamic to access multiple collection at the same time like federation search.Any one guide me how to do that.Multiple collection search using instantsearch adapter Kishore Nallan Jason
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
05:55 AM
You will have to instantiate the adapter dynamically any time you want to change the collection name
05:56
Jason
05:56 AM
Then pass that client into instantsearch
05:56
Jason
05:56 AM
and also re-render the instantsearch component
Ivan
Photo of md5-bcbe2a4c9402d7445badbcf2ebdc68f8
KARTHICK
Photo of md5-9885c2d5db3a85d24bc9c11809bcaf50
KARTHICK
07:23 AM
ya thanks Ivan Ill look into it.If i have a doubt ill DM you . Thanks a lot
slightly_smiling_face1
07:41
KARTHICK
07:41 AM
Jason Im asking like if we have 2 or more collection we need access all the collection in our typesense server and do search from the front end.Like if we select ALL it need to should search through all our collections.Using instant search adapter.
Ivan
Photo of md5-bcbe2a4c9402d7445badbcf2ebdc68f8
Ivan
08:11 AM
If i correctly understood, you can achieve it by using multiple pairs of index + hits widgets
KARTHICK
Photo of md5-9885c2d5db3a85d24bc9c11809bcaf50
KARTHICK
08:13 AM
okay Ivan Ill try this out. Thanks for ur time.
+11