使elasticsearch中的所有对象嵌套对象

2024-04-24

是否可以让elasticsearch中的所有嵌套对象自动映射到默认嵌套的类型。而不是对象?


是的,您可以使用以下方法来做到这一点动态模板 https://www.elastic.co/guide/en/elasticsearch/reference/current/dynamic-templates.html创建索引时:

PUT my_index
{
  "mappings": {
    "my_type": {
      "dynamic_templates": [
        {
          "nested": {
            "match_mapping_type": "object",
            "mapping": {
              "type": "nested"
            }
          }
        }
      ]
    }
  }
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

使elasticsearch中的所有对象嵌套对象 的相关文章

随机推荐