# Elastcisearch Hadoop customized index mapping?

**URL:** <https://discuss.elastic.co/t/elastcisearch-hadoop-customized-index-mapping/130691>\
**Category:** Elasticsearch\
**Tags:** es-hadoop\
**Created:** [May 4, 2018, 11:13pm UTC](https://discuss.elastic.co/t/elastcisearch-hadoop-customized-index-mapping/130691 "2018-05-04T23:13:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![camelliazhang2018](https://avatars.discourse-cdn.com/v4/letter/c/258eb7/32.png) [@camelliazhang2018](https://discuss.elastic.co/u/camelliazhang2018)\
**Post date:** [May 4, 2018, 11:13pm UTC](https://discuss.elastic.co/t/elastcisearch-hadoop-customized-index-mapping/130691/1 "2018-05-04T23:13:46Z")

</div>

Is there a way that I can create an index mapping (with customized analyzer for different fields) directly in pig using elasticsearch-hadoop? Or do I have to pre-define the mappings?  
I am thinking if it is possible to do something like 'es.mapping=XXX' where XXX is a json file with mapping info

STORE result INTO 'index/type' USING org.elasticsearch.hadoop.pig.EsStorage('es.input.json = true', 'es.nodes=$ES\_HOST' );

Any comments? Thanks for you help in advance!

---

<div class="post-metadata">

**Author:** ![james.baiera](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/james.baiera/32/10209_2.png) [@james.baiera](https://discuss.elastic.co/u/james.baiera)\
**Post date:** [May 30, 2018, 7:27pm UTC](https://discuss.elastic.co/t/elastcisearch-hadoop-customized-index-mapping/130691/2 "2018-05-30T19:27:02Z")

</div>

Unfortunately we do not have any way to define the ES mapping from within Pig or ES-Hadoop. The mapping must be already existing, or rely on something like an index template.

---

<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 27, 2018, 7:37pm UTC](https://discuss.elastic.co/t/elastcisearch-hadoop-customized-index-mapping/130691/3 "2018-06-27T19:37:30Z")

</div>

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