# Convert a relational logical schema model(in oracle) into elasticsearch nosql logical schema

**URL:** <https://discuss.elastic.co/t/convert-a-relational-logical-schema-model-in-oracle-into-elasticsearch-nosql-logical-schema/61811>\
**Category:** Elasticsearch\
**Created:** [September 29, 2016, 1:09pm UTC](https://discuss.elastic.co/t/convert-a-relational-logical-schema-model-in-oracle-into-elasticsearch-nosql-logical-schema/61811 "2016-09-29T13:09:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jagan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jagan/32/42200_2.png) [@jagan](https://discuss.elastic.co/u/jagan)\
**Post date:** [September 29, 2016, 1:09pm UTC](https://discuss.elastic.co/t/convert-a-relational-logical-schema-model-in-oracle-into-elasticsearch-nosql-logical-schema/61811/1 "2016-09-29T13:09:13Z")

</div>

Hi All,  
Could you please suggest me how to do a schema design(nosql) in elasticsearch.  
As per my requirement we have already 'relational logical schema' (which is oracle schema) but we are building new version of software which has chosen ES as a NoSql Solution.  
How to start the schema design in ES.  
Thanks in advance

Regards,  
Jagan

---

<div class="post-metadata">

**Author:** ![MarkOStewart](https://avatars.discourse-cdn.com/v4/letter/m/898d66/32.png) [@MarkOStewart](https://discuss.elastic.co/u/MarkOStewart)\
**Post date:** [September 29, 2016, 2:20pm UTC](https://discuss.elastic.co/t/convert-a-relational-logical-schema-model-in-oracle-into-elasticsearch-nosql-logical-schema/61811/2 "2016-09-29T14:20:25Z")

</div>

Jagan,

The schema is applied with Templates. The template is setup before creating your index and has a line near the begenning similar to  
"template" : "logstash\*",

this will catch ANY index created where the name starts with logstash and apply the template settings.

After the template line you start defining your schema for each field in your index. You will create a line for each field and define a type.  
Similar to:

```
"mappings" : {
  "cisco-fw" : {
     "properties": {
        "@timestamp":{"type":"date","format":"dateOptionalTime"},
        "@version":{"type":"string", "index" : "not_analyzed"},
        "action":{"type":"string"},
        "bytes":{"type":"long"},
        "cisco_message":{"type":"string"},
        "ciscotag":{"type":"string", "index" : "not_analyzed"},

```

See documentation for complete examples.  
[https://www.elastic.co/guide/en/elasticsearch/guide/2.x/custom-dynamic-mapping.html](https://www.elastic.co/guide/en/elasticsearch/guide/2.x/custom-dynamic-mapping.html)

> **[Dynamic Index Creation In Elasticsearch](https://qbox.io/blog/dynamic-index-creation-in-elasticsearch)**
>
> In this blog, we will be creating an index in detail, which ranges from static index creation for the creation of simple indices, to dynamic template creation for creating multiple indices.

  
[https://jackhanington.com/blog/2014/12/11/create-a-custom-elasticsearch-template/](https://jackhanington.com/blog/2014/12/11/create-a-custom-elasticsearch-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:** [July 5, 2017, 10:16pm UTC](https://discuss.elastic.co/t/convert-a-relational-logical-schema-model-in-oracle-into-elasticsearch-nosql-logical-schema/61811/3 "2017-07-05T22:16:06Z")

</div>


