# Failing in Mapping a doc with Multi field of boolean

**URL:** <https://discuss.elastic.co/t/failing-in-mapping-a-doc-with-multi-field-of-boolean/210714>\
**Category:** Elasticsearch\
**Created:** [December 5, 2019, 12:52pm UTC](https://discuss.elastic.co/t/failing-in-mapping-a-doc-with-multi-field-of-boolean/210714 "2019-12-05T12:52:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![afnanali1992](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@afnanali1992](https://discuss.elastic.co/u/afnanali1992)\
**Post date:** [December 5, 2019, 12:52pm UTC](https://discuss.elastic.co/t/failing-in-mapping-a-doc-with-multi-field-of-boolean/210714/1 "2019-12-05T12:52:40Z")

</div>

**Elasticsearch version** ( `bin/elasticsearch --version` ): 6.8.5 - elastic cloud

**Plugins installed** : [mongoosastic]

Hello, I have a question regarding Mapping the Mixed type in ES where it doesn't support it, So we used the Multifield to solve the problem but the type boolean is not supported by `ignore_malformed` where it works properly with number and date types only.

**We create the mapping** :

```auto
{
 "mappings": {
   "user": {
     "properties": {
       "attribute": {
         "type": "nested",
         "properties": {
           "value": {
             "type": "text",
             "fields": {
               "number": {
                 "type": "double",
                 "ignore_malformed": true
               },
               "date": {
                 "type": "date",
                 "ignore_malformed": true
               },
               "boolean": {
                 "type": "boolean"
               }
             }
           }
         }
       }
     }
   }
 }
}

```

Our schemas are :  
**User schema**

```auto
var UserSchema = new Schema({
  name: { type: String, es_indexed: true, required: true },
  email: { type: String, es_indexed: true },
  address: { type: [addressSchema], es_type: 'nested', es_indexed: true },
  attribute: { type: [attribute], es_type: 'nested', es_indexed: true }
})

```

**Attribute Schema**

```auto
const attribute = new Schema({
  inner_name: String,
  value: {
    type: Schema.Types.Mixed,
    es_type: 'multi_field',
    es_fields: {
      string: { type: String, index: 'analyzed' },
      date: { type: Date, index: 'analyzed' },
      number: { type: Number, index: 'analyzed' },
      boolean: { type: Boolean, index: 'analyzed' },
      array: { type: Array, index: 'analyzed' },
      object: { type: Object, index: 'analyzed' },
      null: { type: null }
    }
  }
})

```

The Error was `failed to parse the field of type [boolean]`  
Is there any parameter instead of `ignore_malformed` that could support boolean type? or Is there any other solution for the mixed type?  
Please response as soon as possible, this is crucial in our application.

Thanks in advance.

---

<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:** [January 2, 2020, 1:01pm UTC](https://discuss.elastic.co/t/failing-in-mapping-a-doc-with-multi-field-of-boolean/210714/2 "2020-01-02T13:01:46Z")

</div>

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