Facet Filtering

I’m trying to filter my search results by a “category” attribute inside my Algolia records, and I can’t get it to work. In my Android app I’m using

index.searchAsync(new Query(searchText).setFilters(“category:”+categoryName), completionHandler);

I just get a response back with no results at all. I do get results when I don’t set filters. I’ve also tried filtering just in the Algolia website by setting a facet filter on the index I’m searching, but it never shows any results there either.

Here’s an example of one of my records:

“deckID”: “-Kh0GXuGqyHAHhX8ZY2r”,
“title”: “new deck”,
“category”: “games”,
“description”: “The very newest!”

I’m searching on attributes “title” and “description” and trying to filter on “category”.

Any help is appreciated.

Hi Nicholas,

Happy to try and help you resolve this! First and foremost, have you added “category” to the “Attributes for faceting” inside your dashboard? Its under the “display” tab for your index, under “Faceting”.

Let me know if this helps, and we can go from there.



That was it. Didn’t know that was an option. Thanks!

Glad it was helpful! :slight_smile: