вот два jsons:
json 1:
{
"organization": [
"Univ Philippines",
{
"pref": "Y",
"content": "University of the Philippines System"
},
{
"pref": "Y",
"content": "University of the Philippines Diliman"
}
]
}
json 2:
{
"organization": "Univ Philippines"
}
Мне нужно проиндексировать их в Elasticsearch. как установить organization
отображение поля?
Я пробовал string
и object
типа, но все не удалось.
PUT sci_test
{
"mappings": {
"sci":{
"properties": {
"organization":{
"type": "object"
}
}
}
}
}
PUT sci_test/sci/1
{
"organization": [
"Univ Philippines",
{
"pref": "Y",
"content": "University of the Philippines System"
},
{
"pref": "Y",
"content": "University of the Philippines Diliman"
}
]
}
error info:
{
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "object mapping for [organization] tried to parse field [null] as object, but found a concrete value"
}
],
"type": "mapper_parsing_exception",
"reason": "object mapping for [organization] tried to parse field [null] as object, but found a concrete value"
},
"status": 400
}