diff --git a/src/Service.php b/src/Service.php index f4a93a8..911d83e 100644 --- a/src/Service.php +++ b/src/Service.php @@ -407,7 +407,7 @@ public function getIndexData(Concrete $object) } $checksum = crc32(json_encode($data)); - $data['checksum'] = $checksum; + $data[$this->indexNamePrefix.'checksum'] = $checksum; return [ 'index' => $this->getIndexName($object->getClassName()), @@ -439,7 +439,7 @@ public function doUpdateIndexData(Concrete $object, $ignoreUpdateQueue = false) try { $indexDocument = $this->getClient()->get($params); - $originalChecksum = $indexDocument['_source']['checksum'] ?? -1; + $originalChecksum = $indexDocument['_source'][$this->indexNamePrefix.'checksum'] ?? -1; } catch (Exception $e) { $this->logger->debug($e->getMessage()); $originalChecksum = -1; @@ -447,7 +447,7 @@ public function doUpdateIndexData(Concrete $object, $ignoreUpdateQueue = false) $indexUpdateParams = $this->getIndexData($object); - if ($indexUpdateParams['body']['checksum'] != $originalChecksum) { + if ($indexUpdateParams['body'][$this->indexNamePrefix.'checksum'] != $originalChecksum) { $this->getClient()->index($indexUpdateParams); $this->logger->info('Updates es index for data object ' . $object->getId()); $this->getClient()->index($indexUpdateParams);