# Simulate NOT IN select

**URL:** <https://discuss.elastic.co/t/simulate-not-in-select/87245>\
**Category:** Elasticsearch\
**Created:** [May 26, 2017, 10:57am UTC](https://discuss.elastic.co/t/simulate-not-in-select/87245 "2017-05-26T10:57:14Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [June 4, 2017, 8:13am UTC](https://discuss.elastic.co/t/simulate-not-in-select/87245/13 "2017-06-04T08:13:47Z")

</div>

I think you may need to do this through a [scripted update](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-update.html#_scripted_updates) as you want to set fields based on the content of the current document in the index, not just the one you are inserting. The Reindex API does however as far as I know not support scripted updates, so it may need to be done outside of Elasticsearch as outlined in [this post on entity-centric indices](https://discuss.elastic.co/t/reindex-api-aggregations/87790).

---

_[View the full topic](https://discuss.elastic.co/t/simulate-not-in-select/87245)._
