Sunday, June 14, 2015

Generating Data Feeds from Solr


Solr is the default search engine which comes along with Websphere commerce installation. Apart from using it for implementing search functionality in your website, it can be used for feed generation also, when you don't have enough time to create a new feed generation utility. 

This will be done using the wt parameter passed in the Solr request. Given below is a sample Solr request.

http://localhost/solr/MC_10001_CatalogEntry_en_US/select?q=(*:*)&wt=csv

The wt parameter in the request specifies in which format the Solr response will be generated. When the call happen from WCS application, this field will have value javabin. We can also pass other values such as json, based on which it will generate the response in that particular format.

To generate the feed in csv format, what need to be done is to invoke the above URL from a wrapper application/script, which will generate a csv file, which can be ftp'ed to the required location.

Using Solr for feed generation will be ideal in situations when all the required attributes are already available in Solr search engine and the Solr servers have enough capability to handle this additional load.



No comments:

Post a Comment