Debugging WebSphere Commerce Search
We can debug WebSphere Commerce Search by directly accessing Solr functions by using a web browser, without using WebSphere Commerce run time or utilities.
Before beginning
Ensure that you complete the following tasks:
Procedure
- Querying Solr in a web browser:
Go to the basic query URL: http://Search_server_host_name:port/solr/core_name/select?q=field_name:search_keyword
- Search for all documents
http://www.mycompany.com:3737/solr/MC_10001_CatalogEntry_en_US/select?q=*:*
- Search for all documents with a catentry_id of 1000
http://www.mycompany.com:3737/solr/MC_10001_CatalogEntry_en_US/select?q=catentry_id:10001
See Querying Data
Build the search index with the Data import Handler (DIH) in a web browser. Go to the basic DIH URL: http://host_name:port/solr/core_name/dataimport?command=DIH_options
- Check DIH status
http://www.mycompany.com:3737/solr/MC_10001_CatalogEntry_en_US/dataimport
Run DIH (full import) http://www.mycompany.com:3737/solr/MC_10001_CatalogEntry_en_US/dataimport?command=full-import
Run DIH (delta import) http://www.mycompany.com:3737/solr/MC_10001_CatalogEntry_en_US/dataimport?command=delta-import
Administer search cores in a web browser: Download the Solr Administration Console from Solr Downloads.
Then, go to the basic core administration URL: http://host_name:port/solr/admin/cores?action=action_option&core=core_name
- Check search core status
http://www.mycompany.com:3737/solr/admin/cores?action=status&core=MC_10001_CatalogEntry_en_US
Reload search core configuration http://www.mycompany.com:3737/solr/admin/cores?action=reload&core=MC_10001_CatalogEntry_en_US
IBM recommends that you merge the admin subdirectory in the SOLR.war file that is downloaded from Apache Solr and merge it into the SOLR.war file that is on the WebSphere Commerce Search server.
See Core Admin.
Manually control replication using the Solr replication enable and disable functions from the master server.
- Disable replication on master for all subordinates
http://master_server:3737/solr/MC_10001_CatalogEntry_en_US/replication?command=disablereplication
Enable replication on master for all subordinates http://master_server:3737/solr/MC_10001_CatalogEntry_en_US/replication?command=enablereplication
See SolrReplication.
We can use Luke to debug the search index, as Luke can open up and inspect each record in the search index. See Luke - Lucene Index Toolbox. Tip: When the search server is restarted, we might encounter an error when you go to the storefront for the first time: The store has encountered a problem processing the last request...The error is due to the Solr server initial configuration, and can be resolved by reloading the store page in your web browser.