Operation

The Search Service operates as a web application hosted on a Java Application Server (Apache Tomcat). Once it is deployed, operations include modifying the configuration and leveraging the PDS and PDAP protocols to query data and metadata that has been extracted from the Registry Service (see the Search Core component for more information). The following topics will be covered below:

Administration Interface

The Solr Administration Interface is available for advanced configuration and debugging of the Solr instance. The page can be viewed at http://localhost:8080/search-service. The following resources are available detailing the how to use this interface:

From the query page, you can perform various queries against the available end points supported by the service. Details regarding the supported query parameters can be found on the Common Query Parameters page of the Solr wiki. The most useful of these being the wt parameter. When this parameter is specified as wt=xslt, you can view the output as it is queried from the Search UI and Product Search UI.

Configuration

The Search Service comes preconfigured for supporting common PDS search terms and facets. That said, it can be tailored to support Discipline Node specific search requirements. See the Apache Solr website and wiki for more information on configuring Apache Solr. The sub-sections that follow detail the steps for performing some common configuration changes.

Add A Facet

The following steps will allow a new facet to be added to the Search Service output. The facets are the categories in the left sidebar of the Search UI that provide a means for browsing through the data. The name for the facet should not yet be a field in the schema, because a new field specifically dedicated to the faceting will be created. For instance, if you wanted to facet on agency_name, we will create a facet named facet_agency. These steps assume that the Search Service was installed at /usr/local/search-service. If not, substitute the installation directory as needed. For the following example, we will be creating a facet on the node_id field.

  1. Add the following to the /usr/local/search-service/pds/conf/xslt/facets.xml file:

    <facet name="facet node id" caption="Node" />
                
  2. Update the /usr/local/search-service/pds/conf/xslt/add-hierarchy.xsl file:

    <xsl:template match="field[@name = 'node_id']">
      <xsl:copy-of select="." >
      <field name="facet_node_id"><xsl:value-of select="concat('1,',.)" /></field>
    </xsl:template>
                
  3. Update the /usr/local/search-service/pds/conf/solrconfig_defaults.xml file:

    <str name="facet.field">facet_node_id</str>
    
    <str name="f.facet_node_id.facet.prefix">1,</str>
                
  4. Update the /usr/local/search-service/pds/conf/schema.xml file by finding the area where facet fields are being declared (search for facet_) and add the following:

    <field name="facet_node" type="string_lc" indexed="true" stored="false" \
      multiValued="false" />
                
  5. Restart Tomcat

Update Output Format

The user interface components of the Search Service may also be modified to tailor the look-and-feel of the search results.

  • To update the output queried through the Search UI (archive-filter end point), make updates to the /usr/local/search-service/pds/conf/xslt/data-search.xsl file.
  • To update the output queried through the Product Search UI (product-search end point), make updates to the /usr/local/search-service/pds/conf/xslt/product-search.xsl file.

Add a Field to the Schema

In order to add a field to the schema, modify the /usr/local/search-service/pds/conf/schema.xml file. The following example will add the field my_field:

<field name="my_field" type="text_general" indexed="true" stored="false" \
multiValued="false" />
        

See the Schema XML page of the Solr wiki for more information on update the Solr schema.

Search Protocols

The Search Service provides two protocols for searching the contents of the service.

PDS Search Protocol

See the PDS Search Protocol document for more information on search terms and result formatting provided by this protocol. If viewing this document from the search-service package, view the PDS Search Protocol document from the Engineering Node site.

PDAP Protocol

See the PDAP Search Protocol document for more information on search terms and result formatting provided by this protocol. If viewing this document from the search-service package, view the PDAP Search Protocol document from the Engineering Node site.

Common Errors

org.xml.sax.SAXParseException: A pseudo attribute name is expected.

This error usually means there is a typo in the Search Service Tomcat context file. More specifically, make sure the first line in $TOMCAT_HOME/conf/Catalina/localhost/search-service.xml matches this exactly:

<?xml version="1.0" encoding="utf-8" ?>
        

See the Deploying the Application section in the Install document for more information on creating this file.

Provider net.sf.saxon.TransformerFactoryImpl not found

This error occurs when the saxon-9.jar is not in the classpath. The following are mitigation strategies:

  • Verify the following line is in $TOMCAT_HOME/conf/Catalina/localhost/search-service.xml:
    <Loader className="org.apache.catalina.loader.VirtualWebappLoader" 
        virtualClasspath="/usr/local/search-service/lib/saxon-9.jar"/>
                

    See Deploying the Application in the Install Guide for more information on creating this file.

  • Verify the path specified for virtualClasspath actually exists.

XSLT transformation error java.io.IOException: XSLT transformation error

This error occurs when the CATALINA_OPTS environment variable is not properly set, or set multiple times in the /usr/local/tomcat/catalina.sh file (or /etc/init.d):

export CATALINA_OPTS="${CATALINA_OPTS} -Dsolr.pds.home=/usr/local/search-service"
        

All Searches Return 0 Results

This error occurs when the Search Service is not populated with data. See the Search Core component for information on populating the Search Service.