简体   繁体   English

ElasticSearch在单个索引中具有相同映射的多种类型

[英]ElasticSearch multiple types with same mapping in single index

I am designing an e-Commerce site with multiple warehouse. 我正在设计一个具有多个仓库的电子商务站点。 All the warehouses have same set of products. 所有仓库都有相同的产品集。 I am using ElasticSearch for my search engine. 我在为搜索引擎使用ElasticSearch。 There are 40 fields each ES document. 每个ES文档有40个字段。 20 out of them will differ in value per warehouse, rest 20 fields will contain same values for all warehouses. 每个仓库的价值中有20个会有所不同,其余20个字段将对所有仓库包含相同的价值。

I want to use multiple types (1 type for each warehouse) in 1 index. 我想在1个索引中使用多种类型(每个仓库1种类型)。 All of the types will have same mappings . 所有类型都将具有相同的映射 Please advise if my approach is correct for such scenario. 请告知我的方法在这种情况下是否正确。

Few things not clear to me, 很少有我不清楚的事情,

  1. Will the inverted index be created only once for all types in same index? 是否会对同一索引中的所有类型仅创建一次反向索引?
  2. If new type (new warehouse) is added in future how it will be merged with the previously stored data. 如果将来添加了新类型(新仓库),它将如何与以前存储的数据合并。
  3. How it will impact the query time if I would have used only one type in one index. 如果我只在一个索引中使用一种类型,它将如何影响查询时间。
  1. Depending on all types being assigned to the same index, it will only created once and 根据分配给同一索引的所有类型,它只会创建一次,然后
  2. If a new type is added, its information is added to the existing inverted index as well - adding new terms to the index, adding pointers to existing terms in the index, adding data to doc values per new inserted document. 如果添加了新类型,则其信息也会添加到现有的反向索引中-向索引添加新术语,向索引中现有术语添加指针,为每个新插入的文档的doc值添加数据。
  3. I honestly can't answer that one, though it is simple to test this in a proof of concept. 老实说,我不能回答这个问题,尽管在概念证明中对此进行测试很简单。

In my previous project, I experienced the same setting implementing a search engine with Elasticsearch on a multishop-platform. 在我之前的项目中,我经历了与在multishop平台上使用Elasticsearch实施搜索引擎相同的设置。 In that case we had all shops in one type and when searching per shop relevant filters were applied. 在这种情况下,我们所有商店都是一种类型,并且在按商店搜索时会应用相关过滤器。 Though, the approach to separate shop-data by "_type" seems pretty clean to me. 虽然,用“ _type”分隔车间数据的方法对我来说似乎很干净。 We applied it the other way, since my implementation was already able to cover it by filters at the moment of the feature request. 我们以另一种方式应用了它,因为我的实现已经能够在功能请求时通过过滤器将其覆盖。

Cheers, Dominik 干杯,多米尼克

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

相关问题 elasticsearch:单个索引中的多种类型 - elasticsearch: multiple types in a single index 在相同索引中对多种类型进行Elasticsearch分页 - Elasticsearch pagination on multiple types in same index ElasticSearch:同一索引中多种类型的性能影响 - ElasticSearch: Performance Implications of Multiple Types in the same Index elasticsearch字段映射会影响同一索引中的不同类型 - elasticsearch field mapping affects acorss different types in same index 具有稀疏字段的单个_type是否对索引具有与多种类型(在ElasticSearch中)相同的索引? - Does a single _type with sparse fields have the same effect on the index as multiple types (in ElasticSearch)? 在ElasticSearch中,我必须创建单个索引和多个类型还是使用单个类型的多个索引? - In ElasticSearch i have to create single index and multiple types or multiple index with single types? 如何聚合来自相同索引但来自多种类型的ElasticSearch文档? - How to aggregate ElasticSearch documents from same index but from multiple types? Elasticsearch映射 - 同一字段中的不同数据类型 - Elasticsearch mapping - different data types in same field Elasticsearch 映射 - 同一字段中的不同类型的数据 - Elasticsearch mapping - Different types of data in same field 弹性搜索创建多个索引/类型 - nutch with elasticsearch creating multiple index/types
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM