Enabling the Solr administrative interface

You can monitor Solr in WebSphere Commerce search using the Solr administrative interface. The Solr native administrative interface can be used to gather runtime statistics for each Solr core that is running on the search server. It can also be used to perform simple search queries.

Before you begin

Download the supported Solr package from Apache. It contains an admin directory in Solr.war.
WebSphere Commerce search uses the following high-level software stack:
WebSphere Commerce Feature Pack version Solr version Lucene index file format version
  • Feature Pack 2
  • Feature Pack 3
  • Feature Pack 4
1.4.0 2.9.4
  • Feature Pack 5
  • Feature Pack 6
3.5.0 3.5.0
Feature Pack 7 4.3.0 4.2.0
Feature Pack 8 4.7.0 4.6.0

About this task

The Solr administrative interface can be enabled on BOD-based and REST-based search deployments. However, it does not support workspace cores. When using the interface, you must request the status of each specific core. That is, if requesting the status of the full set of cores (which includes workspaces), an exception will be thrown.

For more information, see SolrAdminGUI.

Procedure

  • Feature Pack 4Feature Pack 2Feature Pack 5Feature Pack 3Feature Pack 6 To enable the Solr administrative interface on a BOD-based search deployment:
    1. Deploy the admin files under Solr.war/admin.
    2. Add the following webcontainer custom property:
      
      name = com.ibm.ws.webcontainer.invokeFiltersCompatibility 
      value = true
      
      WebSphere Commerce Developer
      name = com.ibm.ws.webcontainer.invokeFiltersCompatibility 
      value = true
    3. Update the following files:
      • WebSphere Commerce DeveloperSolr.war/WEB-INF/web.xml
      • Solr.war/WEB-INF/web.xml
      • Solr_cell/applications/solr.ear/deployments/solr/Solr.war/WEB-INF/web.xml
    4. Change the pattern from /* to /solr/*.
      For example:
      
      <servlet-mapping>
           <servlet-name>SolrServer</servlet-name>
             <url-pattern>/solr/*</url-pattern>
      </servlet-mapping>
      
    5. Save your changes and close the files.
  • Feature Pack 7 or later To enable the Solr administrative interface on a REST-based search deployment:
    1. Import the Search_eardir/Search-Solr.war project into your workspace.
      Important: If you are enabling the Solr administrative interface in a runtime environment, do not perform step 1.
    2. Copy the following directories and files from the downloaded Solr.war file into the Search-Solr/WebContent directory:
      • css
      • img
      • js
      • tpl
      • admin.html
      • favicon.ico
      Alternatively, to enable the Solr administrative interface in a runtime environment, perform the steps to the following locations:
      • WAS_installdir/profiles/demo_solr/config/cells/demo_search_cell/applications/Search_demo.ear/deployments/Search_demo/Search-Solr.war
      • Solr_cell/applications/solr.ear/deployments/solr/Search-Solr.war/WEB-INF
    3. Open the Search-Solr/WEB-INF/ibm-web-ext.xml file for editing.
    4. Find the enable-file-serving flag and set it to true.
      For example:
      
      <web-ext
         xmlns="http://websphere.ibm.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-web-ext_1_0.xsd"
         version="1.0">
      
         <reload-interval value="3"/>
         <context-root uri="/solr" />
         <enable-directory-browsing value="false"/>
         <enable-file-serving value="true"/>
         <enable-reloading value="false"/>
         <enable-serving-servlets-by-class-name value="false" />
      
      </web-ext>
      
    5. Save your changes and close the files.
    6. Deploy the Search-Solr project; Right-click the project and select Java EE > Prepare for Deployment.
      Important: If you are enabling the Solr administrative interface in a runtime environment, do not perform step 6.
    7. Update the following files:
      • WebSphere Commerce DeveloperSearch_eardir/Search-Solr.war/WEB-INF/web.xml
      • Search-Solr.war/WEB-INF/web.xml
      • WAS_installdir/profiles/demo_solr/config/cells/demo_search_cell/applications/Search_demo.ear/deployments/Search_demo/Search-Solr.war/WEB-INF/web.xm
    8. Change the URL pattern for the SolrSearchServlet servlet:
      • Feature Pack 7Change it to /Search-Solr
      • Feature Pack 8Change it to /solr
      For example:Feature Pack 7
      
      <servlet-mapping>
           <servlet-name>SolrSearchServlet</servlet-name>
             <url-pattern>/Search-Solr</url-pattern>
      </servlet-mapping>
      
      Feature Pack 8
      
      <servlet-mapping>
           <servlet-name>SolrSearchServlet</servlet-name>
             <url-pattern>/solr</url-pattern>
      </servlet-mapping>
      
    9. Save your changes and close the files.
    10. Publish the search EAR.
      Important: If you are enabling the Solr administrative interface in a runtime environment, do not perform step 10.
    11. Restart the search server.
    12. Use the following URL to access the Solr administrative interface:
      • Feature Pack 7http://localhost/Search-Solr/admin.html
      • Feature Pack 8http://hostname:3737/solr/admin.html