1<?php
2
3declare(strict_types = 1);
4
5namespace Elasticsearch\Endpoints;
6
7/**
8 * Class Search
9 *
10 * @category Elasticsearch
11 * @package  Elasticsearch\Endpoints
12 * @author   Zachary Tong <zach@elastic.co>
13 * @license  http://www.apache.org/licenses/LICENSE-2.0 Apache2
14 * @link     http://elastic.co
15 */
16class SearchShards extends AbstractEndpoint
17{
18    public function getURI(): string
19    {
20        $index = $this->index ?? null;
21
22        if (isset($index)) {
23            return "/$index/_search_shards";
24        }
25        return "/_search_shards";
26    }
27
28    public function getParamWhitelist(): array
29    {
30        return [
31            'preference',
32            'routing',
33            'local',
34            'ignore_unavailable',
35            'allow_no_indices',
36            'expand_wildcards'
37        ];
38    }
39
40    public function getMethod(): string
41    {
42        return 'GET';
43    }
44}
45