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

标签 elasticsearch

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

最佳答案

是的,您可以使用以下 dynamic template 来完成创建索引时:

PUT my_index
{
  "mappings": {
    "my_type": {
      "dynamic_templates": [
        {
          "nested": {
            "match_mapping_type": "object",
            "mapping": {
              "type": "nested"
            }
          }
        }
      ]
    }
  }
}

关于elasticsearch - 使 Elasticsearch 中的所有对象嵌套对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40198487/

相关文章:

c# - 使用 NEST 索引动态对象

python - 如何在python中为ElasticSearch创建只读客户端?

elasticsearch - 如何在 Elasticsearch 中过滤子索引以进行聚合?

elasticsearch - 在Elasticsearch中存储解析的数据之前,如何使用Logstash过滤数据

elasticsearch - 使用elasticsearch对完整字符串进行排序

elasticsearch - 空格和连字符的 Elastic Search 映射

elasticsearch - Elasticsearch 中的嵌套查询应应用于嵌套数组中的所有对象

elasticsearch - 在Elasticsearch上的单个查询中进行多重聚合

elasticsearch - Grok模式转义--(连字符)

elasticsearch - 检查文档是否存在于elasticsearch中