here is my problem:
I have many messages data in elasticsearch db, these data are stored in the same type but different index according to the date. for example, all the messages today are stored in the message_2019-04-13 index. now i want to search all the messages sent by someone with elasticsearch-PHP:
$arr = [
'index' => 'messages_*',
'type' => 'doc',
'body' => [
'query' => [
'bool' => [
'must' => [
['match' => ['from_user_id' => 1]],
['match' => ['from_user_type' => 'admin']],
],
],
]
]
];
$clientBuilder = ClientBuilder::create();
$clientBuilder->setHosts('127.0.0.1');
$clientBuilder->setRetries(3);
$client = $clientBuilder->build();
$res = $client->search($arr);
But it doesnt work, how can i do?