elasticsearch


Struggling to define the mapping for nested schema where same element name is used in parent and child


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}
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"
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
The real json 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

Related Links

How to force certain fields in mult_match to have exact match
Elasticsearch 5.1.1 Keyword/Text datatype takes twice the size as the String datatype
How to search for a very long term? (longer than the maximum nGram-size)
How to apply aggregation after applying a range?
Using event field as hash variable
Filebeat is processing all the logs instead of the specified application logs
Elasticsearch- get all values for all the types in an index
AND operator is returning no results in elastic search script
Elasticsearch count doc_count occurrences on aggs
How can I modify a field or a type in all indexes?
Elasticsearch order by field in child document
Elastic search - Scroll id - How to get current page result again ?
How to create filebeat index pattern in kibana?
Aggregation in Logstash-ElasticSearch
Update all documents of Elastic Search using existing column value
Is it possible to index only the matched log lines of grok in Logstash?

Categories

HOME
elasticsearch
rust
openshift
knockout.js
powerbi
apple-push-notifications
dotnetnuke
seedstack
kendo-dropdown
theano
website
out-of-memory
consul
angular-meteor
yeoman-generator-angular
fbloginview
bootstrap-switch
salt-cloud
bazaar
workday
acl
function-points
android-service
memory-fences
lxml
counting
installanywhere
xll
sbjson
microkernel
google-prediction
spooler
cyanogenmod
md5-file
spring.net
android-webservice
gtk#
gnome-terminal
mobile-angular-ui
wildfly-9
gapi
google-identity-toolkit
pyaudio
groovyfx
android-syncadapter
rails-engines
jeditable
mnesia
univocity
gdl
in-app-billing
srv-record
blank-line
enaml
search-form
artisan
nsmutabledata
createfile
jcheckbox
dos2unix
comctl32
password-recovery
dnsjava
multivariate-testing
jquery-mobile-flipswitch
mobile-country-code
lmax
coding-efficiency
hyperloglog
air-native-extension
tabletools
flipboard
saga
non-ascii-characters
mongo-jackson-mapper
proc-open
session-0-isolation
cyrillic
handshake
daap
clrprofiler
thejit
struts2-s2hibernate
fitch-proofs
infopath-2007
webresponse
3270
wmd-editor
suggestbox
server-load

Resources

Encrypt Message