Configuring the operation of the Guidewire Solr Extension

You configure the Guidewire Solr Extension for embedded or external operation in the solrserver-config.xml file. The file contains one or more <solrserver> elements. They define instances of the Guidewire Solr Extension. You configure the Guidewire Solr Extension for embedded or external operation with the type attribute. You configure the Guidewire Solr Extension for one or more environments with the env attribute.

<solrserver name="name" type={"embedded"|"http"|"cloud"} [env="env-variable-value[, env-variable-value-2]"]>

PolicyCenter supports the embedded type only in development environments. PolicyCenter supports the http and cloud types in production and development environments. Setting the type to embedded configures the Guidewire Solr Extension for embedded operation. Setting the type to http or cloud configures the Guidewire Solr Extension for external operation.

Configuring the Guidewire Solr Extension for embedded operation

With embedded operation, the Guidewire Solr Extension runs as part of the PolicyCenter application, not as an application in a different application server instance. Therefore, embedded server definitions do not specify HTTP connection information. PolicyCenter supports embedded operation only in development environments.

The following example in solrserver-config.xml shows a typical configuration of an embedded server in a development environment set up on the bundled QuickStart application server.

<solrserver name="embeddedSolr" type="embedded">
  <param name="solrroot" value="/opt/gwsolr"/>
</solrserver>
...
<document name="policy" archive="false" servername="embeddedSolr"/>

The name attribute of the <solrserver> element lets you bind document types, such as policies, to a server that has cores for them. A <document> element may reference a <solrserver> element of type embedded only if you run the PolicyCenter application in development mode. Otherwise, PolicyCenter generates an error message on the server console and in the server log, and free-text search does not operate.

For Solr servers of embedded type, you must specify the solrroot parameter. The value is the absolute path to a directory where the indexes for the cores are located. Generally, you specify a Guidewire Solr Home directory that holds files extracted from the pc-gwsolr.zip file as solrroot. In a typical development environment, the home directory is on the same host as the one that hosts your PolicyCenter application. Free-text search creates the directory specified by solrroot during server startup if the directory does not exist and extracts the files from pc-gwsolr.zip into that directory.

The following example shows a typical configuration of an embedded server in a development environment set up on a Tomcat application server.

<solrserver name="embeddedSolr" type="embedded">
  <param name="solrroot" value="/opt/gwsolr"/>
  <param name="gwsolrzip" value="/dev/PolicyCenter/solr/pc-gwsolr.zip"/>
</solrserver>
...
<document name="policy" archive="false" servername="embeddedSolr"/>

For embedded operation on Tomcat, you must include the gwsolrzip parameter to specify the absolute path to the pc-gwsolr.zip file in your PolicyCenter home directory.

See also

Configuring the Guidewire Solr Extension for external operation

With external operation, the Guidewire Solr Extension runs as an independent application in a different Java Virtual Machine (JVM) than the one that runs PolicyCenter. Therefore, external server definitions must specify HTTP connection information.

The following example in solrserver-config.xml shows a typical configuration of an external server for a development environment.

<solrserver name="localhost" type="http">
  <param name="host" value="localhost"/>
  <param name="port" value="8983"/>
</solrserver>
...
<document name="policy" archive="false" servername="localhost"/>

The name attribute of the <solrserver> element lets you bind a document type, such as policy, to a server that has a core for it.

For external servers, you must specify the host and the port parameters. Typically in a development environment, you run the Guidewire Solr Extension in an application server instance hosted on the same machine where you run the PolicyCenter application. If you run the Guidewire Solr Extension on the same machine that runs PolicyCenter, specify localhost for the host parameter. Otherwise, specify the host name for the remote host.

The base configuration of the Guidewire Solr Extension configures its port number as 8983. For the port parameter of an external server definition, specify the port number that you configured for the Guidewire Solr Extension.

With external servers, you can specify two kinds of HTTP timeout parameters: connectiontimeout and readtimeout. The following example shows typical timeout parameter settings.

<solrserver name="localhost" type="http">
  <param name="host" value="localhost"/>
  <param name="port" value="8983"/>
  <param name="connectiontimeout" value="300000"/>
  <param name="readtimeout" value="300000"/>
</solrserver>

Specify timeout intervals in milliseconds. The connectiontimeout parameter specifies how long PolicyCenter waits for the Guidewire Solr Extension to respond to a connection request. The readtimeout parameter specifies how long PolicyCenter waits for the Guidewire Solr Extension to completely return results from a search request.

With external servers, you can also specify two connection quantity parameters: maxtotalconnections and defaultmaxtotalconnectionsperhost. The following example shows typical connection quantity parameter settings.

<solrserver name="localhost" type="http">
  <param name="host" value="localhost"/>
  <param name="port" value="8983"/>
  <param name="maxtotalconnections" value="40"/>
  <param name="defaultmaxtotalconnectionsperhost" value="40"/>
</solrserver>

The maxtotalconnections parameter places an upper limit on the total number of outgoing connections from PolicyCenter. The defaultmaxtotalconnectionsperhost parameter places an upper limit on the number of connections to the specified host. The defaultmaxtotalconnectionsperhost parameter value cannot exceed the value of the maxtotalconnections parameter. For the Guidewire Solr Extension server with a type of http, Guidewire recommends that the two connection quantity parameters have the same value.

If the server type is cloud, you can set the maxtotalconnections parameter to a higher value than the value of the defaultmaxtotalconnectionsperhost parameter. The maximum value for the maxtotalconnections parameter is N times the value of the defaultmaxtotalconnectionsperhost parameter. In this equation, N is the number of distinct Guidewire Solr Extension hosts.
Note: If the performance of free-text search is slow, increase the maximum number of connections to the specified Guidewire Solr Extension host or hosts.

See also