# Data types(Map\<Object, Object\>) in templates

**URL:** <https://discuss.elastic.co/t/data-types-map-object-object-in-templates/122856>\
**Category:** Elasticsearch\
**Created:** [March 7, 2018, 9:57am UTC](https://discuss.elastic.co/t/data-types-map-object-object-in-templates/122856 "2018-03-07T09:57:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nikita\_Krasnov](https://avatars.discourse-cdn.com/v4/letter/n/53a042/32.png) [@Nikita\_Krasnov](https://discuss.elastic.co/u/Nikita_Krasnov)\
**Post date:** [March 7, 2018, 9:57am UTC](https://discuss.elastic.co/t/data-types-map-object-object-in-templates/122856/1 "2018-03-07T09:57:43Z")

</div>

Hello to everyone.  
I want to create template for indexing. I don't know how to put `Map<Object, Object>` (Java) in such templete.  
I have right know:

```
 PUT _template/portal-user
{
  "index_patterns": "portal-user-*",
  "settings": { "number_of_shards": 5 },
  "mappings": {
      "logs_info": {
        "properties": {
          "userLogin": {"type": "keyword"},
          "localStorage": {"type": "keyword"},
          "cookies": {"type": "keyword"},
          "timeSignIn": {"type": "date"},
          "cookieEnabled": {"type": "boolean"},
          "deviceMemory": {"type": "integer"},
          "geolocation": {"type": "geo_point"},
          "hardwareConcurrency": {"type": "integer"},
          "language": {"type": "keyword"},
          "languages": {"type": "nested"},
          "platform": {"type": "keyword"},
          "userAgent": {"type": "keyword"},
          "window":{"type": "keyword"},
          "origin": {"type": "keyword"}
}
}
}
}

```

where `window` and `localStorage` have to be a map `Map<String, Integer> window` and `Map<String, String> localStorage`. I know that for an arrays of objects it hava to be `nesnted` and I did it in my example `"languages": {"type": "nested"}`. But I don't know what it should be for maps.

---

<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:** [April 4, 2018, 9:57am UTC](https://discuss.elastic.co/t/data-types-map-object-object-in-templates/122856/2 "2018-04-04T09:57:47Z")

</div>

Closed on April 4, 2018, 9:57am UTC

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