Class AmazonCloudSearchCommitterConfig
Commits documents to Amazon CloudSearch.
Authentication:
An access key and security key are required to connect to and interact with
CloudSearch. For enhanced security, it is best to use one of the methods
described in DefaultAWSCredentialsProviderChain for setting them
(environment variables, system properties, profile file, etc).
Do not explicitly set "accessKey" and "secretKey" on this class if you
want to rely on safer methods.
CloudSearch ID limitations:
As of this writing, CloudSearch has a 128 characters length limitation
on its "id" field. In addition, certain characters are not allowed.
By default, an error will result from trying to submit
documents with an invalid ID. You can get around this by
setting setFixBadIds(boolean) to true. It will
truncate references that are too long and append a hash code to it
to keep uniqueness. It will also convert invalid
characters to underscore. This approach is not 100%
collision-free (uniqueness), but it should safely cover the vast
majority of cases.
- Author:
- Pascal Essiembre
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanThe CloudSearch access key.The CloudSearch secret key.The AWS service endpoint.The the AWS signing region.The document field name containing the value to be stored in CloudSearch "id" field.The name of the CloudSearch field where content will be stored.inthashCode()booleanWhether to fix IDs that are too long for CloudSearch ID limitation (128 characters max).setAccessKey(String accessKey) The CloudSearch access key.setFixBadIds(boolean fixBadIds) Whether to fix IDs that are too long for CloudSearch ID limitation (128 characters max).setProxySettings(ProxySettings proxy) setSecretKey(String secretKey) The CloudSearch secret key.setServiceEndpoint(String serviceEndpoint) The AWS service endpoint.setSigningRegion(String signingRegion) The the AWS signing region.setSourceIdField(String sourceIdField) The document field name containing the value to be stored in CloudSearch "id" field.setTargetContentField(String targetContentField) The name of the CloudSearch field where content will be stored.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_COULDSEARCH_CONTENT_FIELD
Default CloudSearch content field- See Also:
-
-
Constructor Details
-
AmazonCloudSearchCommitterConfig
public AmazonCloudSearchCommitterConfig()
-
-
Method Details
-
getProxySettings
-
setProxySettings
-
getServiceEndpoint
The AWS service endpoint. -
getSigningRegion
The the AWS signing region. -
getAccessKey
The CloudSearch access key. Ifnull, the access key will be obtained from the environment, as detailed inDefaultAWSCredentialsProviderChain. -
getSecretKey
The CloudSearch secret key. Ifnull, the secret key will be obtained from the environment, as detailed inDefaultAWSCredentialsProviderChain. -
isFixBadIds
public boolean isFixBadIds()Whether to fix IDs that are too long for CloudSearch ID limitation (128 characters 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 CloudSearch "id" field. Default is not a field, but rather the document reference. Anullvalue indicate to use the document reference instead of a field (default). -
getTargetContentField
The name of the CloudSearch field where content will be stored. Default is "content". Specifying anullvalue will disable storing the content. -
setServiceEndpoint
The AWS service endpoint.- Returns:
this.
-
setSigningRegion
The the AWS signing region.- Returns:
this.
-
setAccessKey
The CloudSearch access key. Ifnull, the access key will be obtained from the environment, as detailed inDefaultAWSCredentialsProviderChain.- Returns:
this.
-
setSecretKey
The CloudSearch secret key. Ifnull, the secret key will be obtained from the environment, as detailed inDefaultAWSCredentialsProviderChain.- Returns:
this.
-
setFixBadIds
Whether to fix IDs that are too long for CloudSearch ID limitation (128 characters 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 CloudSearch "id" field. Default is not a field, but rather the document reference. Anullvalue indicate to use the document reference instead of a field (default).- Returns:
this.
-
setTargetContentField
The name of the CloudSearch field where content will be stored. Default is "content". Specifying anullvalue will disable storing the content.- Returns:
this.
-
equals
- Overrides:
equalsin classBaseBatchCommitterConfig
-
canEqual
- Overrides:
canEqualin classBaseBatchCommitterConfig
-
hashCode
public int hashCode()- Overrides:
hashCodein classBaseBatchCommitterConfig
-
toString
- Overrides:
toStringin classBaseBatchCommitterConfig
-