Total Complexity | 5 |
Total Lines | 41 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | class Search extends Request |
||
14 | { |
||
15 | |||
16 | /** |
||
17 | * @var string |
||
18 | */ |
||
19 | protected $index; |
||
20 | |||
21 | /** |
||
22 | * @return mixed|string |
||
23 | */ |
||
24 | public function getMethod() |
||
25 | { |
||
26 | return 'POST'; |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * @return mixed|string |
||
31 | */ |
||
32 | public function getPath() |
||
33 | { |
||
34 | if (isset($this->index)) { |
||
35 | return "/json/pq/" . $this->index . "/_search"; |
||
36 | } |
||
37 | throw new RuntimeException('Index name is missing.'); |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * @return mixed |
||
42 | */ |
||
43 | public function getIndex() |
||
46 | } |
||
47 | |||
48 | /** |
||
49 | * @param mixed $index |
||
50 | */ |
||
51 | public function setIndex($index) |
||
54 | } |
||
55 | } |
||
56 |