Instantsearch.js: Possibility to toggle searchable attributes

Created on 10 Apr 2018  路  1Comment  路  Source: algolia/instantsearch.js

Hello,

i would like to ask you, if there is the possibility to toggle a searchable attribute via checkbox.

E.g. the user searches for a special "keyword" but can't find it. So he checks the box for "fulltext search" and can find a keyword by any definition.

The only solution i've found, was to index the keywords twice. Once with and without the "fulltext".

Thanks for your help.

Question

Most helpful comment

Hi @stelem unfortunately searchableAttributes is a setting parameter. It can't be changed with search parameters.

On the Algolia side, one way is to rely on primary / secondary with different searchableAttributes.

And then switch the index on the fly. You can use the sortBySelector for that. But since you mentioned that you wanted a checkbox, then you probably want to have a look at the connector.

>All comments

Hi @stelem unfortunately searchableAttributes is a setting parameter. It can't be changed with search parameters.

On the Algolia side, one way is to rely on primary / secondary with different searchableAttributes.

And then switch the index on the fly. You can use the sortBySelector for that. But since you mentioned that you wanted a checkbox, then you probably want to have a look at the connector.

Was this page helpful?
0 / 5 - 0 ratings