# Allowing range queries with now ranges inside percolator

**URL:** https://discuss.elastic.co/t/allowing-range-queries-with-now-ranges-inside-percolator/85696
**Category:** Elasticsearch
**Created:** [May 14, 2017, 11:04pm UTC](https://discuss.elastic.co/t/allowing-range-queries-with-now-ranges-inside-percolator/85696 "2017-05-14T23:04:41Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![EEEELIAS](https://avatars.discourse-cdn.com/v4/letter/e/85e7bf/32.png) [@EEEELIAS](https://discuss.elastic.co/u/EEEELIAS)
#### Post date: [May 14, 2017, 11:04pm UTC](https://discuss.elastic.co/t/allowing-range-queries-with-now-ranges-inside-percolator/85696/1 "2017-05-14T23:04:41Z")

</div>

If use now-7d/d in a percolator query in 5.4.0+ I get an error:

Caused by: java.lang.IllegalArgumentException: Percolator queries are not allowed to use the current timestamp  
at org.elasticsearch.index.IndexService.lambda$null$0(IndexService.java:149) ~[elasticsearch-5.4.0-SNAPSHOT.jar:5.4.0-SNAPSHOT]

I'm reading [https://github.com/elastic/elasticsearch/commit/7bc2477c1b939b4ab0a0dab79dc179a2ae51a8de](https://github.com/elastic/elasticsearch/commit/7bc2477c1b939b4ab0a0dab79dc179a2ae51a8de) and it says that they are now supported. I even built a fresh elasticsearch from source through gradle assemble and tried it there but no go.

Any suggestions?

---

<div class="post-metadata">

### Author: ![mvg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvg/32/98890_2.png) [@mvg](https://discuss.elastic.co/u/mvg)
#### Post date: [May 15, 2017, 5:16am UTC](https://discuss.elastic.co/t/allowing-range-queries-with-now-ranges-inside-percolator/85696/2 "2017-05-15T05:16:50Z")

</div>

@EEEELIAS Thank you for reporting this. I verified that range queries with `now` are still not working in the percolator. There is no workaround. I'll open a pr to fix this.

---

<div class="post-metadata">

### Author: ![EEEELIAS](https://avatars.discourse-cdn.com/v4/letter/e/85e7bf/32.png) [@EEEELIAS](https://discuss.elastic.co/u/EEEELIAS)
#### Post date: [May 15, 2017, 2:37pm UTC](https://discuss.elastic.co/t/allowing-range-queries-with-now-ranges-inside-percolator/85696/3 "2017-05-15T14:37:11Z")

</div>

Thanks! @mvg I pulled your branch and it's working! I guess this won't make it until 5.4.1 release so I will build an AMI with this deb I patched for now.

---

<div class="post-metadata">

### Author: ![mvg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvg/32/98890_2.png) [@mvg](https://discuss.elastic.co/u/mvg)
#### Post date: [May 16, 2017, 12:24pm UTC](https://discuss.elastic.co/t/allowing-range-queries-with-now-ranges-inside-percolator/85696/4 "2017-05-16T12:24:34Z")

</div>

@EEEELIAS Thanks for confirming that the fix actually works!

---

<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: [June 13, 2017, 12:27pm UTC](https://discuss.elastic.co/t/allowing-range-queries-with-now-ranges-inside-percolator/85696/5 "2017-06-13T12:27:09Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
