# Automatic index creation using java API

**URL:** <https://discuss.elastic.co/t/automatic-index-creation-using-java-api/36000>\
**Category:** Elasticsearch\
**Created:** [December 1, 2015, 8:05am UTC](https://discuss.elastic.co/t/automatic-index-creation-using-java-api/36000 "2015-12-01T08:05:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Phani\_Nadiminti](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/phani_nadiminti/32/45381_2.png) [@Phani\_Nadiminti](https://discuss.elastic.co/u/Phani_Nadiminti)\
**Post date:** [December 1, 2015, 8:05am UTC](https://discuss.elastic.co/t/automatic-index-creation-using-java-api/36000/1 "2015-12-01T08:05:43Z")

</div>

Hi All,

I am creating monthly index to push my documents this creation has been implemented automatically by java API.Recently i have observed attribute norms added to my not\_analyzed fields automatically when index is creating. The previous month index creation is fine but this attribute is automatically added to my index schema this month.

```
"norms": {
    "enabled": false
}

```

Due to this i am unable to operate filter query on term search. it is showing null result even tough we have data.i read norms attribute will helpful in scoring.

so is this be possible when we are creating index with predefined constant schema can these norms attribute add automatically by ES or what might be the cause of this attribute adding and why my term search not working on this norms field.  
please help me out.

Thanks,  
phani

---

<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:** [December 1, 2015, 8:25am UTC](https://discuss.elastic.co/t/automatic-index-creation-using-java-api/36000/2 "2015-12-01T08:25:29Z")

</div>

Not sure I understand the relation with Java API here.

Why not using index templates and define whatever mapping you want to apply automatically each time a new index is created? [https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html)

---

<div class="post-metadata">

**Author:** ![Phani\_Nadiminti](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/phani_nadiminti/32/45381_2.png) [@Phani\_Nadiminti](https://discuss.elastic.co/u/Phani_Nadiminti)\
**Post date:** [December 1, 2015, 8:51am UTC](https://discuss.elastic.co/t/automatic-index-creation-using-java-api/36000/3 "2015-12-01T08:51:35Z")

</div>

Hi David,

Thank you for the quick reply.I have mistaken we are using a .json file with my index schema structure contains a constant mapping. we are executing that json script for new index creation every time.

Thanks  
phani

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [December 1, 2015, 9:07am UTC](https://discuss.elastic.co/t/automatic-index-creation-using-java-api/36000/4 "2015-12-01T09:07:36Z")

</div>

As David suggested, you can create an index template based on this that will be applied whenever a new index is created. You would therefore not explicitly need to create a new index, but could just start indexing into it and have the template automatically applied. This is what Logstash does and it is proven to work well.

---

<div class="post-metadata">

**Author:** ![Rajeev\_Gaurav](https://avatars.discourse-cdn.com/v4/letter/r/3d9bf3/32.png) [@Rajeev\_Gaurav](https://discuss.elastic.co/u/Rajeev_Gaurav)\
**Post date:** [February 16, 2016, 5:58pm UTC](https://discuss.elastic.co/t/automatic-index-creation-using-java-api/36000/5 "2016-02-16T17:58:15Z")

</div>

Hi All,

Can you please tell me how can I automatically create index in kibana ,Once I got my data in elastic search. Basically I want to remove the overhead to go to kibana and manually create index in kibana . All help will be highly appreciated. @Phani_Nadiminti @Christian_Dahlqvist@dadoonet  
Thanks,  
Rajeev

---

<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 5, 2017, 11:15pm UTC](https://discuss.elastic.co/t/automatic-index-creation-using-java-api/36000/6 "2017-07-05T23:15:58Z")

</div>


