简体   繁体   English

在Elasticsearch中创建多个索引

[英]creation of multiple index in Elasticsearch

I was reading the document and happened to read the multiple index creation and ability to search on multiple indexes and also its possible to search specific search in Elasticsearch. 我正在阅读文档,偶然发现了多索引的创建以及在多个索引上进行搜索的能力,并且还可以在Elasticsearch中搜索特定的搜索。

For example i have two index like releasedArea and WorkArea. 例如,我有两个索引,例如releaseArea和WorkArea。 am i can search by giving http://localhost:9200/_search?pretty=true which will search in all index 我可以通过提供http:// localhost:9200 / _search?pretty = true进行搜索 ,它将在所有索引中进行搜索

and i can specifically search like http://localhost:9200/releasedArea,WorkArea/_search?pretty=true . 我可以专门搜索像http:// localhost:9200 / releasedArea,WorkArea / _search?pretty = true

So i think this specification will improve in terms of performance, if already knows where to search. 因此,我认为如果已经知道在哪里搜索,此规范将在性能方面有所改进。 if we don't know, where to search it should search in all index. 如果我们不知道,在哪里搜索应该在所有索引中搜索。

Could you please tell me, am i correct? 你能告诉我,我正确吗? else please let me know, what could be the reason. 否则请让我知道,可能是什么原因。

Your understanding is correct. 您的理解是正确的。 If you do not provide any index name, then it will search in all indices and of course this might hit search performance. 如果您不提供任何索引名称,则它将在所有索引中搜索,当然这可能会影响搜索性能。 If you know which index to search, you should specify it explicitly while using Search APIs . 如果您知道要搜索哪个索引,则应在使用Search API时显式指定它。

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

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