Lynnic
(Kwan)
February 1, 2018, 2:53am
1
here is my code
`
es.search({
index: kbnIndex,
type: "index-pattern",
body: {
query: {
"ids":
{
"type" : "index-pattern",
"values" : [$scope.vis.indexPattern.id]
}
}
}
}, function (error, response) {
} );
`
when I check in chrome dev tool network,
It says http://localhost:5601/olv/elasticsearch/.kibana/index-pattern/_search 404 not found
But everything in kibana5.x works fine.
Does anyone know how to let es.search() work in kibana6.x? thanks very much
jbudz
(Jon Budzenski)
February 1, 2018, 5:02pm
2
Starting in 6.x kibana documents are all a single type, does
es.search({
index: kbnIndex,
type: "doc", //here
body: {
query: {
"ids":
{
"type" : "index-pattern",
"values" : [$scope.vis.indexPattern.id]
}
}
}
}, function (error, response) {
} );
work for you?
Lynnic
(Kwan)
February 1, 2018, 5:33pm
4
Thanks for replying. I tried but still got 404 on 6.x
POST
http://localhost:5601/ztc/elasticsearch/.kibana/doc/_search
{"query":{"ids":{"type":"index-pattern","values":["3851cd60-0450-11e8-8f86-9312c81e614d"]}}}
And I want result like this
{
"took": 0,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 1.0,
"hits": [{
"_index": ".kibana",
"_type": "index-pattern",
"_id": "demo-image",
"_score": 1.0,
"_source": {
"title": "demo-image",
"timeFieldName": "@timestamp",
"notExpandable": true,
"fields": ""
"fieldFormatMap": "{\"file.length\":{\"id\":\"bytes\"}}"
}
}]
}
}
jbudz
(Jon Budzenski)
February 1, 2018, 6:25pm
5
Ah I see, apologies I missed the second type definition. You'll likely want the query to look like this:
{
"query": {
"ids": {
"type": "doc",
"values": ["index-pattern:3851cd60-0450-11e8-8f86-9312c81e614d"]
}
}
}
query: {
"ids": {
"values" : ['index-pattern' + $scope.vis.indexPattern.id]
}
}
Lynnic
(Kwan)
February 4, 2018, 8:23am
6
thanks a lot! jbudz
the first query works for me
system
(system)
Closed
March 4, 2018, 8:24am
7
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.