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

后端 未结 2 1426
闹比i
闹比i 2021-02-07 21:04

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 b

相关标签:
2条回答
  • 2021-02-07 21:42

    I was recently modeling a ElasticSearch backend from scratch and from my point of view, the best option is putting all related documents types in the same index.

    I read that some people had problems with too many concurrent indexes (1 index per type). It's better for performance and robustness to unify related types in the same index.

    Besides, if the types are in the same index you can use "_parent" field to create hierarquical models that allow to you interesting features for search as "has_child" and "has_parent" and of course you have not to duplicate data in your model.

    0 讨论(0)
  • 2021-02-07 21:48

    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

    0 讨论(0)
提交回复
热议问题