# Providing index Id while indexing data from HDFS to elasticsearch Index

**URL:** <https://discuss.elastic.co/t/providing-index-id-while-indexing-data-from-hdfs-to-elasticsearch-index/22756>\
**Category:** Elasticsearch\
**Created:** [March 19, 2015, 10:49am UTC](https://discuss.elastic.co/t/providing-index-id-while-indexing-data-from-hdfs-to-elasticsearch-index/22756 "2015-03-19T10:49:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashit\_pupu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ashit_pupu/32/101113_2.png) [@ashit\_pupu](https://discuss.elastic.co/u/ashit_pupu)\
**Post date:** [March 19, 2015, 10:49am UTC](https://discuss.elastic.co/t/providing-index-id-while-indexing-data-from-hdfs-to-elasticsearch-index/22756/1 "2015-03-19T10:49:38Z")

</div>

Hi

I am trying to index data stored in HDFS to elasticsearch index. I am able  
to do it successfully . What my concern is currently the id provided for  
each document in index has a random generated alpha number. Is there any  
way by which we can assign the id field with a value which will be unique.  
Please let me know any solution available for it .

Currently this is how my code goes :-

JobConf conf = new JobConf();  
conf.set("es.nodes", "es-server:9200");  
conf.set("es.resource", "Index\_name/index\_type");  
conf.setOutputFormat(EsOutputFormat.class);

and it directly forms an index like as in the image attached.  
I have marked the id field with red marker.  
Please suggest any way .

Thanks  
ashit

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/74309af2-fd65-4fe4-b02d-c1bba832529c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/74309af2-fd65-4fe4-b02d-c1bba832529c%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 12:25am UTC](https://discuss.elastic.co/t/providing-index-id-while-indexing-data-from-hdfs-to-elasticsearch-index/22756/2 "2017-07-06T00:25:40Z")

</div>


