File tree Expand file tree Collapse file tree 4 files changed +26
-0
lines changed Expand file tree Collapse file tree 4 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -188,6 +188,11 @@ public function getCurrentIndex()
188188 */
189189 public function reindexAll ()
190190 {
191+ $ helper = Mage::helper ('smile_elasticsearch ' );
192+
193+ if (!$ helper ->isActiveEngine ()) {
194+ return ;
195+ }
191196 $ index = $ this ->getCurrentIndex ();
192197
193198 $ index ->prepareNewIndex ();
Original file line number Diff line number Diff line change @@ -116,6 +116,11 @@ protected function _registerEvent(Mage_Index_Model_Event $event)
116116 */
117117 public function reindexAll ()
118118 {
119+ $ helper = Mage::helper ('smile_elasticsearch ' );
120+ if (!$ helper ->isActiveEngine ()) {
121+ return ;
122+ }
123+
119124 /** Reindex all data from search terms custom positions index */
120125 $ engine = Mage::helper ('catalogsearch ' )->getEngine ();
121126 $ mapping = $ engine ->getCurrentIndex ()->getMapping ('product ' );
Original file line number Diff line number Diff line change 1818 */
1919class Smile_ElasticSearch_Model_Observer
2020{
21+ private $ _factory ;
22+
23+ public function __construct ($ services = [])
24+ {
25+ if (isset ($ services ['factory ' ]) && $ services ['factory ' ] instanceof Mage_Core_Model_Factory) {
26+ $ this ->_factory = $ services ['factory ' ];
27+ } else {
28+ $ this ->_factory = new Mage_Core_Model_Factory ();
29+ }
30+ }
31+
2132 /**
2233 * Adds search weight parameter in attribute form.
2334 *
Original file line number Diff line number Diff line change @@ -125,6 +125,11 @@ protected function _registerEvent(Mage_Index_Model_Event $event)
125125 */
126126 public function reindexAll ()
127127 {
128+ $ helper = Mage::helper ('smile_elasticsearch ' );
129+ if (!$ helper ->isActiveEngine ()) {
130+ return ;
131+ }
132+
128133 /** Reindex all data from search terms custom positions index */
129134 $ engine = Mage::helper ('catalogsearch ' )->getEngine ();
130135 $ mapping = $ engine ->getCurrentIndex ()->getMapping ('product ' );
You can’t perform that action at this time.
0 commit comments