I have been trying to define the proper mapping for my json schema. but after trying all possible variable types and other attributes I have not been able to upload my json.
In my json I have a key "P" which is nested and complex in nature. this element is present in different sibling level objects and exhibits text,array,nested,object .
after my schema gets created when I try to load my json it fails with below error
$ curl -XPnST 'http://localhost:9200/ridev2/1' -d @v22.jso
{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Can't merge a non object mapping [EXPLA.SIDEHED.P] with an object mapping [EXPLA.SIDEHED.P]"}],"type":"illegal_argument_exception","reason":"Can't merge a non object mapping [EXPLA.SIDEHED.P] with an object mapping [EXPLA.SIDEHED.P]"},"status":400}Sujits-MacBook-Pro:STABLE sujitbehera$
Not sure what to do if this issues doesn't get resolved I might have to switch to some other text search db to try out. Please help me understanding where am doing wrong.
My mapping json:
curl -XDELETE 'localhost:9200/ridev2?pretty'
curl -H 'Content-Type: application/json' -XPUT http://localhost:9200/ridev2 -d '
{
"mappings":{
"title21":{
"properties":{
"CFRDOC":{
"properties":{
"AMDDATE":{
"type":"text"
},
"FMTR":{
"properties":{
"EXPLA":{
"properties":{
"PRTPAGE":{
"type":"object",
"properties":{
"P":{
"type":"text"
}
}
},
"SIDEHED":{
"type":"object",
"properties":{
"HD":{
"type":"object"
},
"P":{
"type":"object",
"properties":{
"":{
"type":"text"
},
"E":{
"type":"object",
"properties":{
"_":{
"type":"text"
},
"T":{
"type":"text"
}
}
}
},
"type":"object"
}
}
}
}
}
}
}
}
}
}
}
}
}'
The real josn which am uploading :-------
{
"EXPLA":{
"SIDEHED":[
{
"HD":{
"":"HOW TO USE THE CODE OF FEDERAL REGULATIONS",
"SOURCE":"HED"
},
"P":[
"The Code of Federal Regulations is...atest version of any given rule.",
"To det..ent of any given rule."
]
},
{
"HD":{
"":"OMB CONTROL NUMBERS",
"SOURCE":"HED"
},
"P":{
"":"The Paperwork Reductio...rdkeeping or reporting requirements.",
"PRTPAGE":{
"P":"vi"
}
}
},
{
"HD":{
"":"“[RESERVED]” TERMINOLOGY",
"SOURCE":"HED"
},
"P":"The term “[Reserved]” is used as a pl...dentally dropped due to a printing or computer error."
},
{
"HD":{
"":"CFR INDEXES AND TABULAR GUIDES",
"SOURCE":"HED"
},
"P":[
{
"":"A subject index t...anua...also included in this volume ",
"E":{
"":"Index and Finding Aids.",
"T":"04"
},
"PRTPAGE":{
"P":"vii"
}
},
"An index to ...” is carried within that volume.",
"The Fed....ral Register.",
"A List of C..FR titles."
]
},
{
"HD":{
"":"SALES",
"SOURCE":"HED"
},
"P":"The Government Publishing Office (GPO) ... 979050, St. Louis, MO 63197-9000."
},
{
"HD":{
"":"ELECTRONIC SERVICES",
"SOURCE":"HED"
},
"P":[
{
"":"The full text of the C...Phone 202-512-1800, or 866-512-1800 (toll-free). E-mail, ",
"E":[
{
"":"www.ofr.gov.",
"T":"03"
},
{
"":"ContactCenter@gpo.gov.",
"T":"03"
}
]
},
{
"":"The e-CFR is..rnment Publishing Office. It is available at ",
"E":{
"":"www.ecfr.gov.",
"T":"03"
}
},
{
"E":{
"_":"January 1, 2016.",
"T":"03"
}
}
]
}
]
}
}
Need urgent help