1 | <?php |
||
52 | class ElasticSearchPlatform implements IFullTextSearchPlatform { |
||
53 | |||
54 | /** @var ConfigService */ |
||
55 | private $configService; |
||
56 | |||
57 | /** @var IndexService */ |
||
58 | private $indexService; |
||
59 | |||
60 | /** @var SearchService */ |
||
61 | private $searchService; |
||
62 | |||
63 | /** @var MiscService */ |
||
64 | private $miscService; |
||
65 | |||
66 | /** @var Client */ |
||
67 | private $client; |
||
68 | |||
69 | /** @var Runner */ |
||
70 | private $runner; |
||
71 | |||
72 | |||
73 | /** |
||
74 | * return a unique Id of the platform. |
||
75 | */ |
||
76 | public function getId() { |
||
79 | |||
80 | /** |
||
81 | * return a unique Id of the platform. |
||
82 | */ |
||
83 | public function getName() { |
||
86 | |||
87 | |||
88 | /** |
||
89 | * @return string |
||
90 | */ |
||
91 | public function getVersion() { |
||
94 | |||
95 | |||
96 | /** |
||
97 | * @return array |
||
|
|||
98 | * @throws ConfigurationException |
||
99 | */ |
||
100 | public function getConfiguration() { |
||
115 | |||
116 | |||
117 | /** |
||
118 | * @param Runner $runner |
||
119 | */ |
||
120 | public function setRunner(Runner $runner) { |
||
123 | |||
124 | /** |
||
125 | * @param $action |
||
126 | * |
||
127 | * @throws InterruptException |
||
128 | * @throws TickDoesNotExistException |
||
129 | */ |
||
130 | private function updateRunner($action) { |
||
137 | |||
138 | |||
139 | /** |
||
140 | * @param $line |
||
141 | */ |
||
142 | private function outputRunner($line) { |
||
149 | |||
150 | |||
151 | /** |
||
152 | * Called when loading the platform. |
||
153 | * |
||
154 | * Loading some container and connect to ElasticSearch. |
||
155 | * |
||
156 | * @throws ConfigurationException |
||
157 | * @throws QueryException |
||
158 | */ |
||
159 | public function loadPlatform() { |
||
174 | |||
175 | |||
176 | /** |
||
177 | * not used yet. |
||
178 | */ |
||
179 | public function testPlatform() { |
||
181 | |||
182 | |||
183 | /** |
||
184 | * called before any index |
||
185 | * |
||
186 | * We create a general index. |
||
187 | * |
||
188 | * @param IFullTextSearchProvider $provider |
||
189 | * |
||
190 | * @throws ConfigurationException |
||
191 | */ |
||
192 | public function initializeIndex(IFullTextSearchProvider $provider) { |
||
197 | |||
198 | |||
199 | /** |
||
200 | * resetIndex(); |
||
201 | * |
||
202 | * Called when admin wants to remove an index specific to a $provider. |
||
203 | * $provider can be null, meaning a reset of the whole index. |
||
204 | * |
||
205 | * @param IFullTextSearchProvider|null $provider |
||
206 | * |
||
207 | * @throws ConfigurationException |
||
208 | */ |
||
209 | public function resetIndex($provider) { |
||
219 | |||
220 | |||
221 | /** |
||
222 | * {@inheritdoc} |
||
223 | */ |
||
224 | public function indexDocuments(IFullTextSearchProvider $provider, $documents) { |
||
235 | |||
236 | |||
237 | /** |
||
238 | * {@inheritdoc} |
||
239 | */ |
||
240 | public function indexDocument(IFullTextSearchProvider $provider, IndexDocument $document) { |
||
256 | |||
257 | |||
258 | /** |
||
259 | * @param IFullTextSearchProvider $provider |
||
260 | * @param IndexDocument $document |
||
261 | * @param Exception $e |
||
262 | * |
||
263 | * @return Index |
||
264 | * @throws ConfigurationException |
||
265 | * @throws AccessIsEmptyException |
||
266 | */ |
||
267 | private function indexDocumentError( |
||
285 | |||
286 | |||
287 | /** |
||
288 | * {@inheritdoc} |
||
289 | */ |
||
290 | public function deleteIndexes($indexes) { |
||
297 | |||
298 | |||
299 | /** |
||
300 | * {@inheritdoc} |
||
301 | */ |
||
302 | public function searchDocuments( |
||
313 | |||
314 | |||
315 | /** |
||
316 | * @param string $host |
||
317 | */ |
||
318 | private function connectToElastic($host) { |
||
337 | |||
338 | |||
339 | } |
This check looks for the generic type
array
as a return type and suggests a more specific type. This type is inferred from the actual code.