Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In ElasticSearch, should I use multiple indexes for separate but related entities?

The overhead of adding indexes is well-documented, but I have not been able to find good information on when to use multiple indexes with regards to the various document types being indexed.

Here is a generic example to illustrate the question:

Say we have the following entities

  • Products (Name, ProductID, ProductCategoryID, List-of-Stores)
  • Product Categories (Name, ProductCategoryID)
  • Stores (Name, StoreID)

Should I dump these three different types of documents into a single index, each with the appropriate elasticsearch type?

I am having difficulty establishing where to the draw the line on one vs. multiple indexes.

What if we add an unrelated entity, "Webpages". Definitely a separate index?

like image 466
Brian Webster Avatar asked Jan 08 '13 17:01

Brian Webster


1 Answers

A very interesting video explaining elasticsearch "Data Design Patterns" by Shay Banon:

http://vimeo.com/44716955

This exact question is answered at 13:40 where examining different data flows, by looking at the concepts of Type, Filter and Routing

Regards

like image 187
uris Avatar answered Oct 02 '22 16:10

uris