使弹性搜索中的所有对象嵌套对象

Riz*_*Riz 3 elasticsearch

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

Val*_*Val 5

是的,您可以在创建索引时使用以下动态模板来实现:

PUT my_index
{
  "mappings": {
    "my_type": {
      "dynamic_templates": [
        {
          "nested": {
            "match_mapping_type": "object",
            "mapping": {
              "type": "nested"
            }
          }
        }
      ]
    }
  }
}
Run Code Online (Sandbox Code Playgroud)