iOS InstantSearch - how to configure attribute filter on query

Hi,

I am using iOS InstantSearch SearchBarWidget, and wanted to check how to configure an attribute filter on the search query “hits” results.

For e.g. lets say I have store name & product name as two attributes in my database table. I want the search bar text to match only against the store name, or only against the product name. I want to dynamically choose which attribute to match against based on user input. Currently the search query matches against both these attributes. Is it possible to based on user input - dynamically configure the search filter - and get the hit results to only match against that particular attribute. I understand there is refinement - but I don’t want the user to refine the results.

Thanks

Hello,

you can take a look at searchableAttributes which lets you decide on which attribute (store or product) you want to search against.

Using restrictSearchableAttribute() based on the scenario did it. Thanks for the link.

1 Like