class customer { public int id { get; set; } public string name { get; set;} public class Orders { public int id { get; set;} public string orderData { get; set;} public class OrderLines { public int seqno { get; set; } public int quantity { get; set; } public int articleId { get; set; } } [ElasticProperty(Type = FieldType.Nested)] public List<OrderLines> orderLines { get; set; } } [ElasticProperty(Type = FieldType.Nested)] public List<Orders> orders { get; set; } };
在上述情况下的查询为:
var response = client.Search<customer>( s => s.Index(<index_name_here>).Type("customer") .Query(q => q.Term(p=>p.id, 1) && q.Nested(n => n.Path("orders") .Query(q2=> q2.Nested( n2 => n2.Path("orders.orderLines") .Query(q3 => q3.Term(c=>c.orders.First().orderLines.First().articleId, <article_id_here>))))) ));
就文档而言,我遇到的最好的事情与您在问题中发布的内容以及链接到该问题的资源相同。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)