# Elasticsearch hadoop, dynamically decide index name too (not just type name), is it possible?

**URL:** <https://discuss.elastic.co/t/elasticsearch-hadoop-dynamically-decide-index-name-too-not-just-type-name-is-it-possible/19741>\
**Category:** Elasticsearch\
**Created:** [September 11, 2014, 6:56pm UTC](https://discuss.elastic.co/t/elasticsearch-hadoop-dynamically-decide-index-name-too-not-just-type-name-is-it-possible/19741 "2014-09-11T18:56:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jinyuan\_Zhou](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jinyuan_zhou/32/90185_2.png) [@Jinyuan\_Zhou](https://discuss.elastic.co/u/Jinyuan_Zhou)\
**Post date:** [September 11, 2014, 6:56pm UTC](https://discuss.elastic.co/t/elasticsearch-hadoop-dynamically-decide-index-name-too-not-just-type-name-is-it-possible/19741/1 "2014-09-11T18:56:11Z")

</div>

I saw hadoop documentation regarding setting up index for a mapreduce job  
to EsOutuputFormat. Below is a part regarding dynamically decide the  
document type.  
([http://www.elasticsearch.org/guide/en/elasticsearch/hadoop/current/mapreduce.html](http://www.elasticsearch.org/guide/en/elasticsearch/hadoop/current/mapreduce.html)).  
My question is is it possible to parameterize the "my-collection"?  
Thanks,  
Jack  
writing to dynamic/multi-resourcesedit  
[https://github.com/elasticsearch/elasticsearch-hadoop/edit/2.0/docs/src/reference/asciidoc/core/mr.adoc](https://github.com/elasticsearch/elasticsearch-hadoop/edit/2.0/docs/src/reference/asciidoc/core/mr.adoc)

As expected, the difference between the old and new API are minimal (to be  
read non-existing) in this case as well:

Configuration conf = new Configuration();  
conf.set("es.resource.write","my-collection/{media-type}");  
...

--  
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/3270d2e8-8bbb-4bd0-b10a-f889e4cbc61a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3270d2e8-8bbb-4bd0-b10a-f889e4cbc61a%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![costin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/costin/32/44950_2.png) [@costin](https://discuss.elastic.co/u/costin)\
**Post date:** [September 11, 2014, 8:56pm UTC](https://discuss.elastic.co/t/elasticsearch-hadoop-dynamically-decide-index-name-too-not-just-type-name-is-it-possible/19741/2 "2014-09-11T20:56:21Z")

</div>

Yes, simply use a different pattern - {my-index-pattern}/{my-type}-foobar

On 9/11/14 9:56 PM, Jinyuan Zhou wrote:

> I saw hadoop documentation regarding setting up index for a mapreduce job to EsOutuputFormat. Below is a part regarding  
> dynamically decide the document type.  
> ([Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/hadoop/current/mapreduce.html)). My question is is it possible to  
> parameterize the "my-collection"?  
> Thanks,  
> Jack
> 
> ```
> writing to dynamic/multi-resourcesedit
> <https://github.com/elasticsearch/elasticsearch-hadoop/edit/2.0/docs/src/reference/asciidoc/core/mr.adoc>
> 
> ```
> 
> As expected, the difference between the |old| and |new| API are minimal (to be read non-existing) in this case as well:
> 
> Configuration conf= new Configuration();  
> conf.set("es.resource.write","my-collection/{media-type}");  
> ...
> 
> --  
> 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) [mailto:elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/3270d2e8-8bbb-4bd0-b10a-f889e4cbc61a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3270d2e8-8bbb-4bd0-b10a-f889e4cbc61a%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/3270d2e8-8bbb-4bd0-b10a-f889e4cbc61a%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/3270d2e8-8bbb-4bd0-b10a-f889e4cbc61a%40googlegroups.com?utm_medium=email&utm_source=footer).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
Costin

--  
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/54120C75.8060509%40gmail.com](https://groups.google.com/d/msgid/elasticsearch/54120C75.8060509%40gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Jinyuan\_Zhou](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jinyuan_zhou/32/90185_2.png) [@Jinyuan\_Zhou](https://discuss.elastic.co/u/Jinyuan_Zhou)\
**Post date:** [September 11, 2014, 9:39pm UTC](https://discuss.elastic.co/t/elasticsearch-hadoop-dynamically-decide-index-name-too-not-just-type-name-is-it-possible/19741/3 "2014-09-11T21:39:26Z")

</div>

This is great. Thanks,

Jinyuan (Jack) Zhou

On Thu, Sep 11, 2014 at 1:56 PM, Costin Leau [costin.leau@gmail.com](mailto:costin.leau@gmail.com) wrote:

> Yes, simply use a different pattern - {my-index-pattern}/{my-type}-foobar
> 
> On 9/11/14 9:56 PM, Jinyuan Zhou wrote:
> 
> > I saw hadoop documentation regarding setting up index for a mapreduce job  
> > to EsOutuputFormat. Below is a part regarding  
> > dynamically decide the document type.  
> > ([Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/hadoop/)  
> > current/mapreduce.html). My question is is it possible to  
> > parameterize the "my-collection"?  
> > Thanks,  
> > Jack
> > 
> > ```
> > writing to dynamic/multi-resourcesedit
> > <https://github.com/elasticsearch/elasticsearch-
> > 
> > ```
> > 
> > hadoop/edit/2.0/docs/src/reference/asciidoc/core/mr.adoc\>
> > 
> > As expected, the difference between the |old| and |new| API are minimal  
> > (to be read non-existing) in this case as well:
> > 
> > Configuration conf= new Configuration();  
> > conf.set("es.resource.write","my-collection/{media-type}");  
> > ...
> > 
> > --  
> > 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) \<mailto:elasticsearch+  
> > [unsubscribe@googlegroups.com](mailto:unsubscribe@googlegroups.com)\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/3270d2e8-](https://groups.google.com/d/msgid/elasticsearch/3270d2e8-)  
> > 8bbb-4bd0-b10a-f889e4cbc61a%[40googlegroups.com](http://40googlegroups.com)  
> > \<[https://groups.google.com/d/msgid/elasticsearch/3270d2e8-](https://groups.google.com/d/msgid/elasticsearch/3270d2e8-)  
> > 8bbb-4bd0-b10a-f889e4cbc61a%[40GGGROUPS CASINO – Real Slot Casino for 10,000+ Senior Players](http://40googlegroups.com?utm_medium=)  
> > email&utm\_source=footer\>.  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> Costin
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> topic/elasticsearch/WkXHVSPZMsI/unsubscribe.  
> To unsubscribe from this group and all its topics, 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/](https://groups.google.com/d/)  
> msgid/elasticsearch/54120C75.8060509%[40gmail.com](http://40gmail.com).
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/CANBTPCG\_70h-CZ1R2k9z4BjPkPWbnkiuSch6Z63L-3AJUUxKFA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CANBTPCG_70h-CZ1R2k9z4BjPkPWbnkiuSch6Z63L-3AJUUxKFA%40mail.gmail.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, 1:02am UTC](https://discuss.elastic.co/t/elasticsearch-hadoop-dynamically-decide-index-name-too-not-just-type-name-is-it-possible/19741/4 "2017-07-06T01:02:59Z")

</div>


