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

elasticsearch: Did I lose data when two of my three nodes went down?
ElasticSearch automatic typing
how to copy ElasticSearch field to another field
ElasticSearch Order after 2 term aggregation
Mapping openNLP or StanfordNLP in elasticsearch
An Elasticsearch filter to determine the absence of a value
Different behaviour in elasticsearch with two different indexes
Elasticsearch 2.0: _id is not configurable
what will happen when one of ElasticSearch server down
How to get the total size of data matching query ElasticSearch?
Which is Better when you use Java to query in Elastic Search, Java API or passing the JSON string to setQuery?
ElasticSearch 2.0 Java API: java.lang.ClassNotFoundException: org.elasticsearch.common.settings.ImmutableSettings$Builder
Kibana + Logstash + Elastic group exceptions by stacktrace
Index document maintaining spaces between words in elasticsearch
Elasticsearch “strict” mapping not working for fields with null values
Elasticsearch aggregation over timestamp

Categories

HOME
elasticsearch
rust
nam
gaming
key
message-queue
lvm
amp
video-streaming
cdi
tfs2010
bellman-ford
swarm
android-externalstorage
spring-amqp
squirrel-sql
orange-api
playframework-2.0
rpmbuild
scheduled-tasks
bluemix-mobile-services
kaggle
python-appium
react-bootstrap-table
openbr
autodesk-model-derivative
windowsiot
windows2012
knights-tour
custom-keyboard
adminer
xerces-c
orchardcms-1.8
telephonymanager
export-to-pdf
get-event-store
jqgrid-asp.net
react-intl
common-table-expression
intellij-lombok-plugin
viewmodel
beeline
gestures
google-news
stateless-session-bean
dblink
google-shopping-api
perl-data-structures
bpms
nitrousio
oracle-fusion-apps
ogg
controllers
msg
mathml
android-sdcard
node.js-connect
highlighting
teensy
boost-proto
juniper-network-connect
canopy
knife
hmisc
wlanapi
google-gdk
kefir.js
ipod
azure-xplat-cli
prism-4
mutators
uno
rebar
nidaqmx
squeezebox
cpu-time
jquery-lazyload
rikulo
jquery-cycle
clearinterval
chronometer
hardcode
wcf-callbacks
yuidoc
delphi-prism
regression-testing
formal-semantics
solandra
cassini
.net-client-profile
main-method
datagridcolumn

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App