# ElasticSearch 5.0 PHP msearch

**URL:** <https://discuss.elastic.co/t/elasticsearch-5-0-php-msearch/66716>\
**Category:** Elasticsearch\
**Created:** [November 21, 2016, 1:13pm UTC](https://discuss.elastic.co/t/elasticsearch-5-0-php-msearch/66716 "2016-11-21T13:13:14Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![polyfractal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polyfractal/32/48162_2.png) [@polyfractal](https://discuss.elastic.co/u/polyfractal)\
**Post date:** [November 21, 2016, 4:53pm UTC](https://discuss.elastic.co/t/elasticsearch-5-0-php-msearch/66716/2 "2016-11-21T16:53:48Z")

</div>

There's an `msearch` endpoint under the root client object:

```php
$client->msearch([
  'body' => [
    [
      'index' => 'indexA', 
      'type' => 'typeA'],
    [
      'query' => [
          'match_all' => (object)[],
      ],
    ],
    [
      'index' => 'indexB',
      'type' => 'typeB'
    ],
    [
      'size' => 0,
      'query' => [
          'match_all' => (object)[],
      ],
      'aggs' => [
          'max_sequence' => ['max' => ['field' => 'sequence']],
      ],
    ],
  ],
]);

```

---

_[View the full topic](https://discuss.elastic.co/t/elasticsearch-5-0-php-msearch/66716)._
