# ElasticSearch issue with combining range and text query

**URL:** <https://discuss.elastic.co/t/elasticsearch-issue-with-combining-range-and-text-query/8447>\
**Category:** Elasticsearch\
**Created:** [July 18, 2012, 1:17pm UTC](https://discuss.elastic.co/t/elasticsearch-issue-with-combining-range-and-text-query/8447 "2012-07-18T13:17:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![testcricket7](https://avatars.discourse-cdn.com/v4/letter/t/9d8465/32.png) [@testcricket7](https://discuss.elastic.co/u/testcricket7)\
**Post date:** [July 18, 2012, 1:17pm UTC](https://discuss.elastic.co/t/elasticsearch-issue-with-combining-range-and-text-query/8447/1 "2012-07-18T13:17:56Z")

</div>

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](http://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"} }]  
}

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:19am UTC](https://discuss.elastic.co/t/elasticsearch-issue-with-combining-range-and-text-query/8447/2 "2017-07-06T03:19:57Z")

</div>

Closed on July 6, 2017, 3:19am UTC


