We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 6c9bb9f + 19ec3cc commit b271a75Copy full SHA for b271a75
src/ElasticaSearchable.php
@@ -44,6 +44,15 @@ public function onAfterPublish() {
44
$this->reIndex('Live');
45
}
46
47
+ public function onBeforeUnpublish()
48
+ {
49
+ // We need to remove the `live` index from the search. Because we're not
50
+ // going through the `reIndex` methods and the `getElasticaDocument` is
51
+ // called from `Heyday\Elastica::remove`, we need to set the `liveIndex`
52
+ // flage here.
53
+ $this->liveIndex = true;
54
+ }
55
+
56
public function getElasticaFields() {
57
$result = parent::getElasticaFields();
58
0 commit comments