ElasticSearch issue with combining range and text query


(testcricket7) #1

I have this query with range, text and sort in it. When I use range with sort or text with sort it works but when I try to use all three together it throws an error:

"Parse failure: failed to parse source"

I am not sure why it's not working as the error is not very clear. I checked the JSON using jsonlint.com and it's valid. Can I not use a combination of text and range query?

{
"query" : {
"text" : {
"Content" : "fight"
},
"range" : {
"UpdateTime" : {
"from" : "20120601T000000",
"to" : "20120630T235959"
}
}
},
"sort" : [{ "UpdateTime" : {"order" : "desc"} }]
}


(system) #2