I am using Mirasvit Sphinx Search with good success. However, I would like to handle certain types of requests using my own controller, from which I would perform a search and process the search results. (I want to call, not override, the Mirasvit Sphinx Search controller.) I am able to trigger my own controller. How do I call the Mirasvit Sphinx Search code and process the search results?


From your controller action:

// Mirasvit Sphinx Search gets search string from request object so
// explicitly set search string on request object.
Mage::app()->getRequest()->setParam('q', 'query-string');

// Get Mirasvit Sphinx Search results.
$collection = Mage::helper('searchindex/index')->getIndex('mage_catalog_product')->getCollection();

Then work with $collection as you would any other product collection in Magento.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.