Below code use for get search result programetically
$searchText = 'mobile';
$query = Mage::getModel('catalogsearch/query')->loadByQueryText($searchText);
$query->setStoreId(1);
$query = Mage::getModel('catalogsearch/query')->setQueryText($searchText)->prepare();
$fulltextResource = Mage::getResourceModel('catalogsearch/fulltext')->prepareResult(
Mage::getModel('catalogsearch/fulltext'),
$searchText,
$query
);
$collection = Mage::getResourceModel('catalog/product_collection');
$collection->getSelect()->joinInner(
array('search_result' => $collection->getTable('catalogsearch/result')),
$collection->getConnection()->quoteInto(
'search_result.product_id=e.entity_id AND search_result.query_id=?',
$query->getId()
),
array('relevance' => 'relevance')
);
using above code you will get your search result programetically in magento where $searchText is your search value.
Hope this code help you,
Thank you.
$searchText = 'mobile';
$query = Mage::getModel('catalogsearch/query')->loadByQueryText($searchText);
$query->setStoreId(1);
$query = Mage::getModel('catalogsearch/query')->setQueryText($searchText)->prepare();
$fulltextResource = Mage::getResourceModel('catalogsearch/fulltext')->prepareResult(
Mage::getModel('catalogsearch/fulltext'),
$searchText,
$query
);
$collection = Mage::getResourceModel('catalog/product_collection');
$collection->getSelect()->joinInner(
array('search_result' => $collection->getTable('catalogsearch/result')),
$collection->getConnection()->quoteInto(
'search_result.product_id=e.entity_id AND search_result.query_id=?',
$query->getId()
),
array('relevance' => 'relevance')
);
using above code you will get your search result programetically in magento where $searchText is your search value.
Hope this code help you,
Thank you.