Hi,
I am using elasticsearch 2.1.0 and kibana 4.3.0.
To create visualizations dynamically, first I created it manually.
Then I exported the same visualization .json file from Settings--Objects--Visualizations.
The .json is as follows:
[
{
"_id": "company",
"_type": "visualization",
"_source": {
"title": "company",
"visState": "{\"type\":\"pie\",\"params\":{\"shareYAxis\":true,\"addTooltip\":true,\"addLegend\":true,\"isDonut\":false},\"aggs\":[{\"id\":\"1\",\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"type\":\"terms\",\"schema\":\"segment\",\"params\":{\"field\":\"company\",\"size\":5,\"order\":\"desc\",\"orderBy\":\"1\"}}],\"listeners\":{}}",
"uiStateJSON": "{}",
"description": "",
"version": 1,
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"index\":\"t0hen\",\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}},\"filter\":[]}"
}
}
}
]
Then I deleted the above visualization and reposted it again to .kibana index
POST http://xx.xx.xx.xx:9200/.kibana/visualization/company
{
"title": "company",
"visState": {
"type": "pie",
"params": {
"shareYAxis": true,
"addTooltip": true,
"addLegend": true,
"isDonut": false
},
"aggs": [{
"id": "1",
"type": "count",
"schema": "metric",
"params": {}
}, {
"id": "2",
"type": "terms",
"schema": "segment",
"params": {
"field": "company",
"size": 5,
"order": "desc",
"orderBy": "1"
}
}],
"listeners": {}
},
"uiStateJSON": {},
"description": "",
"version": 1,
"kibanaSavedObjectMeta": {
"searchSourceJSON": {
"index": "t0hen",
"query": {
"query_string": {
"query": "*",
"analyze_wildcard": true
}
},
"filter": []
}
}
}
But, I am getting following error:
{
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "failed to parse [visState]"
}
],
"type": "mapper_parsing_exception",
"reason": "failed to parse [visState]",
"caused_by": {
"type": "illegal_argument_exception",
"reason": "unknown property [type]"
}
},
"status": 400
}
Can anybody please help.