# \_reindex call - Access current object in destination

**URL:** <https://discuss.elastic.co/t/reindex-call-access-current-object-in-destination/245527>\
**Category:** Elasticsearch\
**Created:** [August 19, 2020, 6:19am UTC](https://discuss.elastic.co/t/reindex-call-access-current-object-in-destination/245527 "2020-08-19T06:19:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anitabee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anitabee/32/73727_2.png) [@anitabee](https://discuss.elastic.co/u/anitabee)\
**Post date:** [August 19, 2020, 6:19am UTC](https://discuss.elastic.co/t/reindex-call-access-current-object-in-destination/245527/1 "2020-08-19T06:19:44Z")

</div>

Hi,

During reindex call is it possible to access current object in destination that is going to be overridden?

What I'm trying to achieve is this:

```auto
POST _reindex
{
  "source": {
    "remote": {
      "host": "https://example.com:443"
    },
    "index": ["index-2019.03.30", "index-2019.03.27", "index-2019.03.28"],
    "query": {
      "match_all": {}
    }
  },
  "dest": {
    "index": "my-index-new"
  },
    "script": {
    "source": "if (ctx._source.timestamp < current_object_in_dest._source.timestamp) {ctx.op = 'noop'}",
    "lang": "painless"
  }
}

```

If no is there some other way to query destination from reindex script?

---

<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:** [September 16, 2020, 6:19am UTC](https://discuss.elastic.co/t/reindex-call-access-current-object-in-destination/245527/2 "2020-09-16T06:19:58Z")

</div>

Closed on September 16, 2020, 6:19am UTC

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