Hello , I am using msearch
like this doc -
well it is working in kibana .
but when I try to do it , in php . does not work .
this is my test code -
$this->elasticSeacrh->msearch([
[ 'index' => 'index-test-one'],
[ 'body' => [
'query' => [
'match_all' => new \stdClass()
]
]],
[ 'index' => 'index-test-two'],
[ 'body' => [
'query' => [
'match_all' => new \stdClass()
]
]]
]);
it gives his error -
{"message":"The parameter body is required","errors":{"message":["The parameter body is required"]}}
I Tried like this as well -
$response = $this->elasticSeacrh->msearch([
'body' => [
[ 'index' => 'index-test-one'],
["query" => [
'match_all' => new \stdClass()
]],
[ 'index' => 'index-test-two'],
["query" => [
'match_all' => new \stdClass()
]],
]
]);
it returns this
Elastic\Elasticsearch\Response\Elasticsearch Object
(
[response:protected] => GuzzleHttp\Psr7\Response Object
(
[reasonPhrase:GuzzleHttp\Psr7\Response:private] => OK
[statusCode:GuzzleHttp\Psr7\Response:private] => 200
[headers:GuzzleHttp\Psr7\Response:private] => Array
(
[X-elastic-product] => Array
(
[0] => Elasticsearch
)
[content-type] => Array
(
[0] => application/vnd.elasticsearch+json;compatible-with=8
)
[content-length] => Array
(
[0] => 5810
)
)
[headerNames:GuzzleHttp\Psr7\Response:private] => Array
(
[x-elastic-product] => X-elastic-product
[content-type] => content-type
[content-length] => content-length
)
[protocol:GuzzleHttp\Psr7\Response:private] => 1.1
[stream:GuzzleHttp\Psr7\Response:private] => GuzzleHttp\Psr7\Stream Object
(
[stream:GuzzleHttp\Psr7\Stream:private] => Resource id #19
[size:GuzzleHttp\Psr7\Stream:private] =>
[seekable:GuzzleHttp\Psr7\Stream:private] => 1
[readable:GuzzleHttp\Psr7\Stream:private] => 1
[writable:GuzzleHttp\Psr7\Stream:private] => 1
[uri:GuzzleHttp\Psr7\Stream:private] => php://temp
[customMetadata:GuzzleHttp\Psr7\Stream:private] => Array
(
)
)
)
)