# Illegal\_argument\_exception mapper

**URL:** <https://discuss.elastic.co/t/illegal-argument-exception-mapper/124086>\
**Category:** Elasticsearch\
**Created:** [March 15, 2018, 11:36am UTC](https://discuss.elastic.co/t/illegal-argument-exception-mapper/124086 "2018-03-15T11:36:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rdm87](https://avatars.discourse-cdn.com/v4/letter/r/c5a1d2/32.png) [@rdm87](https://discuss.elastic.co/u/rdm87)\
**Post date:** [March 15, 2018, 11:36am UTC](https://discuss.elastic.co/t/illegal-argument-exception-mapper/124086/1 "2018-03-15T11:36:30Z")

</div>

Hi at all,

From Kibana Console, I have created the following index

```
PUT riskevents {
	"mappings": {
		"doc": {
		"dynamic_date_formats": ["yyyy-MM-dd'T'HH:mm:ssZ"],
			"properties": {
				"category": { "type": "keyword" },
				"status": { "type": "keyword" },
				"appinstance": { "type": "text" },
				"appname": { "type": "keyword" },
				"createdon": { "type": "text" },
				"title": { "type": "text" },
				"uri": { "type": "text" },
				"realeventtime": { "type": "text" },
				"priority": { "type": "text" },
				"lastevent": { "type": "text" },
				"snapdate": { "type": "text" },
				"appinstanceid": { "type": "text" },
				"id": { "type": "text" },
				"additionalDetails": {
						"properties": {
						"Details": 
						    { "type": "nested",
						      "dynamic": true
						    }
						}
            }
          }
        }
      }
    }

```

When i try to import the following document I receive an error

```
PUT riskevents/doc/1
{
            "category": "Security control", 
            "status": "Open", 
            "appinstance": "xxx", 
            "appname": "xxx", 
            "createdon": "2018-02-20T08:45:38.482Z", 
            "title": "Password expiration period (in days)", 
            "uri": "/v1/events/riskevent?eventId=6xx83120-161a-11e8-ax59-23c8d06660e2&applicationInstanceId=xx40411x-1d46-40d5-9c73-fcx8be4e5489", 
            "realeventtime": "2018-02-20T08:45:38.482Z", 
            "priority": "High", 
            "lastevent": "2018-02-20T08:45:38.482Z", 
            "snapdate": "2018-02-20", 
            "appinstanceid": "xx40411x-1d46-40d5-9c73-xxd8be9e8689", 
            "id": "6xx83120-161a-11e8-ax59-23c8x46660x2", 
            "additionalDetails": [
                {
                    "Details": [
                        {
                            "name": "Scan details", 
                            "value": "xxx"
                        }, 
                        {
                            "name": "Security control name", 
                            "value": "Password expiration period (in days)"
                        }, 
                        {
                            "name": "Current value", 
                            "value": "60"
                        }, 
                        {
                            "name": "Recommended value", 
                            "value": "30"
                        }, 
                        {
                            "name": "Message", 
                            "value": "Non-compliant security setting"
                        }, 
                        {
                            "name": "Occurred", 
                            "value": "2018-02-20T08:45:38Z"
                        }, 
                        {
                            "name": "recommendationkey", 
                            "value": "xxx~xxx~xxx"
                        }
                    ]
                }
            ]
        }

```

This is the error

```
{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "mapper [additionalDetails.Details.value] of different type, current_type [date], merged_type [text]"
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "mapper [additionalDetails.Details.value] of different type, current_type [date], merged_type [text]"
  },
  "status": 400
}

```

Any help would be greatly appreciated

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 15, 2018, 11:50am UTC](https://discuss.elastic.co/t/illegal-argument-exception-mapper/124086/2 "2018-03-15T11:50:04Z")

</div>

You need to force in the mapping the type for the value field to be a text data type.

---

<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 12, 2018, 11:50am UTC](https://discuss.elastic.co/t/illegal-argument-exception-mapper/124086/3 "2018-04-12T11:50:12Z")

</div>

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