Algolia non-text search with facets filtering

Hello Algolia,
You guys have made it easy enough to start with (I find open APIs like “demo_ecommerce” to be really a painkiller), thanks!
I am using Algolia from a react-native (expo) client. So, I am able to use and customize a full-text search (except that using search text autocomplete (instead of instantSearch) seems like a good amount of work from the docs).
Anyway, my query is that how to use Algolia for a non-text search like:

User clicks on a category name -> fetch all products from this category -> show the facet filters and sort by options (same as in full-text search) -> user could filter or sort and Algolia responds

If it’s more appropriate to do from my backend, please elaborate a little (or point to an example/docs). If I am asking for something obvious (it could be, algolia is that good), please guide me to appropriate resources.

Hey there,

What you’re asking for is building a search interface without search box, which is doable with React InstantSearch.

Since you’re using React Native, you’ll have access to any connector from our widgets page.

As an example, you can use connectHierarchicalMenu to display the category names and allow any refinement based on those.

Let me know if it remains unclear.

1 Like

Hi @francoischalifour Thanks for your kind response. I am new to Algolia vocabulary and have been reading after asking this question. I have come to a conclusion that given my marketplace application, I should connect to algolia via my custom backend, and could use algolia API options like filtering there to ask for all products with a given category (category will be a facet attribute) value. Does that sound right?
I have an Apollo server (graphql) and am so confused on how to actually implement this; should I use InstantSearch or Apollo Client (now that you have said InstantSearch, I will definitely try it first)?
Lack of detailed blogs is a little unpleasing, given how vast algolia vocab is (I know this is because algolia is big n awesome, no complaints there)!
Please correct me if I am going wrong here, or send those pro suggestions. Thank you!

I would recommend reading the FAQ section on our documentation called “Searching from the front-end or the back-end? What do you recommend?”.

You can only leverage the full Algolia infrastructure if you send your requests from the frontend directly.

1 Like

Thanks @francoischalifour I had read that piece, and I definitely understand the performance benefits; for first I can see it, it’d be hard to beat that for anybody, and have also read stackshare post on algolia’s infra choices, it’s hard duty is search. But, there are choices that I have to make for my application, as I put above:

full-text search, get all products from a category or a collection or a seller, and doing these with current price & offer on each product

How do you suggest to get these done with frontend search only? Do you suggest to use algolia directly from frontend for full-text search only, and for other products fetching & pagination, go to my own backend (from there hit algolia, or query own MySQL DB to get those products)?

P.S. I had read it here in the docs on “why backend search” against criteria Real-time availability updates (like Airbnb). I took option 1 from there, i.e. Perform back-end search and use Instant Search on the front end.

Hi @manayantra,
I’ll follow up on François’s answer.

You say you want:

full-text search

Most examples we have provide a search box. it can also be simply removed in case you do not want it.

get all products from a category or a collection or a seller

It sounds like the MenuSelect will do what you need. Could you look at the live example we provide and confirm it behaves like you want?

with current price

Maybe the RangeSelector will help here?

1 Like

Hello @Youcef Thanks for such an elaborate response! Given your examples, I think I need to understand how to plug Algolia’s things with my custom UI with these connectors. (I want to click on a category or a collection name from my custom UI, and get all the products with all the facets. I will try these examples to see how easily could I do achieve these!)

Regarding that RangeSelector example, I think that’s not my question, I meant that Algolia index and my live DB updates might not be in sync, and for a price/time sensitive application, should the indexed data not come processed through my backend (like I mentioned algolia docs also suggest)?

Regarding that RangeSelector example, I think that’s not my question, I meant that Algolia index and my live DB updates might not be in sync, and for a price/time sensitive application, should the indexed data not come processed through my backend (like I mentioned algolia docs also suggest)?

I’m afraid it’s very tricky to achieve any kind of live data querying with Algolia. Most probably you’ll need a realtime database such as Firebase. I’ll let your read our docs explaining how to leverage them both:


I hope this helps

@Youcef Oh, I don’t understand this then. I don’t want to stretch my confusion, but then how do you suggest to use algolia in a marketplace setting (pricing is a sensitive part w.r.t. time, but it certainly is not realtime). I am confused given that the docs suggest exactly that to a case like mine, search algolia from my backend, and I understand that you are suggesting against it. [Firebase is not an option with me, sorry :slight_smile: ]

I think I basically have to do this part from my backend “Ongoing live sync to Algolia”, I will use subscriptions from my graphql server to sync price updates; and then query flows from RN app to my server to algolia API. Should this be fine?