# Reindex api op\_type options

**URL:** <https://discuss.elastic.co/t/reindex-api-op-type-options/54304>\
**Category:** Elasticsearch\
**Created:** [June 29, 2016, 3:26pm UTC](https://discuss.elastic.co/t/reindex-api-op-type-options/54304 "2016-06-29T15:26:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![yehosef](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yehosef/32/42175_2.png) [@yehosef](https://discuss.elastic.co/u/yehosef)\
**Post date:** [June 29, 2016, 3:26pm UTC](https://discuss.elastic.co/t/reindex-api-op-type-options/54304/1 "2016-06-29T15:26:23Z")

</div>

In the docs for the reindex api ([https://www.elastic.co/guide/en/elasticsearch/reference/2.3/docs-reindex.html](https://www.elastic.co/guide/en/elasticsearch/reference/2.3/docs-reindex.html)) there is a reference to an option called "op\_type" which is always the "create" in the examples. Are there other options? if so, what are they?

thanks!

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [June 29, 2016, 4:58pm UTC](https://discuss.elastic.co/t/reindex-api-op-type-options/54304/2 "2016-06-29T16:58:59Z")

</div>

The default is actually "index". Reindex supports blindly bumping the documents version number (default), only changing the document if the source document's version number is higher (`version_type=external`) and only creating missing documents (`op_type=create`). This mirrors the index API which supports those three options with the same parameters. The index API requires you to send the `version` if using `version_type=external` but reindex handles that for you, piping the version of the matching document through.

The index API also supports `version_type=internal` **and** specifying a version which will bump the version of the document you are writing only if the version matches the one you send like traditional optimistic concurrency control. That is what update-by-query uses.

---

<div class="post-metadata">

**Author:** ![yehosef](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yehosef/32/42175_2.png) [@yehosef](https://discuss.elastic.co/u/yehosef)\
**Post date:** [June 29, 2016, 10:14pm UTC](https://discuss.elastic.co/t/reindex-api-op-type-options/54304/3 "2016-06-29T22:14:18Z")

</div>

ok - thanks!

---

<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 5, 2017, 10:39pm UTC](https://discuss.elastic.co/t/reindex-api-op-type-options/54304/4 "2017-07-05T22:39:29Z")

</div>


