indexer-elastic-rest plugin is used for sending documents from one or more segments to Elasticsearch, but using Jest to connect with the REST API provided by Elasticsearch. The configuration for the index writers is on conf/index-writers.xml file, included in the official Nutch distribution and it's as follow:
<writer id="<writer_id>" class="org.apache.nutch.indexwriter.elasticrest.ElasticRestIndexWriter"> <mapping> ... </mapping> <parameters> ... </parameters> </writer>
<writer> element has two mandatory attributes:
<writer_id> is a unique identification for each configuration. This feature allows Nutch to distinguish each configuration, even when they are for the same index writer. In addition, it allows to have multiple instances for the same index writer, but with different configurations.
org.apache.nutch.indexwriter.elasticrest.ElasticRestIndexWriter corresponds to the canonical name of the class that implements the IndexWriter extension point. This value should not be modified for the indexer-elastic-rest plugin.
The mapping section is explained here. The structure of this section is general for all index writers.
Each parameter has the form
<param name="<name>" value="<value>"/> and the parameters for this index writer are:
|Parameter Name||Description||Default value|
|host||The hostname or a list of comma separated hostnames to send documents to using Elasticsearch Jest. Both host and port must be defined.|
|port||The port to connect to using Elasticsearch Jest.||9200|
|index||Default index to send documents to.||nutch|
|max.bulk.docs||Maximum size of the bulk in number of documents.||250|
|max.bulk.size||Maximum size of the bulk in bytes.||2500500|
|user||Username for auth credentials (only used when https is enabled)||user|
|password||Password for auth credentials (only used when https is enabled)||password|
|type||Default type to send documents to.||doc|
|https||true to enable https, false to disable https. If you've disabled http access (by forcing https), be sure to set this to true, otherwise you might get “connection reset by peer”.||false|
|trustallhostnames||true to trust elasticsearch server‘s certificate even if its listed domain name does not match the domain they are hosted or false to check if the elasticsearch server’s certificate‘s listed domain is the same domain that it is hosted on, and if it doesn’t, then fail to index (only used when https is enabled)||false|
|languages||A list of strings denoting the supported languages (e.g. |
|separator||Is used only if ||_|
|sink||Is used only if ||others|