Merge branch 'trunk'
This commit is contained in:
commit
e2b70f3e6f
1 changed files with 5 additions and 9 deletions
|
|
@ -114,16 +114,12 @@ class XmlArcadiaMediasIn extends XmlJobs
|
|||
$arcadiaLink->delete();
|
||||
}
|
||||
|
||||
// * Index ElasticSearch
|
||||
$esExist = Media::searchByQuery([
|
||||
'match' => ['arcadia_id' => $media->arcadia_id ?? '']
|
||||
]);
|
||||
// * Remove all from elastic if any duplicates
|
||||
if ($esExist->totalHits() > 0) {
|
||||
$media->removeFromIndex();
|
||||
$media->removeFromIndex();
|
||||
if (!$media->trashed()) {
|
||||
// * Save into elastic
|
||||
$media->addToIndex();
|
||||
}
|
||||
// * Save into elastic
|
||||
$media->addToIndex();
|
||||
|
||||
} catch (\Exception $e) {
|
||||
$report = new ElasticSearchException(
|
||||
'Something went wrong when updating media into elastic search',
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue