Version Notes
This version is compatible with Magento 1.4.
Download this release
Release Info
Developer | Magento Core Team |
Extension | Sonassi_FastSearchIndex |
Version | 1.0.5 |
Comparing to | |
See all releases |
Code changes from version 1.0.4 to 1.0.5
- app/code/community/Sonassi/FastSearchIndex/Block/Index/Adminhtml/Process.php +47 -47
- app/code/community/Sonassi/FastSearchIndex/controllers/AdminController.php +39 -32
- app/code/community/Sonassi/FastSearchIndex/controllers/IndexController.php +0 -87
- app/code/community/Sonassi/FastSearchIndex/etc/config.xml +33 -33
- package.xml +5 -5
app/code/community/Sonassi/FastSearchIndex/Block/Index/Adminhtml/Process.php
CHANGED
@@ -1,47 +1,47 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
-
* DISCLAIMER
|
16 |
-
*
|
17 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
-
* versions in the future. If you wish to customize Magento for your
|
19 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
-
*
|
21 |
-
* @category Mage
|
22 |
-
* @package Mage_Index
|
23 |
-
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
|
24 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
-
*/
|
26 |
-
|
27 |
-
class Sonassi_FastSearchIndex_Block_Index_Adminhtml_Process extends Mage_Index_Block_Adminhtml_Process
|
28 |
-
{
|
29 |
-
public function __construct()
|
30 |
-
{
|
31 |
-
$this->_blockGroup = 'index';
|
32 |
-
$this->_controller = 'adminhtml_process';
|
33 |
-
$this->_headerText = Mage::helper('index')->__('Index Management');
|
34 |
-
$this->_addButton('refresh_search', array(
|
35 |
-
'label' => Mage::helper('index')->__('Sonassi Catalog Search Index'),
|
36 |
-
'onclick' => 'setLocation(\'' . $this->getRefreshUrl() . '\')',
|
37 |
-
'class' => 'save'
|
38 |
-
), 10);
|
39 |
-
Mage_Adminhtml_Block_Widget_Grid_Container::__construct();
|
40 |
-
$this->_removeButton('add');
|
41 |
-
}
|
42 |
-
public function getRefreshUrl() {
|
43 |
-
|
44 |
-
return $this->getUrl('fastsearchindex/admin/refreshSearch');
|
45 |
-
|
46 |
-
}
|
47 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category Mage
|
22 |
+
* @package Mage_Index
|
23 |
+
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
|
24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
class Sonassi_FastSearchIndex_Block_Index_Adminhtml_Process extends Mage_Index_Block_Adminhtml_Process
|
28 |
+
{
|
29 |
+
public function __construct()
|
30 |
+
{
|
31 |
+
$this->_blockGroup = 'index';
|
32 |
+
$this->_controller = 'adminhtml_process';
|
33 |
+
$this->_headerText = Mage::helper('index')->__('Index Management');
|
34 |
+
$this->_addButton('refresh_search', array(
|
35 |
+
'label' => Mage::helper('index')->__('Sonassi Catalog Search Index'),
|
36 |
+
'onclick' => 'setLocation(\'' . $this->getRefreshUrl() . '\')',
|
37 |
+
'class' => 'save'
|
38 |
+
), 10);
|
39 |
+
Mage_Adminhtml_Block_Widget_Grid_Container::__construct();
|
40 |
+
$this->_removeButton('add');
|
41 |
+
}
|
42 |
+
public function getRefreshUrl() {
|
43 |
+
|
44 |
+
return $this->getUrl('fastsearchindex/admin/refreshSearch');
|
45 |
+
|
46 |
+
}
|
47 |
+
}
|
app/code/community/Sonassi/FastSearchIndex/controllers/AdminController.php
CHANGED
@@ -1,33 +1,40 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Sonassi_FastSearchIndex_AdminController extends Mage_Adminhtml_Controller_Action
|
4 |
-
{
|
5 |
-
|
6 |
-
public function refreshSearchAction()
|
7 |
-
{
|
8 |
-
// fetch write database connection that is used in Mage_Core module
|
9 |
-
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
|
10 |
-
|
11 |
-
// now $write is an instance of Zend_Db_Adapter_Abstract
|
12 |
-
$write->query("UPDATE `index_process` SET status = 'working', started_at = NOW() WHERE indexer_code = 'catalogsearch_fulltext'");
|
13 |
-
|
14 |
-
$
|
15 |
-
|
16 |
-
$nameAttributeId = Mage::getModel('eav/entity_attribute')->loadByCode('catalog_product','name')->getAttributeId();
|
17 |
-
$descAttributeId = Mage::getModel('eav/entity_attribute')->loadByCode('catalog_product','description')->getAttributeId();
|
18 |
-
|
19 |
-
$query = "TRUNCATE `catalogsearch_fulltext`;
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Sonassi_FastSearchIndex_AdminController extends Mage_Adminhtml_Controller_Action
|
4 |
+
{
|
5 |
+
|
6 |
+
public function refreshSearchAction()
|
7 |
+
{
|
8 |
+
// fetch write database connection that is used in Mage_Core module
|
9 |
+
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
|
10 |
+
|
11 |
+
// now $write is an instance of Zend_Db_Adapter_Abstract
|
12 |
+
$write->query("UPDATE `index_process` SET status = 'working', started_at = NOW() WHERE indexer_code = 'catalogsearch_fulltext'");
|
13 |
+
|
14 |
+
$allStores = Mage::app()->getStores();
|
15 |
+
|
16 |
+
$nameAttributeId = Mage::getModel('eav/entity_attribute')->loadByCode('catalog_product','name')->getAttributeId();
|
17 |
+
$descAttributeId = Mage::getModel('eav/entity_attribute')->loadByCode('catalog_product','description')->getAttributeId();
|
18 |
+
|
19 |
+
$query = "TRUNCATE `catalogsearch_fulltext`;";
|
20 |
+
foreach ($allStores as $_eachStoreId => $val) {
|
21 |
+
$query .= "INSERT INTO catalogsearch_fulltext (product_id, store_id, data_index)
|
22 |
+
SELECT DISTINCT ca_ent.entity_id as product_id, ".$_eachStoreId." as store_id,
|
23 |
+
CONCAT(ifnull(ca_var.value,''),' ',ifnull(ca_ent.sku,''), ' ',
|
24 |
+
ifnull((SELECT GROUP_CONCAT( ca_ent2.sku) FROM `catalog_product_entity` ca_ent2 LEFT JOIN `catalog_product_super_link` ca_sup ON ca_sup.product_id = ca_ent2.entity_id WHERE ca_sup.parent_id = ca_ent.entity_id GROUP BY ca_sup.parent_id),'') ,' ',
|
25 |
+
ifnull((SELECT GROUP_CONCAT( ca_ent3.sku) FROM `catalog_product_entity` ca_ent3 LEFT JOIN `catalog_product_link` ca_lin ON ca_lin.linked_product_id = ca_ent3.entity_id WHERE ca_lin.product_id = ca_ent.entity_id GROUP BY ca_lin.product_id),'') ,' ',
|
26 |
+
ifnull(ca_text.value,'')) as data_index
|
27 |
+
FROM `catalog_product_entity` ca_ent LEFT JOIN `catalog_product_entity_varchar` ca_var ON ca_var.entity_id = ca_ent.entity_id AND ca_var.attribute_id = ".$nameAttributeId."
|
28 |
+
LEFT JOIN `catalog_product_entity_text` ca_text ON ca_text.entity_id = ca_ent.entity_id AND ca_text.attribute_id = ".$descAttributeId."
|
29 |
+
;";
|
30 |
+
}
|
31 |
+
|
32 |
+
// now $write is an instance of Zend_Db_Adapter_Abstract
|
33 |
+
$write->query($query);
|
34 |
+
|
35 |
+
$write->query("UPDATE `index_process` SET status = 'pending', ended_at = NOW() WHERE indexer_code = 'catalogsearch_fulltext'");
|
36 |
+
|
37 |
+
Mage::getSingleton('core/session')->addSuccess(Mage::helper('index')->__('%s index was rebuilt.', 'Catalog Search Index'));
|
38 |
+
$this->_redirect('adminhtml/process/list/');
|
39 |
+
}
|
40 |
}
|
app/code/community/Sonassi/FastSearchIndex/controllers/IndexController.php
DELETED
@@ -1,87 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
-
* DISCLAIMER
|
16 |
-
*
|
17 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
-
* versions in the future. If you wish to customize Magento for your
|
19 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
-
*
|
21 |
-
* @category Mage
|
22 |
-
* @package Mage_Customer
|
23 |
-
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
|
24 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
-
*/
|
26 |
-
|
27 |
-
|
28 |
-
/**
|
29 |
-
* Sonassi FastSearchIndex Controller
|
30 |
-
*
|
31 |
-
* @category FastSearchIndex
|
32 |
-
* @package Sonassi_FastSearchIndex
|
33 |
-
* @author Sonassi Team <contact@sonassi.com>
|
34 |
-
*/
|
35 |
-
class Sonassi_FastSearchIndex_IndexController extends Mage_Adminhtml_Controller_Action
|
36 |
-
{
|
37 |
-
protected function _initAction()
|
38 |
-
{
|
39 |
-
$this->loadLayout()
|
40 |
-
->_setActiveMenu('domains/manage')
|
41 |
-
->_addBreadcrumb(Mage::helper('domains')->__('Domains'), Mage::helper('domains')->__('Domains'));
|
42 |
-
return $this;
|
43 |
-
}
|
44 |
-
|
45 |
-
public function indexAction()
|
46 |
-
{
|
47 |
-
exit('lol');
|
48 |
-
$this->_title($this->__('domains'))->_title($this->__('Manage Domains'));
|
49 |
-
|
50 |
-
$this->_initAction();
|
51 |
-
|
52 |
-
$this->_headerText = Mage::helper('domains')->__('Customers Reviews');
|
53 |
-
|
54 |
-
$this->renderLayout();
|
55 |
-
}
|
56 |
-
|
57 |
-
public function refreshSearchAction()
|
58 |
-
{
|
59 |
-
|
60 |
-
// fetch write database connection that is used in Mage_Core module
|
61 |
-
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
|
62 |
-
|
63 |
-
// now $write is an instance of Zend_Db_Adapter_Abstract
|
64 |
-
$write->query("UPDATE `index_process` SET status = 'working', started_at = NOW() WHERE indexer_code = 'catalogsearch_fulltext'");
|
65 |
-
|
66 |
-
$storeId = Mage::app()->getStore()->getId();
|
67 |
-
|
68 |
-
$nameAttributeId = Mage::getModel('eav/entity_attribute')->loadByCode('catalog_product','name')->getAttributeId();
|
69 |
-
$descAttributeId = Mage::getModel('eav/entity_attribute')->loadByCode('catalog_product','description')->getAttributeId();
|
70 |
-
|
71 |
-
$query = "TRUNCATE `catalogsearch_fulltext`;
|
72 |
-
INSERT INTO catalogsearch_fulltext (product_id, store_id, data_index)
|
73 |
-
SELECT ca_ent.entity_id, ".$storeId.", CONCAT(ifnull(ca_var.value,''),' ',ifnull(ca_ent.sku,''), ' ',ifnull(ca_text.value,''))
|
74 |
-
FROM `catalog_product_entity` ca_ent LEFT JOIN `catalog_product_entity_varchar` ca_var ON ca_var.entity_id = ca_ent.entity_id AND ca_var.attribute_id = ".$nameAttributeId."
|
75 |
-
LEFT JOIN `catalog_product_entity_text` ca_text ON ca_text.entity_id = ca_ent.entity_id AND ca_text.attribute_id = ".$descAttributeId."";
|
76 |
-
|
77 |
-
// now $write is an instance of Zend_Db_Adapter_Abstract
|
78 |
-
$write->query($query);
|
79 |
-
|
80 |
-
$write->query("UPDATE `index_process` SET status = 'pending', ended_at = NOW() WHERE indexer_code = 'catalogsearch_fulltext'");
|
81 |
-
|
82 |
-
Mage::getSingleton('core/session')->addSuccess(Mage::helper('index')->__('%s index was rebuilt.', 'Catalog Search Index'));
|
83 |
-
$this->_redirect('adminhtml/process/list/',array('key'=>$this->getRequest()->getParam('key')));
|
84 |
-
}
|
85 |
-
|
86 |
-
}
|
87 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Sonassi/FastSearchIndex/etc/config.xml
CHANGED
@@ -1,34 +1,34 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<config>
|
3 |
-
<modules>
|
4 |
-
<Sonassi_FastSearchIndex>
|
5 |
-
<version>1.0.
|
6 |
-
<depends>
|
7 |
-
<!-- no dependencies -->
|
8 |
-
</depends>
|
9 |
-
</Sonassi_FastSearchIndex>
|
10 |
-
</modules>
|
11 |
-
<global>
|
12 |
-
<models />
|
13 |
-
<resources />
|
14 |
-
<extraconfig />
|
15 |
-
<blocks>
|
16 |
-
<index>
|
17 |
-
<rewrite>
|
18 |
-
<adminhtml_process>Sonassi_FastSearchIndex_Block_Index_Adminhtml_Process</adminhtml_process>
|
19 |
-
</rewrite>
|
20 |
-
</index>
|
21 |
-
</blocks>
|
22 |
-
</global>
|
23 |
-
<admin>
|
24 |
-
<routers>
|
25 |
-
<fastsearchindex>
|
26 |
-
<use>admin</use>
|
27 |
-
<args>
|
28 |
-
<module>Sonassi_FastSearchIndex</module>
|
29 |
-
<frontName>fastsearchindex</frontName>
|
30 |
-
</args>
|
31 |
-
</fastsearchindex>
|
32 |
-
</routers>
|
33 |
-
</admin>
|
34 |
</config>
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Sonassi_FastSearchIndex>
|
5 |
+
<version>1.0.4</version>
|
6 |
+
<depends>
|
7 |
+
<!-- no dependencies -->
|
8 |
+
</depends>
|
9 |
+
</Sonassi_FastSearchIndex>
|
10 |
+
</modules>
|
11 |
+
<global>
|
12 |
+
<models />
|
13 |
+
<resources />
|
14 |
+
<extraconfig />
|
15 |
+
<blocks>
|
16 |
+
<index>
|
17 |
+
<rewrite>
|
18 |
+
<adminhtml_process>Sonassi_FastSearchIndex_Block_Index_Adminhtml_Process</adminhtml_process>
|
19 |
+
</rewrite>
|
20 |
+
</index>
|
21 |
+
</blocks>
|
22 |
+
</global>
|
23 |
+
<admin>
|
24 |
+
<routers>
|
25 |
+
<fastsearchindex>
|
26 |
+
<use>admin</use>
|
27 |
+
<args>
|
28 |
+
<module>Sonassi_FastSearchIndex</module>
|
29 |
+
<frontName>fastsearchindex</frontName>
|
30 |
+
</args>
|
31 |
+
</fastsearchindex>
|
32 |
+
</routers>
|
33 |
+
</admin>
|
34 |
</config>
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Sonassi_FastSearchIndex</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license>Under licence from Sonassi.com</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Sonassi Fast Search Index extension</summary>
|
10 |
<description>The Sonassi Fast Search Index extension allows you to quickly refresh your catalogfullsearch index if you have a big catalog.</description>
|
11 |
-
<notes>This version is compatible with Magento 1.
|
12 |
<authors><author><name>Ben Lessani</name><user>auto-converted</user><email>contact@sonassi.com</email></author></authors>
|
13 |
-
<date>2011-01-
|
14 |
-
<time>
|
15 |
-
<contents><target name="mageetc"><dir name="modules"><file name="Sonassi_FastSearchIndex.xml" hash="e6d150b19bc71606818ebe9fca9549ac"/></dir></target><target name="magecommunity"><dir name="Sonassi"><dir name="FastSearchIndex"><dir name="Block"><dir name="Index"><dir name="Adminhtml"><file name="Process.php" hash="
|
16 |
<compatible/>
|
17 |
<dependencies/>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Sonassi_FastSearchIndex</name>
|
4 |
+
<version>1.0.5</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>Under licence from Sonassi.com</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Sonassi Fast Search Index extension</summary>
|
10 |
<description>The Sonassi Fast Search Index extension allows you to quickly refresh your catalogfullsearch index if you have a big catalog.</description>
|
11 |
+
<notes>This version is compatible with Magento 1.4.</notes>
|
12 |
<authors><author><name>Ben Lessani</name><user>auto-converted</user><email>contact@sonassi.com</email></author></authors>
|
13 |
+
<date>2011-01-13</date>
|
14 |
+
<time>14:22:06</time>
|
15 |
+
<contents><target name="mageetc"><dir name="modules"><file name="Sonassi_FastSearchIndex.xml" hash="e6d150b19bc71606818ebe9fca9549ac"/></dir></target><target name="magecommunity"><dir name="Sonassi"><dir name="FastSearchIndex"><dir name="Block"><dir name="Index"><dir name="Adminhtml"><file name="Process.php" hash="c2231327bad7e985049c8728576637f4"/></dir></dir></dir><dir name="controllers"><file name="AdminController.php" hash="be4909167d231fa115eb0c1240672a0d"/></dir><dir name="etc"><file name="config.xml" hash="fd730537aae5d4a46cc99623d1c840c5"/></dir></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies/>
|
18 |
</package>
|