When you run SOLR with WebSphere Commerce the first step you have to complete is to setup the search index.
However if you are doing this with a remote webserver providing access to the ApplicationServer, you will find that it uses the HOSTNAME of the application server where you run the command as the hostname for for later commands. It also uses it for the configuration on how the pages build within the site, when they want to access the search engine. This means that when you run the buildindex command or the Madisons sample store things will fail, and you will get a remote host error being displayed such as the following when running the buildindex command.
INFO: I/O exception (java.net.ConnectException) caught when processing request:
A remote host refused an attempted connect operation.
04-Jul-2011 21:35:33 org.apache.commons.httpclient.
INFO: Retrying request
org.apache.solr.client.solrj.
It would be nice if on startup the server configuration showed the hostname that would be used for SOLR, it would provide a much quicker clue.
What you need to do is make sure you update the following tables SRCHCONF and SRCHCONFEXT and replace the host name with that of your webserver. Then update the wc-search.xml file found in /xml/config/com.ibm.commerce.catalog-fep in the deployed application, make sure you redeploy the file after changes. You will want to restart the Application servers to pick these details up both your SOLR and Commerce server.
You should then find that your search works fine and you can setup the index. It does need IBM to add an option onto the setupSearchIndex command for hostname, that would remove these steps. Remember if you run the setup command again it will go back to how it was in the DB and the XML file, so you need to make the same changes.
Tags: Config, Search, SOLR, SRCHCONF, WebSphere Commerce