One index vs multiple indicies

There is a CMS I am looking to integrate Algolia into, which may run multiple sites at once.

Does it make sense to have all site’s data objects in one index, but separate them using an attribute in all objects (site_id), or to just create an index for each site?

Hi @jayden.tavares,

Thanks for contacting Algolia!

It depends because indeed, depending on your use case, both may be useful.

However, in general, we recommend one index per data type, which in your case might be per site.

The benefit of separate indices per data type include:

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

You would really only merge different data types into the same index if there was a common attribute that you could use to compare them for relative ranking.

Hope this helps!

1 Like

Hello @ajay.david,

I was thinking of doing one index per site, regardless of data type, but your answer is against this.

Say, an ecommerce site has a products index and a people index. But in my case, these indices will be merged into one index, and separated using a common attribute (sub_index). What are your thoughts on this, besides the above benefits?

One more thing, I know Algolia API has capabilities to search multiple indices at once, so say I wanted to see how many objects contain the word “banana” from all sites.

Would there be a performance difference between searching (1 index with 10000 objects) vs (10 indices with 1000 objects each)?

Thank you again,