"illegal_argument_exception"


(Mohammed Saqib ) #1

{
"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?


(David Pilato) #2

Could you provide a full recreation script as described in About the Elasticsearch category. 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.


(Mohammed Saqib ) #4

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.


(Mohammed Saqib ) #5
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.


(David Pilato) #6

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:

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

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


(Mohammed Saqib ) #7

Yes you are right.


(David Pilato) #8

Yes you are right.

About what?


(Mohammed Saqib ) #9

I ran the script which you have mentioned above.


(David Pilato) #10

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


(Mohammed Saqib ) #11

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?


(David Pilato) #12

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


(system) closed #13

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