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:
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.
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.
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.
Add the following to the /usr/local/search-service/pds/conf/xslt/facets.xml file:
<facet name="facet node id" caption="Node" />
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>
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>
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" />
The user interface components of the Search Service may also be modified to tailor the look-and-feel of the search results.
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.
The Search Service provides two protocols for searching the contents of the service.
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.
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.
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.
This error occurs when the saxon-9.jar is not in the classpath. The following are mitigation strategies:
<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.
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"
This error occurs when the Search Service is not populated with data. See the Search Core component for information on populating the Search Service.