Click Fraud Protection
PHP related blog, freelancer to hire!

How to access magento search results externally (Drupal, Joomla, Zend Framework, Symfony etc)

Blast Search Lucene module enables you to get superquick results delivered to external application

Options are:

1) if applications are on the same server you can simply include Magento code and use module method:


$queryText = 'stainless';
$storeId = 1;
$mageFilename = '../path_to_your_magento_document_root/app/Mage.php';
require_once $mageFilename;
$app = Mage::app('default');
$indexer = Mage::getModel('blastlucenesearch/blastlucenesearch');
$products_data= $indexer->getResultsForApi($queryText);


2)use Webservices API to get products

Login to your admin

Go to System-> Webservices -> Roles

Create new role

Enter name and select resource (Php4u) – make sure that Resource access it is set to custom


Then create new user (System -> Webservices -> Roles)

Assign it to newly Created role

Save it

Then you can use Soap or XMLRPC to access search results

$client = new SoapClient('http://YOURDOMAIN/api/soap/?wsdl');
$session = $client->login('lucene', 'lucene'); // your api login details created before
$result = $client->call($session, '', array('sony', 1,)); // query text, store Id

You can test it with our test website at

Leave a Reply