# Mapping \_id field from the fields specified

**URL:** <https://discuss.elastic.co/t/mapping-id-field-from-the-fields-specified/137009>\
**Category:** Elasticsearch\
**Created:** [June 22, 2018, 10:57am UTC](https://discuss.elastic.co/t/mapping-id-field-from-the-fields-specified/137009 "2018-06-22T10:57:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![saikiran](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/saikiran/32/31306_2.png) [@saikiran](https://discuss.elastic.co/u/saikiran)\
**Post date:** [June 22, 2018, 10:57am UTC](https://discuss.elastic.co/t/mapping-id-field-from-the-fields-specified/137009/1 "2018-06-22T10:57:16Z")

</div>

Let say i have a document with id field inside. When I submit the document to an index without id, it will generate id automatically.

Is there any possibility that it should take the inside id or any internal document field as \_id ?

Thanks.

---

<div class="post-metadata">

**Author:** ![thiago](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiago/32/32096_2.png) [@thiago](https://discuss.elastic.co/u/thiago)\
**Post date:** [June 24, 2018, 8:46pm UTC](https://discuss.elastic.co/t/mapping-id-field-from-the-fields-specified/137009/2 "2018-06-24T20:46:13Z")

</div>

That can only be done using [Ingest Node](https://www.elastic.co/guide/en/elasticsearch/reference/6.3/ingest.html) features. For instance, here is a [Set Processor](https://www.elastic.co/guide/en/elasticsearch/reference/current/set-processor.html) configuration that would read value for internal `id` and set it as document's `id`:

```json
{
  "set" : {
    "field" : "_id",
    "value" : "{{id}}"
  }
}

```

---

<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 22, 2018, 8:46pm UTC](https://discuss.elastic.co/t/mapping-id-field-from-the-fields-specified/137009/3 "2018-07-22T20:46:17Z")

</div>

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