Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I use one index or multiple ones in Algolia?

I'm building a product search widget that e-commerce clients integrate into their website. Let's say I have 100 clients with 1000 products each.

Visitors on a particular client's website are only able to search for that client's products.

Given that products share the exact same attributes (id, name, price, etc...) across clients:

Should I use a separate index for each client, or one index to store all clients' products and somehow associate each product with a client?

Thanks in advance.

like image 449
dneumark Avatar asked Jan 04 '23 12:01

dneumark


1 Answers

I would strongly recommend you to create a separate index for each client, since it allows you to have

  • different index configuration if needed (typo-tolerance, synonyms)
  • separated analytics
  • the possibility of creating a different a API key each index (see doc)

Which is not the case if you go with the other approach.

like image 190
Alex C Avatar answered Jan 13 '23 09:01

Alex C