Class ElasticsearchCommitterConfig
java.lang.Object
com.norconex.committer.core.BaseCommitterConfig
com.norconex.committer.core.batch.BaseBatchCommitterConfig
com.norconex.committer.elasticsearch.ElasticsearchCommitterConfig
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanThe Base64-encoded API key for Elasticsearch API Key authentication.@NonNull DurationElasticsearch connection timeout.Gets Elasticsearch authentication credentials.The character used to replace dots in field names.The Elasticsearch index name.The regular expression matching fields that contains a JSON object for its value (as opposed to a regular string).getNodes()Gets an unmodifiable list of Elasticsearch cluster node URLs.@NonNull DurationElasticsearch socket timeout.The document field name containing the value to be stored in Elasticsearch "_id" field.The name of the Elasticsearch field where content will be stored.The type name.inthashCode()booleanWhether automatic discovery of Elasticsearch cluster nodes should be enabled.booleanWhether to fix IDs that are too long for Elasticsearch ID limitation (512 bytes max).booleanWhether to ignore response errors.The Base64-encoded API key for Elasticsearch API Key authentication.setConnectionTimeout(@NonNull Duration connectionTimeout) Elasticsearch connection timeout.voidsetCredentials(Credentials credentials) Sets Elasticsearch authentication credentials.setDiscoverNodes(boolean discoverNodes) Whether automatic discovery of Elasticsearch cluster nodes should be enabled.setDotReplacement(String dotReplacement) The character used to replace dots in field names.setFixBadIds(boolean fixBadIds) Whether to fix IDs that are too long for Elasticsearch ID limitation (512 bytes max).setIgnoreResponseErrors(boolean ignoreResponseErrors) Whether to ignore response errors.setIndexName(String indexName) The Elasticsearch index name.setJsonFieldsPattern(String jsonFieldsPattern) The regular expression matching fields that contains a JSON object for its value (as opposed to a regular string).voidSets cluster node URLs.setSocketTimeout(@NonNull Duration socketTimeout) Elasticsearch socket timeout.setSourceIdField(String sourceIdField) The document field name containing the value to be stored in Elasticsearch "_id" field.setTargetContentField(String targetContentField) The name of the Elasticsearch field where content will be stored.setTypeName(String typeName) The type name.toString()Methods inherited from class com.norconex.committer.core.batch.BaseBatchCommitterConfig
getQueue, setQueueMethods inherited from class com.norconex.committer.core.BaseCommitterConfig
addRestriction, addRestrictions, clearFieldMappings, clearRestrictions, getFieldMappings, getRestrictions, removeFieldMapping, removeRestriction, removeRestriction, setFieldMapping, setFieldMappings
-
Field Details
-
DEFAULT_ELASTICSEARCH_CONTENT_FIELD
- See Also:
-
DEFAULT_NODE
- See Also:
-
DEFAULT_CONNECTION_TIMEOUT
1 second. -
DEFAULT_SOCKET_TIMEOUT
30 seconds.
-
-
Constructor Details
-
ElasticsearchCommitterConfig
public ElasticsearchCommitterConfig()
-
-
Method Details
-
getNodes
Gets an unmodifiable list of Elasticsearch cluster node URLs. Defaults to "http://localhost:9200".- Returns:
- Elasticsearch nodes
-
setNodes
Sets cluster node URLs. Node URLs with no port are assumed to be using port 80.- Parameters:
nodes- Elasticsearch cluster nodes
-
getCredentials
Gets Elasticsearch authentication credentials.- Returns:
- credentials
-
setCredentials
Sets Elasticsearch authentication credentials.- Parameters:
credentials- the credentials
-
getIndexName
The Elasticsearch index name. -
getTypeName
The type name. Type name is deprecated if you are using Elasticsearch 7.0 or higher and should benull. -
isIgnoreResponseErrors
public boolean isIgnoreResponseErrors()Whether to ignore response errors. By default, an exception is thrown if the Elasticsearch response contains an error. Whentruethe errors are logged instead. -
isDiscoverNodes
public boolean isDiscoverNodes()Whether automatic discovery of Elasticsearch cluster nodes should be enabled. -
getApiKey
The Base64-encoded API key for Elasticsearch API Key authentication. When set, takes precedence over basic credentials. The value should be the Base64-encoded API key as provided by Elasticsearch (i.e., the value sent in theAuthorization: ApiKey ...header). -
getDotReplacement
The character used to replace dots in field names. Default isnull(does not replace dots). -
getJsonFieldsPattern
The regular expression matching fields that contains a JSON object for its value (as opposed to a regular string). Default isnull(not matching any fields). -
getConnectionTimeout
Elasticsearch connection timeout. Defaults to value ofDEFAULT_CONNECTION_TIMEOUT -
getSocketTimeout
Elasticsearch socket timeout. -
isFixBadIds
public boolean isFixBadIds()Whether to fix IDs that are too long for Elasticsearch ID limitation (512 bytes max). Iftrue, long IDs will be truncated and a hash code representing the truncated part will be appended. -
getSourceIdField
The document field name containing the value to be stored in Elasticsearch "_id" field. Set tonullto use the document reference instead of a field (default). -
getTargetContentField
The name of the Elasticsearch field where content will be stored. Default is "content". Anullvalue disables storing the content. -
setIndexName
The Elasticsearch index name.- Returns:
this.
-
setTypeName
The type name. Type name is deprecated if you are using Elasticsearch 7.0 or higher and should benull.- Returns:
this.
-
setIgnoreResponseErrors
Whether to ignore response errors. By default, an exception is thrown if the Elasticsearch response contains an error. Whentruethe errors are logged instead.- Returns:
this.
-
setDiscoverNodes
Whether automatic discovery of Elasticsearch cluster nodes should be enabled.- Returns:
this.
-
setApiKey
The Base64-encoded API key for Elasticsearch API Key authentication. When set, takes precedence over basic credentials. The value should be the Base64-encoded API key as provided by Elasticsearch (i.e., the value sent in theAuthorization: ApiKey ...header).- Returns:
this.
-
setDotReplacement
The character used to replace dots in field names. Default isnull(does not replace dots).- Returns:
this.
-
setJsonFieldsPattern
The regular expression matching fields that contains a JSON object for its value (as opposed to a regular string). Default isnull(not matching any fields).- Returns:
this.
-
setConnectionTimeout
public ElasticsearchCommitterConfig setConnectionTimeout(@NonNull @NonNull Duration connectionTimeout) Elasticsearch connection timeout. Defaults to value ofDEFAULT_CONNECTION_TIMEOUT- Returns:
this.
-
setSocketTimeout
Elasticsearch socket timeout.- Returns:
this.
-
setFixBadIds
Whether to fix IDs that are too long for Elasticsearch ID limitation (512 bytes max). Iftrue, long IDs will be truncated and a hash code representing the truncated part will be appended.- Returns:
this.
-
setSourceIdField
The document field name containing the value to be stored in Elasticsearch "_id" field. Set tonullto use the document reference instead of a field (default).- Returns:
this.
-
setTargetContentField
The name of the Elasticsearch field where content will be stored. Default is "content". Anullvalue disables storing the content.- Returns:
this.
-
equals
- Overrides:
equalsin classBaseBatchCommitterConfig
-
canEqual
- Overrides:
canEqualin classBaseBatchCommitterConfig
-
hashCode
public int hashCode()- Overrides:
hashCodein classBaseBatchCommitterConfig
-
toString
- Overrides:
toStringin classBaseBatchCommitterConfig
-