Class AmazonCloudSearchCommitterConfig


public class AmazonCloudSearchCommitterConfig extends BaseBatchCommitterConfig

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 Details

    • DEFAULT_COULDSEARCH_CONTENT_FIELD

      public static final String DEFAULT_COULDSEARCH_CONTENT_FIELD
      Default CloudSearch content field
      See Also:
  • Constructor Details

    • AmazonCloudSearchCommitterConfig

      public AmazonCloudSearchCommitterConfig()
  • Method Details

    • getProxySettings

      public ProxySettings getProxySettings()
    • setProxySettings

      public AmazonCloudSearchCommitterConfig setProxySettings(ProxySettings proxy)
    • getServiceEndpoint

      public String getServiceEndpoint()
      The AWS service endpoint.
    • getSigningRegion

      public String getSigningRegion()
      The the AWS signing region.
    • getAccessKey

      public String getAccessKey()
      The CloudSearch access key. If null, the access key will be obtained from the environment, as detailed in DefaultAWSCredentialsProviderChain.
    • getSecretKey

      public String getSecretKey()
      The CloudSearch secret key. If null, the secret key will be obtained from the environment, as detailed in DefaultAWSCredentialsProviderChain.
    • isFixBadIds

      public boolean isFixBadIds()
      Whether to fix IDs that are too long for CloudSearch ID limitation (128 characters max). If true, long IDs will be truncated and a hash code representing the truncated part will be appended.
    • getSourceIdField

      public String 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. A null value indicate to use the document reference instead of a field (default).
    • getTargetContentField

      public String getTargetContentField()
      The name of the CloudSearch field where content will be stored. Default is "content". Specifying a null value will disable storing the content.
    • setServiceEndpoint

      public AmazonCloudSearchCommitterConfig setServiceEndpoint(String serviceEndpoint)
      The AWS service endpoint.
      Returns:
      this.
    • setSigningRegion

      public AmazonCloudSearchCommitterConfig setSigningRegion(String signingRegion)
      The the AWS signing region.
      Returns:
      this.
    • setAccessKey

      public AmazonCloudSearchCommitterConfig setAccessKey(String accessKey)
      The CloudSearch access key. If null, the access key will be obtained from the environment, as detailed in DefaultAWSCredentialsProviderChain.
      Returns:
      this.
    • setSecretKey

      public AmazonCloudSearchCommitterConfig setSecretKey(String secretKey)
      The CloudSearch secret key. If null, the secret key will be obtained from the environment, as detailed in DefaultAWSCredentialsProviderChain.
      Returns:
      this.
    • setFixBadIds

      public AmazonCloudSearchCommitterConfig setFixBadIds(boolean fixBadIds)
      Whether to fix IDs that are too long for CloudSearch ID limitation (128 characters max). If true, long IDs will be truncated and a hash code representing the truncated part will be appended.
      Returns:
      this.
    • setSourceIdField

      public AmazonCloudSearchCommitterConfig setSourceIdField(String sourceIdField)
      The document field name containing the value to be stored in CloudSearch "id" field. Default is not a field, but rather the document reference. A null value indicate to use the document reference instead of a field (default).
      Returns:
      this.
    • setTargetContentField

      public AmazonCloudSearchCommitterConfig setTargetContentField(String targetContentField)
      The name of the CloudSearch field where content will be stored. Default is "content". Specifying a null value will disable storing the content.
      Returns:
      this.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class BaseBatchCommitterConfig
    • canEqual

      protected boolean canEqual(Object other)
      Overrides:
      canEqual in class BaseBatchCommitterConfig
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class BaseBatchCommitterConfig
    • toString

      public String toString()
      Overrides:
      toString in class BaseBatchCommitterConfig