Enabling the Solr administrative interface

You can monitor Solr in HCL 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

  1. Download the supported Solr package from Apache. The archive file solr-7.3.1.zip contains a /solr-7.3.1/server/solr-webapp/webapp directory.

    For more information about the Apache graphical user interface, see SolrAdminGUI.

  2. Import the Search_eardir/search-solr.war project into your workspace.
  3. Select the following directories and files from the downloaded solr-7.3.1.zip file. You will copy them into one of two locations, depending on whether you are working in a developer or runtime environment.
    • css
    • img
    • js
    • libs
    • partials
    • index.html
    • favicon.ico

Procedure

  • Setting up the Solr administrative interface in a development environment
    1. Place the files in the Search-Solr/WebContent directory.
    2. Open the Search-Solr/WebContent/WEB-INF/ibm-web-ext.xml file for editing.
    3. Find the enable-file-serving property 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>
      
    4. Save your changes and close the file.
    5. Right-click the search-solr project and select Properties > Web Project Settings. Set the context root to /solr.
    6. Update the search-solr.war/WEB-INF/web.xml file. Change the URL pattern for the SolrSearchServlet servlet to /solr.
      For example:
      
      <servlet-mapping>
           <servlet-name>SolrSearchServlet</servlet-name>
             <url-pattern>/solr</url-pattern>
      </servlet-mapping>
      
    7. Save your changes and close the file.
    8. Publish the search EAR.
  • Setting up the Solr administrative interface in a runtime environment
    1. Copy the files from solr-7.3.1.zip to the /profile/apps/search-ear.ear/search-solr.war/ directory.
    2. Edit the /profile/apps/search-ear.ear/search-solr.war/WEB-INF/ibm-web-ext.xml file.
    3. Find the enable-file-serving property 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>
      
    4. Save your changes and close the files.
    5. Update the /profile/apps/search-ear.ear/search-solr.war/WEB-INF/web.xml file. Change the URL pattern for the SolrSearchServlet servlet to /solr.
      For example:
      
      <servlet-mapping>
           <servlet-name>SolrSearchServlet</servlet-name>
             <url-pattern>/solr</url-pattern>
      </servlet-mapping>
      
    6. Save your changes and close the file.
    7. Restart the Search container.

Results

Use the following URL to access the Solr administrative interface:http://hostname:3737/solr/index.html