here are two 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"
}
I need index them into Elasticsearch. how to set organization field mapping?
I had tried string and object type but all failed.
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
}