我已经从 Sense 转向用 C# 编写查询。我遇到的问题是将两个查询或过滤器连接在一起。
从某种意义上说,我使用
"and":[
关于如何做到这一点的任何想法?
这是我正在尝试做的查询之一
{
"filtered" : {
"query" : {
"term" : { "name.first" : "shay" }
},
"filter" : {
"and" : [
{
"range" : {
"postDate" : {
"from" : "2010-03-01",
"to" : "2010-04-01"
}
}
},
{
"prefix" : { "name.second" : "ba" }
}
]
}
}
}
//试图//
filtered = new
{
query = new
{
term = new
{
name.first = "shay"
}
},
filter = new
{
and = ?
[ ?
{ ?
range = new
{
postDate = new
{
from = "2010-03-01",
to ="2010-04-01"
}
}
},
prefix = new
{
name.second = "ba"
}
]
}
};