11.05.2016 Views

Apache Solr Reference Guide Covering Apache Solr 6.0

21SiXmO

21SiXmO

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

dateFormat<br />

A java.text.SimpleDateFormat to use when converting the date to text. The default is<br />

"yyyy-MM-dd HH:mm:ss".<br />

type The implementation class. Use SimplePropertiesWriter for non-<strong>Solr</strong>Cloud installations. If<br />

using <strong>Solr</strong>Cloud, use ZKPropertiesWriter. If this is not specified, it will default to the<br />

appropriate class depending on if <strong>Solr</strong>Cloud mode is enabled.<br />

directory Used with the SimplePropertiesWriter only). The directory for the properties file. If not<br />

specified, the default is "conf".<br />

filename Used with the SimplePropertiesWriter only). The name of the properties file. If not<br />

specified, the default is the requestHandler name (as defined in solrconfig.xml, appended<br />

by ".properties" (i.e., "dataimport.properties").<br />

locale<br />

The locale. If not defined, the ROOT locale is used. It must be specified as language-country.<br />

For example, en-US.<br />

Data Sources<br />

A data source specifies the origin of data and its type. Somewhat confusingly, some data sources are configured<br />

within the associated entity processor. Data sources can also be specified in solrconfig.xml, which is useful<br />

when you have multiple environments (for example, development, QA, and production) differing only in their data<br />

sources.<br />

You can create a custom data source by writing a class that extends org.apache.solr.handler.dataimpo<br />

rt.DataSource.<br />

The mandatory attributes for a data source definition are its name and type. The name identifies the data source<br />

to an Entity element.<br />

The types of data sources available are described below.<br />

ContentStreamDataSource<br />

This takes the POST data as the data source. This can be used with any EntityProcessor that uses a DataSour<br />

ce.<br />

FieldReaderDataSource<br />

This can be used where a database field contains XML which you wish to process using the<br />

XPathEntityProcessor. You would set up a configuration with both JDBC and FieldReader data sources, and two<br />

entities, as follows:<br />

<strong>Apache</strong> <strong>Solr</strong> <strong>Reference</strong> <strong>Guide</strong> <strong>6.0</strong><br />

211

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!