首页 > 解决方案 > 在 ElasticSearch 文档中将 NonNested 属性更新为嵌套类型

问题描述

我们正在弹性搜索索引中创建一个动态对象。在创建时,我们没有此对象的映射,因此使用nonnested下面提到的类型创建对象。

"categoriesScore": {
    "properties": {
          "score": {
             "type": "float"
           },
          "categoryName": {
             "type": "text",
             "fields": {
                 "keyword": {
                      "ignore_above": 256,
                      "type": "keyword"
                  }
              }
           },
           "categoryId": {
                  "type": "long"
           }
   }
},

所以我们需要nested为某个nonnested对象更新属性类型。

我们尝试了下面的代码

await _client.MapAsync<DocumentEntity> (c => c.Index(_index).Type(_type)).ConfigureAwait (false);

我们需要 NEST 查询,以便我们可以将类型更新nonnestednested类型文档

标签: elasticsearch

解决方案


推荐阅读