elasticsearch ElasticSearch术语自升级到ES 2.x后不再有效,elasticsearch,nest,elasticsearch,Nest" /> elasticsearch ElasticSearch术语自升级到ES 2.x后不再有效,elasticsearch,nest,elasticsearch,Nest" />

elasticsearch ElasticSearch术语自升级到ES 2.x后不再有效

elasticsearch ElasticSearch术语自升级到ES 2.x后不再有效,elasticsearch,nest,elasticsearch,Nest,以前使用ES 1.x,我可以这样构造我的嵌套查询: Nest.SearchDescriptor<object> query = new Nest.SearchDescriptor<object>() .Type("my_type") .Size(Int16.MaxValue) .Query(q => q.Terms("my_ID", my_list)); 我做错了什么?啊,我刚刚意识到名称就是给查询一个别名,查询构造应该是:Nest.Sea

以前使用ES 1.x,我可以这样构造我的嵌套查询:

Nest.SearchDescriptor<object> query = new Nest.SearchDescriptor<object>()
    .Type("my_type")
    .Size(Int16.MaxValue)
    .Query(q => q.Terms("my_ID", my_list));

我做错了什么?

啊,我刚刚意识到名称就是给查询一个别名,查询构造应该是:
Nest.SearchDescriptor query=new Nest.SearchDescriptor().Type(“my_Type”).Size(Int16.MaxValue).query(q=>q.Terms(t=>t.Field(“my_ID”).Terms(my_list))
名称
是给查询一个名称,
字段
是指定要在其上运行
术语
查询的字段的名称。请查看和以获取使用示例。如果不指定
字段
,则该查询将被视为无条件查询,并且不会作为查询的一部分序列化。我刚刚意识到,名称是按原样为查询提供别名,查询构造应为:
Nest.SearchDescriptor query=new Nest.SearchDescriptor().Type(“my_Type”).Size(Int16.MaxValue).Query(q=>q.Terms(t=>t.Field(“我的ID”).Terms(我的列表))
名称
是给查询一个名称,
字段
是指定要在其上运行
术语
查询的字段的名称。请查看和以获取使用示例。如果未指定
字段
,则该查询将被视为无条件查询,并且不会序列化为查询的一部分
Nest.SearchDescriptor<object> query = new Nest.SearchDescriptor<object>()
    .Type("my_type")
    .Size(Int16.MaxValue)
    .Query(q => q.Terms(t => t.Name("my_ID").Terms(my_list)));
{  "size": 32767  }