elasticsearch 嵌套elasticsearch嵌套属性的映射不正确,elasticsearch,nest,elasticsearch,Nest" /> elasticsearch 嵌套elasticsearch嵌套属性的映射不正确,elasticsearch,nest,elasticsearch,Nest" />

elasticsearch 嵌套elasticsearch嵌套属性的映射不正确

elasticsearch 嵌套elasticsearch嵌套属性的映射不正确,elasticsearch,nest,elasticsearch,Nest,我有一个插入弹性搜索数据库的类型 public class Capture { public Guid Id { get; set; } ... [ElasticProperty(Type = FieldType.Nested)] public IList<CustomerInformation> CustomerInformations { get; set; } } 公共类捕获 { 公共Guid Id{get;set;} ... [Elast

我有一个插入弹性搜索数据库的类型

public class Capture
{

    public Guid Id { get; set; }
    ...
    [ElasticProperty(Type = FieldType.Nested)]
    public IList<CustomerInformation> CustomerInformations { get; set; }

}
公共类捕获
{
公共Guid Id{get;set;}
...
[ElasticProperty(类型=FieldType.Nested)]
公共IList CustomerInformation{get;set;}
}
但是当我做一个

var mapping=client.GetMapping<Capture>(o => o.Index("captures").Type("capture"));
var-mapping=client.GetMapping(o=>o.Index(“捕获”).Type(“捕获”);

customerinformations属性的映射仍然是对象,而不是嵌套的。为什么会这样?我甚至删除了索引并重新创建了它,但这并不能解决任何问题。

几天前,我们有一个类似的错误报告,被打开它的人关闭了。你也可以发布你用来映射
捕获
的代码吗?@MartijnLaarman我是弹性搜索新手,所以我可能做错了。。。你是什么意思?据我所知,映射是通过设置属性自动处理的,不是吗?不,在执行第一个索引操作之前,您需要调用
.Map()
,请参见nest无法推断它必须在每个单独的index()调用上更新映射,因为这将产生太大的开销。