0
ElasticSearch版本:0.90.1,JVM:1.6.0_51(20.51-b01-457)ElasticSearch排序忽略
我试图做两件事情与我ElasticSearch查询:1)根据筛选结果一个布尔(搜索)和“open_date明天<” 2)两个排序字段“open_date” DESC
这将产生以下查询:
{
"query": {
"bool": {
"should": [
{
"prefix": {
"name": "foobar"
}
},
{
"query_string": {
"query": "foobar"
}
},
{
"match": {
"name": {
"query": "foobar"
}
}
}
],
"minimum_number_should_match": 1
},
"filtered": {
"filter": {
"and": [
{
"term": {
"searchable": true
}
},
{
"range": {
"open_date": {
"lt": "2013-07-16"
}
}
}
]
}
}
},
"sort": [
{
"open_date": "desc"
}
]
}
不过,回来的结果是不按“open_date”排序。如果我删除了过滤器:
{
"query": {
"bool": {
"should": [
{
"prefix": {
"name": "foobar"
}
},
{
"query_string": {
"query": "foobar"
}
},
{
"match": {
"name": {
"query": "foobar"
}
}
}
],
"minimum_number_should_match": 1
}
},
"sort": [
{
"open_date": "desc"
}
]
}
...结果按预期恢复。
任何想法?