gpt4 book ai didi

c# - 检索映射时,嵌套忽略复杂属性

转载 作者:行者123 更新时间:2023-12-02 23:39:42 25 4
gpt4 key购买 nike

像这样映射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"
}
}
}
}
}
}

最佳答案

看来这是一个错误,已修复here。感谢您找到并指出这一点。

关于c# - 检索映射时,嵌套忽略复杂属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24557919/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com