【发布时间】:2015-11-26 18:01:16
【问题描述】:
我正在尝试向现有嵌套文档添加新属性。我的文档如下所示:
"mappings": {
"test": {
"_routing": {
"required": true,
"path": "tId"
},
"properties": {
"series": {
"type": "nested",
"properties": {
"iType": {
"type": "string",
"index": "not_analyzed",
"doc_values": true
},
"isValid": {
"type": "boolean"
},
},
},
}
}
我要插入到嵌套文档“系列”的属性是“iType”。 如何使用 NEST put mapping API 更新现有映射?
任何帮助将不胜感激。
提前致谢。
#####*****已更新*****##########
我需要用属性更新嵌套元素的映射:
"iType": {
"type": "string",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed",
"doc_values": true,
"fielddata": {
"loading": "eager_global_ordinals"
}
}
}
},
我如何用 NEST 做到这一点?
我的查询如下:
var response2 = elasticClient.Map < Test > (e => e
.Properties(props => props
.NestedObject < series > (s => s
.Properties(sprops => sprops
.String(n => n.Name(name => "iType"))))));
我得到一个异常:无法获取嵌套 sobject 映射的字段名称 查询中需要更正吗?
【问题讨论】:
标签: elasticsearch nest