Page History
Table of Contents |
---|
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 Name | com.searchtechnologies.aspire:app-publish-to-solrj |
subType | default |
Inputs | AspireObject from a connector's subjob with metadata and content extracted from a specific file/folder. |
Outputs | An XML transformation of the AspireObject sent to the Solr's xmlfeed URL. |
Versions | 3.1 |
Type Flags | job-input |
Configuration
This section lists all configuration parameters available to configure the Publish to SolrCloud component.
Property | Type | Default | Description |
---|---|---|---|
zkHost | string | none | Zookeeper hostname or IP address. |
zkPort | interger | 8983 | Zookeeper port number where to send the feeds |
solrCollection | string | none | Solr collection name to submit post documents using binary request handler for increased index performance. |
aspireToSolrXsl | string | ${appbundle.home}/config/xsl/aspireToSolr.xsl | Location of the XSL to transform the job data to a Solr feed. See Edit Xsl. |
batchSize | int | 50 | How many documents to fetch per batch. |
maxTries | int | 3 | Maximum number of retry attempt to index. |
retryWait | int | 3 | Seconds to wait before re-trying to index. |
fieldListPath | String | /add/doc/fieldList | XPath 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>
Note |
---|
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.
Code Block | ||
---|---|---|
| ||
<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:
Code Block |
---|
<field name="id">
<xsl:value-of select="idFieldNameFromAspireObject" />
</field> |
Advanced Edit
More advanced changes can be accomplished reading the Solr Update XML Messages wiki.
Publish to SolrCloud App Bundle
Detailed information on configuring the Publish to SolrCloud App Bundle.
...