Skip to content

Commit 8a9cd47

Browse files
committed
Never use flat tables as source for product index
1 parent 624fb0c commit 8a9cd47

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/app/code/community/IntegerNet/Solr/Model/Resource/Catalog/Product/Indexing/Collection.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
*/
1010
class IntegerNet_Solr_Model_Resource_Catalog_Product_Indexing_Collection extends Mage_Catalog_Model_Resource_Product_Collection
1111
{
12+
public function isEnabledFlat()
13+
{
14+
return false;
15+
}
16+
1217
/**
1318
* Join Product Price Table
1419
* Join left by default in order to include products without price index entry

src/app/code/community/IntegerNet/Solr/Test/Model/Indexer/Product.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* @loadFixture registry
1515
* @loadFixture config
1616
*/
17-
class IntegerNet_Solr_Test_Model_Indexer_Product extends EcomDev_PHPUnit_Test_Case_Controller
17+
class IntegerNet_Solr_Test_Model_Indexer_Product extends IntegerNet_Solr_Test_Controller_Abstract
1818
{
1919
/**
2020
* @param array $config
@@ -41,6 +41,8 @@ public function invalidSwapConfigurationShouldThrowException(array $config)
4141
*/
4242
public function saveProductShouldUpdateSolrIndex()
4343
{
44+
$this->setUpFreshIndex();
45+
4446
$this->setCurrentStore(0);
4547
$this->adminSession();
4648
$productId = 21001;
@@ -72,4 +74,11 @@ public function searchFor($queryText)
7274
);
7375
return $searchRequestFactory->createRequest()->doRequest();
7476
}
77+
78+
private function setUpFreshIndex()
79+
{
80+
Mage::getModel('integernet_solr/indexer')->reindexAll();
81+
$indexProcess = Mage::getModel('index/process')->load('integernet_solr', 'indexer_code');
82+
$indexProcess->setMode(Mage_Index_Model_Process::MODE_REAL_TIME)->save();
83+
}
7584
}

0 commit comments

Comments
 (0)