# Choosing between mapper or ingest plugin

**URL:** <https://discuss.elastic.co/t/choosing-between-mapper-or-ingest-plugin/86053>\
**Category:** Elasticsearch\
**Created:** [May 17, 2017, 7:09am UTC](https://discuss.elastic.co/t/choosing-between-mapper-or-ingest-plugin/86053 "2017-05-17T07:09:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ambha\_Anandarama](https://avatars.discourse-cdn.com/v4/letter/a/9de053/32.png) [@Ambha\_Anandarama](https://discuss.elastic.co/u/Ambha_Anandarama)\
**Post date:** [May 17, 2017, 7:09am UTC](https://discuss.elastic.co/t/choosing-between-mapper-or-ingest-plugin/86053/1 "2017-05-17T07:09:53Z")

</div>

I need to create a new datatype which should be used inside a dynamic template and also while indexing, the value stored against the new type should be processed based on my custom logic.

Should I create mapper plugin or ingest plugin or both?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 17, 2017, 7:28am UTC](https://discuss.elastic.co/t/choosing-between-mapper-or-ingest-plugin/86053/2 "2017-05-17T07:28:45Z")

</div>

If you want to modify the `_source` document on the fly **before** it gets indexed, then definitely use an ingest plugin.

If you don't want to change the `_source` field, then look at mappers.

But I'd recommend using ingest.

---

<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:** [June 14, 2017, 7:29am UTC](https://discuss.elastic.co/t/choosing-between-mapper-or-ingest-plugin/86053/3 "2017-06-14T07:29:37Z")

</div>

Closed on June 14, 2017, 7:29am UTC

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