elasticsearch nest 数组包含查询
// es 查询语句
GET index1/order/_search
{
"query": {
"bool": {
"must": [
{
"range": {
"date": {
"gte": "2015-01-01T00:00:00.000",
"lte": "2016-01-01T00:00:00.000"
}
}
},
{
"bool": {
"should": [
{
"terms": {
"phone": [
"iphone4",
"vivo",
"huawei phone"
]
}
}
]
}
}
]
}
}
}
// nest 对应语句
client.Search<order>
(s => s
.From(0)
.Size(10)
.Query(q =>q.Filtered(p=>p.Query(t=>t
.Bool(q1=>q1
.Should(h=>h
.Terms(oq=>oq
.Order, ["iphon4","vivo","huawei"])
))
));
测试有效
定,精,简,俭