# Mapping subtypes with array of different objects (polymorphism)

**URL:** https://discuss.elastic.co/t/mapping-subtypes-with-array-of-different-objects-polymorphism/80253
**Category:** Elasticsearch
**Created:** [March 28, 2017, 7:59am UTC](https://discuss.elastic.co/t/mapping-subtypes-with-array-of-different-objects-polymorphism/80253 "2017-03-28T07:59:02Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![shahbaz.atta](https://avatars.discourse-cdn.com/v4/letter/s/c5a1d2/32.png) [@shahbaz.atta](https://discuss.elastic.co/u/shahbaz.atta)
#### Post date: [March 28, 2017, 7:59am UTC](https://discuss.elastic.co/t/mapping-subtypes-with-array-of-different-objects-polymorphism/80253/1 "2017-03-28T07:59:02Z")

</div>

I want to map my subclass's polymorphic objects into elasticsearch.

Its array of objects. its also having field "value" which either be float in case of temperature and boolean in case of digital signal.

Can anyone help me to map this kind of fields mapping in elasticsearch template?

```
"SignalList":[  
                {
                    "value" : { "type" :"float"}, // temperature field
                    "SignalType" :{"type": "string"}      
                },
                {
                    "value" : { "type" :"boolean"}, //digital field 
                    "SignalType" :{"type": "string"}      
                },
                {
                    "location" : { "type" :"geo_point"},
                    "Latitude" : { "type" : "float" },
                    "Longitude" : { "type" : "float" },
                    "SignalType" :{"type": "string"}      
                }
                ]
```

---

<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 25, 2017, 7:59am UTC](https://discuss.elastic.co/t/mapping-subtypes-with-array-of-different-objects-polymorphism/80253/2 "2017-04-25T07:59:27Z")

</div>

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