简体   繁体   English

elasticsearch性能搜索单个索引与多个索引

[英]elasticsearch performance searching single index vs multiple indices

i am working on API that searches in ElasticSearch. 我正在研究在ElasticSearch中搜索的API。 there are multiple index and i need to search for particular field in those indices. 有多个索引,我需要在那些索引中搜索特定字段。 Either i can search each index separately and aggregate the output or i can search all indices at once for that field. 我可以分别搜索每个索引并汇总输出,也可以一次搜索该字段的所有索引。 i am more inclined to search all indices at once as that would make API simpler. 我更倾向于一次搜索所有索引,因为这会使API更简单。

I am not able to figure out what would be the performance degradation if search all indices at once. 我无法弄清楚如果一次搜索所有索引会导致性能下降。 any one who has done performance test on similar lines, can you please provide feedback or any link to resource which explain about performance would be great 任何在相似的方面进行过性能测试的人,能否请您提供反馈或任何有关性能的解释的资源链接,

The single search sounds more efficient to me. 单一搜索对我来说听起来更有效率。 Keep in mind that indices in Elasticsearch are just an abstract container. 请记住,Elasticsearch中的索引只是一个抽象容器。 The real important part are the number of shards that you searching in. 真正重要的部分是您要搜索的分片数量。

For Elasticsearch there is no difference if you search in a single index that has 100 shards or if you search in ten indices that have each ten shards. 对于Elasticsearch,如果您在具有100个分片的单个索引中进行搜索,或者在每个具有十个分片的十个索引中进行搜索,则没有任何区别。 The amount of work that needs to be done, is exactly the same. 需要完成的工作量完全相同。

Hope that helps! 希望有帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM