Autocomplete search - user search query or _tags

Hi, I have implemented autocomplete input text, in which whatever user types then it searches from searchable attributes that are specified on algolia dashboard. also I have used filter for searching records with “Active” status and for location/town also I am using filter.

Now I start using _tags feature of algolia in autocomplete. So as user types then I want result in such a that either search query matches from searchable attributes OR either _tags matches user input then all those records should to be list in autocomplete. So I have used _tags also in filter. But thing doesn’t seems to be work at the same time with OR condition. Instead it is applying tag filters filters on a search query.

Please help me. Please.

Thanks.

Hi @mtilokani,

You can’t combine filters and query with an OR operator it’s always an AND.

But it seems that your use case it’s not really related to filters. If I understand correctly you want to be able to retrieve records that will match your searchableAttributes or your tags from your query.

Why don’t you set tags also as a searchableAttributes ? You will be able to find all the records that match your original searchableAttributes but also from your tags.

Hope that helps, let me know if you have question! :wink:

Hi @samuel.vaillant ,

I tried and spent much time on this issue, then later I did like the same way that you had suggested in your comment.

Actually this was the option for me, but I was in need of taking advantages of _tags of Algolia, that’s why I was trying with _tags.

Thanks man!