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