1 | <?php |
||
25 | class Client extends BaseClient |
||
26 | { |
||
27 | /** |
||
28 | * Stores created indexes to avoid recreation. |
||
29 | * |
||
30 | * @var array |
||
31 | */ |
||
32 | private $indexCache = []; |
||
33 | |||
34 | /** |
||
35 | * Symfony's debugging Stopwatch. |
||
36 | * |
||
37 | * @var Stopwatch|null |
||
38 | */ |
||
39 | private $stopwatch; |
||
40 | |||
41 | /** |
||
42 | * {@inheritdoc} |
||
43 | */ |
||
44 | 10 | public function request($path, $method = Request::GET, $data = [], array $query = [], $contentType = Request::DEFAULT_CONTENT_TYPE) |
|
80 | |||
81 | /** |
||
82 | * @param string $name |
||
83 | * |
||
84 | * @return Index|mixed |
||
85 | */ |
||
86 | 12 | public function getIndex($name) |
|
94 | |||
95 | /** |
||
96 | * Sets a stopwatch instance for debugging purposes. |
||
97 | * |
||
98 | * @param Stopwatch $stopwatch |
||
99 | */ |
||
100 | 13 | public function setStopwatch(Stopwatch $stopwatch = null) |
|
104 | |||
105 | /** |
||
106 | * Log the query if we have an instance of ElasticaLogger. |
||
107 | * |
||
108 | * @param string $path |
||
109 | * @param string $method |
||
110 | * @param array $data |
||
111 | * @param array $query |
||
112 | * @param int $queryTime |
||
113 | * @param int $engineMS |
||
114 | * @param int $itemCount |
||
115 | * @oaram \Exception|null $exception |
||
116 | */ |
||
117 | 10 | private function logQuery($path, $method, $data, array $query, $queryTime, $engineMS = 0, $itemCount = 0, \Exception $exception = null) |
|
136 | } |
||
137 |