# Index mapping from Java client

**URL:** <https://discuss.elastic.co/t/index-mapping-from-java-client/177508>\
**Category:** Elasticsearch\
**Created:** [April 18, 2019, 4:02pm UTC](https://discuss.elastic.co/t/index-mapping-from-java-client/177508 "2019-04-18T16:02:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![thebuleon29](https://avatars.discourse-cdn.com/v4/letter/t/bbce88/32.png) [@thebuleon29](https://discuss.elastic.co/u/thebuleon29)\
**Post date:** [April 18, 2019, 4:02pm UTC](https://discuss.elastic.co/t/index-mapping-from-java-client/177508/1 "2019-04-18T16:02:44Z")

</div>

Hi,

I want to use ElasticSearch as a Time Series Database and need to declare the timestamp as a date to plot the data in Grafana. I am stuck at the index creation because Java keeps throwing the same exception :

`org.elasticsearch.action.ActionRequestValidationException: Validation Failed: 1: mapping type is missing;`

I tried two different ways to make it working :

1. Importing a JSON from a file :

The JSON file :

```
{
    "properties":{
        "@timestamp":{"type":"date","fields":{"keyword":{"type":"keyword","ignore_above":256}}},
        "alert":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},
        "curve":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},
        "engValidity":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},
        "engValue":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},
        "id":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},
        "limits":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},
        "monState":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},
        "name":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},
        "rawValidity":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},
        "sample":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},
        "spid":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},
        "bitOffset":{"type":"float"},
        "bitSize":{"type":"float"},
        "pk":{"type":"float"},
        "rawValue":{"type":"float"},
        "receivedTime":{"type":"float"}
    }
}

```

1. Building the JSON with a HashMap :

I can't find where I did a mistake...

---

<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:** [May 16, 2019, 4:02pm UTC](https://discuss.elastic.co/t/index-mapping-from-java-client/177508/2 "2019-05-16T16:02:52Z")

</div>

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