# Running percolate query against document date value

**URL:** <https://discuss.elastic.co/t/running-percolate-query-against-document-date-value/324950>\
**Category:** Elasticsearch\
**Created:** [February 8, 2023, 1:49am UTC](https://discuss.elastic.co/t/running-percolate-query-against-document-date-value/324950 "2023-02-08T01:49:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matthew\_Greenfield](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matthew_greenfield/32/116908_2.png) [@Matthew\_Greenfield](https://discuss.elastic.co/u/Matthew_Greenfield)\
**Post date:** [February 8, 2023, 1:49am UTC](https://discuss.elastic.co/t/running-percolate-query-against-document-date-value/324950/1 "2023-02-08T01:49:04Z")

</div>

I have a query that checks to see if a date is more than a year old with something like:

```auto
"range": {
  "some_date": {
    "gt": "now-1y"
  }
}

```

But I need to also figure out if that document WILL BE more than a year old on some other date.

Is it possible to dynamically change the `now` value or something similar? Or do I need to replace `now` with something like `doc['passed_in_date']-1y`?

Every attempt I've tried has yielded something like `failed to parse date field [doc['passed_in_date']]`

I'm very new to Elasticsearch. Thanks for your help.

---

<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:** [March 8, 2023, 1:49am UTC](https://discuss.elastic.co/t/running-percolate-query-against-document-date-value/324950/2 "2023-03-08T01:49:13Z")

</div>

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