JSONスキーマの適切なマッピングを定義しようとしています。可能なすべての変数型やその他の属性を試した後、私はJSONをアップロードすることができませんでした。親要素と子要素で同じ要素名が使用されるネストされたスキーマのマッピングを定義する方法はありますか。
私のJSONには、本質的にネストされた複雑なキー「P」があります。この要素は異なる兄弟レベルのオブジェクトに存在し、テキスト、配列、ネストされたオブジェクトを表示します。
私はJSONをロードしようとすると、私のスキーマが作成された後、それは以下のエラーで失敗し
$ 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}
私は何をすべきかわからない - この問題が解決されない場合、私はへの切り替えが必要になる場合があります他のテキスト検索のdb。どこが間違っているのか理解してください。
マイマッピング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"
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
本当のJSON:
{
"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"
},
{
"_": "[email protected]",
"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"
}
}
]
}
]
}
}