The Publish to SolrCloud application sends document feeds, to SolrCloud index through SolrJ. SolrJ has a CloudSolrClient class to communicate with SolrCloud. Instances of this class communicate with Zookeeper to discover Solr endpoints for SolrCloud collections, and then use the LBHttpSolrClient to issue requests. The feed to Solr can be customized by editing the XSL transformation file provided by the user.

Publish to SolrCloud
Factory Namecom.searchtechnologies.aspire:app-publish-to-solrj
subTypedefault
InputsAspireObject from a connector's subjob with metadata and content extracted from a specific file/folder.
OutputsAn XML transformation of the AspireObject sent to the Solr's xmlfeed URL.
Versions3.1
Type Flagsjob-input

Configuration


This section lists all configuration parameters available to configure the Publish to SolrCloud component.

 

PropertyTypeDefaultDescription
zkHoststringnoneZookeeper hostname or IP address.
zkPortinterger8983Zookeeper port number where to send the feeds
solrCollectionstringnoneSolr collection name to submit post documents using binary request handler for increased index performance.
aspireToSolrXslstring${appbundle.home}/config/xsl/aspireToSolr.xslLocation of the XSL to transform the job data to a Solr feed. See Edit Xsl.
batchSize   int50How many documents to fetch per batch.
maxTries int3Maximum number of retry attempt to index.
retryWait int3Seconds to wait before re-trying to index.
fieldListPath  String/add/doc/fieldListXPath expression to process field list.

Example Configuration


<application config="com.searchtechnologies.aspire:app-publish-to-solrj">

  <properties>
     <property name="BatchSize">50</property>
     <property name="RetryWait">3</property>
     <property name="FieldListPath">/add/doc/fieldList</property>
     <property name="AspireToSolrXsl">${appbundle.home}/config/xsl/aspireToSolr.xsl</property>
     <property name="debug">true</property>
     <property name="MaxTries">3</property>
     <property name="ZKPort">9983</property>
     <property name="SolrCollection">collection1</property>
     <property name="ZKHost">localhost</property>
   </properties>
</application>

Any optional properties can be removed from the configuration to use the default value described on the table above.


Edit Xsl


The default XSL transformation file can be found in AspireToSolr.xsl.


The default transformation XSL file provided by the publisher expects metadata as described in Connector AspireObject Metadata.

Add metadata field

To add a new metadata field extracted by an Aspire Connector add an XSL element under the <doc> tag.

<field name="metafieldNameInSolr_t">
  <xsl:value-of select="metafieldNameFromAspireObject" />
</field>


Notice that the dynamic field _t is being used by default. If you have a Solr schema that supports your field, then just enter the field name as defined in the schema.

Change the document ID

The id of a Solr document is used to uniquely identify a file in the index. By default, Publish To SolrCloud will use the following fields from the Aspire document in order of precedency (if one is missing, then the next will be used):

  • fetchUrl
  • url
  • displayUrl
  • id

If you want to change this behavior, edit or create a new XSL file which has the following element:

<field name="id">
  <xsl:value-of select="idFieldNameFromAspireObject" />
</field>

Advanced Edit

More advanced changes can be accomplished reading the Solr Update XML Messages wiki.