映射像这样的DTO时
public class InnerDto
{
public string Uno { get; set;}
public string Dos { get; set; }
}
public class OuterDto
{
public string One { get; set; }
public string Two {get; set; }
public InnerDto Three {get; set; }
}
如果我尝试使用elasticClient检索映射,例如:
Client.GetMapping<OuterDto>(s => s.Index("test2"));
客户端返回的映射缺少我的“Three”属性(属于“复杂”类型的属性)。
查看ElasticSearch响应,返回数据。我错过了GetMapping调用中的任何选项?
编辑1: GET test2 / _mapping
的响应{
"test2" : {
"mappings" : {
"outerdto" : {
"properties" : {
"one" : {
"type" : "string"
},
"three" : {
"properties" : {
"dos" : {
"type" : "string"
},
"uno" : {
"type" : "string"
}
}
},
"two" : {
"type" : "string"
}
}
}
}
}
}