| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types = 1); |
||
| 14 | public function index(\SilverStripe\ORM\DataObject $dataObject): void |
||
| 15 | { |
||
| 16 | $payload = $this->getFieldsToIndex($dataObject); |
||
| 17 | $coreClient = new Client(); |
||
| 18 | $client = $coreClient->getConnection(); |
||
| 19 | |||
| 20 | $indexNames = \array_keys($payload); |
||
| 21 | foreach ($indexNames as $indexName) { |
||
| 22 | $indexPayload = $payload[$indexName]; |
||
| 23 | $manticoreIndex = new \Manticoresearch\Index($client, $indexName); |
||
| 24 | $manticoreIndex->replaceDocument($indexPayload, $dataObject->ID); |
||
| 25 | } |
||
| 28 |