# "illegal\_argument\_exception"

**URL:** <https://discuss.elastic.co/t/illegal-argument-exception/171123>\
**Category:** Elasticsearch\
**Created:** [March 6, 2019, 1:48pm UTC](https://discuss.elastic.co/t/illegal-argument-exception/171123 "2019-03-06T13:48:25Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![saqibjavid](https://avatars.discourse-cdn.com/v4/letter/s/2acd7d/32.png) [@saqibjavid](https://discuss.elastic.co/u/saqibjavid)\
**Post date:** [March 6, 2019, 1:48pm UTC](https://discuss.elastic.co/t/illegal-argument-exception/171123/1 "2019-03-06T13:48:25Z")

</div>

{  
"error": {  
"root\_cause": [  
{  
"type": "illegal\_argument\_exception",  
"reason": "mapper [resume.experience.job.daterange.start] of different type, current\_type [text], merged\_type [ObjectMapper]"  
}  
],  
"type": "illegal\_argument\_exception",  
"reason": "mapper [resume.experience.job.daterange.start] of different type, current\_type [text], merged\_type [ObjectMapper]"  
},  
"status": 400  
}

I am not able to figure out what the error is please help me out in this.

"daterange": {  
"start": {  
"@days": "733165",  
"@iso8601": "2008-05-01",  
"#text": "May 2008"  
},  
"#text": "–",  
"end": {  
"@days": "733379",  
"@iso8601": "2008-12-01",  
"#text": "Dec 2008"  
}  
},

This is the place where the error is being thown. Please can someone help me resolve this?

---

<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 6, 2019, 2:05pm UTC](https://discuss.elastic.co/t/illegal-argument-exception/171123/2 "2019-03-06T14:05:50Z")

</div>

Could you provide a full recreation script as described in [About the Elasticsearch category](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). It will help to better understand what you are doing. Please, try to keep the example as simple as possible.

A full reproduction script will help readers to understand, reproduce and if needed fix your problem. It will also most likely help to get a faster answer.

Most likely you already inserted data with a `text` type but want now a more complex object.

---

<div class="post-metadata">

**Author:** ![saqibjavid](https://avatars.discourse-cdn.com/v4/letter/s/2acd7d/32.png) [@saqibjavid](https://discuss.elastic.co/u/saqibjavid)\
**Post date:** [March 6, 2019, 2:22pm UTC](https://discuss.elastic.co/t/illegal-argument-exception/171123/4 "2019-03-06T14:22:10Z")

</div>

I have created a new Index to store the data, So I have not stored any previous data of text type in the same index.

---

<div class="post-metadata">

**Author:** ![saqibjavid](https://avatars.discourse-cdn.com/v4/letter/s/2acd7d/32.png) [@saqibjavid](https://discuss.elastic.co/u/saqibjavid)\
**Post date:** [March 6, 2019, 2:32pm UTC](https://discuss.elastic.co/t/illegal-argument-exception/171123/5 "2019-03-06T14:32:00Z")

</div>

```
PUT testing_resumes/_doc/1
{
   "resume": {
      "@space": "preserve",
      "@canonversion": "2",
      "@dateversion": "2",
      "@present": "737110",
      "@iso8601": "2019-02-18",
      "contact": {
         "name": {
            "givenname": "VASUDHA",
            "surname": "KATIPALLY"
         },
         "phone": "(848)-702-2398",
         "#text": [
            "(",
            ")"
         ],
         "email": "sudha_katipally@yahoo.com"
      },
      "summary": {
         "#text": [
            "OBJECTIVE:",
            "SKILLS SUMMARY\n•"
         ],
       
      },
      "skills": {
         "#text": "TECHNICAL SUMMARY:",
        
      },
      "education": {
         "#text": [
            "EDUCATION:\n•",
            "in",
            "-",
            "•",
            "in",
            "–"
         ],
         "degree": [
            {
               "@level": "16",
               "#text": "Bachelors"
            },
            {
               "@level": "18",
               "#text": "Masters"
            }
         ],
         "major": [
            {
               "@code": "0405",
               "#text": "Computer Applications"
            },
            {
               "@code": "0402",
               "#text": "Computer Science"
            }
         ],
         "address": [
            {
               "city": "Hyderabad",
               "#text": ",",
               "country": {
                  "@iso3": "IND",
                  "#text": "India"
               }
            },
            {
               "state": {
                  "@abbrev": "NJ",
                  "#text": "New Jersey"
               },
               "#text": ",",
               "country": {
                  "@iso3": "USA",
                  "#text": "USA"
               }
            }
         ]
      },
      "experience": {
         "@start": "730000",
         "@end": "733379",
         "#text": [
            "PROFESSIONAL EXPERIENCE: \n\nTravelers\nETL DataStage",
            "Technologies:",
            "Technologies:",
            "Technologies:",
            "Company:",
            "Technologies:",
            "Technologies:",
            "Company:",
            "Company:"
         ],
         "title": "Lead",
         
         "job": [
            {
               "@sic": "8082",
               "@sic2": "80",
               "@start": "733165",
               "@end": "733379",
               "@pos": "1",
               "@span": "1",
               "@id": "1",
               "employer": "J&J Health Care Solutions",
               "daterange": {
                  "start": {
                     "@days": "733165",
                     "@iso8601": "2008-05-01",
                     "#text": "May 2008"
                  },
                  "#text": "–",
                  "end": {
                     "@days": "733379",
                     "@iso8601": "2008-12-01",
                     "#text": "Dec 2008"
                  }
               },

```

This is the full size JSON document I am trying to upload.

---

<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 6, 2019, 2:34pm UTC](https://discuss.elastic.co/t/illegal-argument-exception/171123/6 "2019-03-06T14:34:45Z")

</div>

As I said:

> Please, try to keep the example as simple as possible.

So you don't need to upload your full document.

> I have created a new Index to store the data, So I have not stored any previous data of text type in the same index.

So you mean that you ran:

```auto
DELETE testing_resumes
PUT testing_resumes/_doc/1
{
   "resume": {
     // ...
   }
}

```

And that's all?  
I doubt it's the case.

---

<div class="post-metadata">

**Author:** ![saqibjavid](https://avatars.discourse-cdn.com/v4/letter/s/2acd7d/32.png) [@saqibjavid](https://discuss.elastic.co/u/saqibjavid)\
**Post date:** [March 6, 2019, 4:30pm UTC](https://discuss.elastic.co/t/illegal-argument-exception/171123/7 "2019-03-06T16:30:47Z")

</div>

Yes you are right.

---

<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 6, 2019, 4:41pm UTC](https://discuss.elastic.co/t/illegal-argument-exception/171123/8 "2019-03-06T16:41:53Z")

</div>

> Yes you are right.

About what?

---

<div class="post-metadata">

**Author:** ![saqibjavid](https://avatars.discourse-cdn.com/v4/letter/s/2acd7d/32.png) [@saqibjavid](https://discuss.elastic.co/u/saqibjavid)\
**Post date:** [March 7, 2019, 5:19am UTC](https://discuss.elastic.co/t/illegal-argument-exception/171123/9 "2019-03-07T05:19:07Z")

</div>

I ran the script which you have mentioned above.

---

<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 7, 2019, 7:42am UTC](https://discuss.elastic.co/t/illegal-argument-exception/171123/10 "2019-03-07T07:42:04Z")

</div>

Unless you have an index template I don't see how this error can happen.

Please share a full script that reproduces the problem on [gist.github.com](http://gist.github.com)

---

<div class="post-metadata">

**Author:** ![saqibjavid](https://avatars.discourse-cdn.com/v4/letter/s/2acd7d/32.png) [@saqibjavid](https://discuss.elastic.co/u/saqibjavid)\
**Post date:** [March 7, 2019, 12:01pm UTC](https://discuss.elastic.co/t/illegal-argument-exception/171123/11 "2019-03-07T12:01:43Z")

</div>

Actually I have same field more than once but with different format, which throws the error, So my doubt is can we create multiple mapping like it accepts any format, or can I create an index independent of any mapping?

---

<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 7, 2019, 12:45pm UTC](https://discuss.elastic.co/t/illegal-argument-exception/171123/12 "2019-03-07T12:45:40Z")

</div>

I don't know as I don't understand without an example.

---

<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, 2019, 12:45pm UTC](https://discuss.elastic.co/t/illegal-argument-exception/171123/13 "2019-04-04T12:45:41Z")

</div>

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