1 | <?php |
||
11 | class Elasticsearch implements SearchIndexHandler |
||
12 | { |
||
13 | /** @var Elasticsearch */ |
||
14 | protected $elasticsearch; |
||
15 | |||
16 | /** @var string */ |
||
17 | protected $indexName; |
||
18 | |||
19 | /** |
||
20 | * @param Client $elasticsearch |
||
21 | */ |
||
22 | public function __construct(Client $elasticsearch) |
||
26 | |||
27 | /** |
||
28 | * Set the name of the index that should be used by default. |
||
29 | * |
||
30 | * @param $indexName |
||
31 | * |
||
32 | * @return $this |
||
33 | */ |
||
34 | public function setIndexName($indexName) |
||
40 | |||
41 | /** |
||
42 | * Add or update the given searchable subject or array of subjects or Traversable object containing subjects. |
||
43 | * |
||
44 | * @param Searchable|array|Traversable $subject |
||
45 | */ |
||
46 | public function upsertToIndex($subject, $indexName = null) |
||
86 | |||
87 | /** |
||
88 | * Remove the given subject from the search index. |
||
89 | * |
||
90 | * @param Searchable $subject |
||
91 | */ |
||
92 | public function removeFromIndex(Searchable $subject, $indexName = null) |
||
104 | |||
105 | /** |
||
106 | * Remove an item from the search index by type and id. |
||
107 | * |
||
108 | * @param string $type |
||
109 | * @param int $id |
||
110 | */ |
||
111 | public function removeFromIndexByTypeAndId($type, $id, $indexName = null) |
||
123 | |||
124 | /** |
||
125 | * Remove everything from the index. |
||
126 | * |
||
127 | * @return mixed |
||
128 | */ |
||
129 | public function clearIndex($indexName = null) |
||
135 | |||
136 | /** |
||
137 | * Get the results for the given query. |
||
138 | * |
||
139 | * @param array $query |
||
140 | * |
||
141 | * @return mixed |
||
142 | */ |
||
143 | public function getResults($query) |
||
147 | |||
148 | /** |
||
149 | * Get the underlying client. |
||
150 | * |
||
151 | * @return Elasticsearch |
||
152 | */ |
||
153 | public function getClient() |
||
157 | |||
158 | protected function resolveIndexName($indexName = null) |
||
166 | } |
||
167 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..