简体   繁体   English

Elasticsearch。 是否可以为所有类型的索引中的字段设置映射?

[英]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.

相关问题 如何查询和列出弹性搜索索引中的所有类型? - How to query and list all types within an elasticsearch index? Elasticsearch中的索引类型,性能原因 - Index Types in Elasticsearch, Performance Reasons 是否可以在 TypeScript 中的类型或接口内设置条件 - Is it possible to set conditions within types or interfaces in TypeScript 在Java中,如何获取所有可能的返回类型? - In Java, how to get all possible return types? Elasticsearch:有没有办法将对象字段的所有(可能是动态的)子字段声明为字符串? - Elasticsearch: is there a way to declare for all (possibly dynamic) subfields of an object field as string? 将数据构造函数映射到类型 - Mapping data constructors to types 将枚举值映射到类型 - Mapping enum values to types 如何在不迭代所有可能类型的情况下确定对象类型? - How to determine an objects type without iterating through all possible types? 是否可以将实现特征的所有类型存储在列表中并在该列表上进行迭代? - It is possible to store all types implementing a trait in a list and iterate over that list? SSIS-如何查看/设置记录集中的字段类型? - SSIS - How do I see/set the field types in a Recordset?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM