Skip to content

Commit 73224d9

Browse files
committed
added ability to blacklist special indexes to e.g. skip cobby or catalogsearch_fulltext if solr is used
1 parent e0675f5 commit 73224d9

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

app/code/community/Hackathon/AsyncIndex/Model/Observer.php

+7
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,9 @@ public function runIndex() {
189189
return null;
190190
}
191191

192+
$blacklistCfg = Mage::getStoreConfig('system/asyncindex/blacklist_indexes');
193+
$blacklist = explode(',', $blacklistCfg);
194+
192195
$partialIndex = Mage::getStoreConfig('system/asyncindex/partial_cron_index');
193196

194197
if($partialIndex) {
@@ -198,6 +201,10 @@ public function runIndex() {
198201

199202
/** @var Mage_Index_Model_Process $process */
200203
foreach ($pCollection as $process) {
204+
if ( in_array($process->getIndexerCode(), $blacklist) )
205+
{
206+
continue;
207+
}
201208
$indexManager->executePartialIndex($process);
202209
}
203210

app/code/community/Hackathon/AsyncIndex/etc/system.xml

+9
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,15 @@
5050
<show_in_store>0</show_in_store>
5151
<comment>When enabled the automated cron will perform indexing using Partial Indexing</comment>
5252
</partial_cron_index>
53+
<blacklist_indexes>
54+
<label>Indexcodes which shall not be processed</label>
55+
<comment>Commaseparated; e.g. "catalogsearch_fulltext,tag_summary"</comment>
56+
<frontend_type>text</frontend_type>
57+
<sort_order>50</sort_order>
58+
<show_in_default>1</show_in_default>
59+
<show_in_website>0</show_in_website>
60+
<show_in_store>0</show_in_store>
61+
</blacklist_indexes>
5362
</fields>
5463
</asyncindex>
5564
</groups>

0 commit comments

Comments
 (0)