[英]Elasticsearch. Is it possible to set mapping for field in index for all types?
An Elasticsearch cluster can contain multiple Indices (databases), which in turn contain multiple Types (tables). Elasticsearch集群可以包含多个索引(数据库),而这些索引又包含多个类型(表)。 Is it possible to set mapping for field in index for all types?
是否可以为所有类型的索引中的字段设置映射?
Use the _default_ mapping setting on the Index. 在索引上使用_default_ mapping设置。 When the type is created it will have the field mapping your looking for.
创建类型后,它将显示您要查找的字段。
PUT /my_index{
"mappings": {
"_default_": {
"properties": {
"field1": {
"type": "string",
"index": "analyzed"
}
}
}
}
You could also use an Index Template , if you wanted all new indexes to have this default setting. 如果希望所有新索引都具有此默认设置,也可以使用索引模板 。 I think it would be a good enhancement to have a Dynamic Templates be available at Index Level so they can be applied across types.
我认为在索引级别提供动态模板是一个很好的增强,因此它们可以跨类型应用。 This doesn't appear possible now.
现在这似乎不可能。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.