ElasticSearch Count API, несколько счетов как один запрос в php - PullRequest
0 голосов
/ 05 октября 2018

Можно ли рассчитывать несколько индексов с разными фильтрами запросов в одном запросе?

https://www.elastic.co/guide/en/elasticsearch/reference/6.2/search-count.html

Примерно так: https://www.elastic.co/guide/en/elasticsearch/reference/6.2/search-multi-search.html

Нозатем для Count API.Существует многоиндексная опция, но она будет просто суммировать попадания и не будет работать, когда фильтры запросов начального числа различны.

$this->client = ClientBuilder::fromConfig(SOME_CONFIG);

$results1 =$this->client->count($SomeQueryOnIndex1);
$results2 =$this->client->count($SomeQueryOnIndex2);
$results3 =$this->client->count($SomeQueryOnIndex3);

// Would love to reduce those 3 requests to one.
$mergedQueries = $SomeQueryOnIndex1 +$SomeQueryOnIndex2 + $SomeQueryOnIndex3

//  Something like this ...
$results = $this>client->mcount($mergedQueries);

//..and then have for each index/query the number of hits.

Возможно ли это?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...