After upgrading the magento search is not working.
I tried this https://magento.stackexchange.com/a/67952
SELECT
e
.*,search_result
.relevance
,price_index
.price
,price_index
.tax_class_id
,price_index
.final_price
, IF(price_index.tier_price IS NOT NULL, LEAST(price_index.min_price, price_index.tier_price), price_index.min_price) ASminimal_price
,price_index
.min_price
,price_index
.max_price
,price_index
.tier_price
,cat_index
.position
AScat_index_position
FROMcatalog_product_entity
ASe
INNER JOINcatalogsearch_result
ASsearch_result
ON search_result.product_id=e.entity_id AND search_result.query_id='43'
INNER JOINcatalog_product_index_price
ASprice_index
ON price_index.entity_id = e.entity_id AND price_index.website_id = '1' AND price_index.customer_group_id = 0
INNER JOINcatalog_category_product_index
AScat_index
ON cat_index.product_id=e.entity_id AND cat_index.store_id='1' AND cat_index.visibility IN(3, 4) AND cat_index.category_id = '2'
Result:
Array (
[class] => Mage_CatalogSearch_Model
[resourceModel] => catalogsearch_resource
[rewrite] => Mage_Core_Model_Config_Element Object
(
[layer_filter_attribute] => WeltPixel_LayeredNavigation_Model_CatalogSearch_Layer_Filter_Attribute
)
)
When I checked the tables, I can find that catalogsearch_result
table seems always empty. But catalogsearch_query and catalogsearch_fulltext
tables have content.
Why this table shows empty?
How can I fix that?
Best Answer
In Magento 1.9.3.x,
catalogsearch_result
table is NO longer used I think.There are minor differences/changes in
CatalogSearch
module in 1.9.3.x and 1.9.0.x versions.You can check
app\code\core\Mage\CatalogSearch\Model\Fulltext.php
, here NEW property_foundData
is added which holds FullText search results instead saving incatalogsearch_result
table.Check
prepareResult
method of both versions,In 1.9.3.x versions,
In 1.9.0.x versions,
What should be done now (for 1.9.3.x versions) ?
You can use
getFoundData
method of this class to get results :Here
$prod_ids
is an Array variable which contains Product Id and No. of count as Key=>Value pair.