2017-10-09 120 views

回答

2

该查询类型为removed

因此,正如官方文档所述,在bool查询中使用filter option

client 
    .Search<YourDocumentType>(s => s 
     .Query(q => q 
      .Bool(descriptor => descriptor 
       .Filter(f => f.Term("fieldId", "term"))))); 

您还可以使用+运算符重写此查询。请看看wonderful NEST documentation

希望有所帮助。