Class SolrCommitterConfig


public class SolrCommitterConfig extends BaseBatchCommitterConfig

Configuration for SolrCommitter.

  • Field Details

    • DEFAULT_SOLR_ID_FIELD

      public static final String DEFAULT_SOLR_ID_FIELD
      Default Solr ID field
      See Also:
    • DEFAULT_SOLR_CONTENT_FIELD

      public static final String DEFAULT_SOLR_CONTENT_FIELD
      Default Solr content field
      See Also:
    • DEFAULT_CONNECTION_TIMEOUT

      public static final Duration DEFAULT_CONNECTION_TIMEOUT
      Default time to wait for a connection to be established
    • DEFAULT_SOCKET_TIMEOUT

      public static final Duration DEFAULT_SOCKET_TIMEOUT
      Default time to wait for Solr to respond to a request
  • Constructor Details

    • SolrCommitterConfig

      public SolrCommitterConfig()
  • Method Details

    • getUpdateUrlParams

      public Map<String,String> getUpdateUrlParams()
      Gets URL parameters to be added on Solr HTTP calls.
      Returns:
      a map of parameter names and values
    • setUpdateUrlParams

      public void setUpdateUrlParams(Map<String,String> updateUrlParams)
      Sets URL parameters to be added on Solr HTTP calls.
      Parameters:
      updateUrlParams - a map of parameter names and values
    • setUpdateUrlParam

      public void setUpdateUrlParam(String name, String value)
      Sets a URL parameter to be added on Solr HTTP calls.
      Parameters:
      name - parameter name
      value - parameter value
    • getUpdateUrlParam

      public String getUpdateUrlParam(String name)
      Gets a URL parameter value by its parameter name.
      Parameters:
      name - parameter name
      Returns:
      parameter value
    • getUpdateUrlParamNames

      public Set<String> getUpdateUrlParamNames()
      Gets the update URL parameter names.
      Returns:
      parameter names
    • getNodes

      public List<String> getNodes()
      Gets the URLs of the Solr core or collection to send documents to.
      Returns:
      Solr node URLs
    • setNodes

      public void setNodes(List<String> nodes)
      Sets the URLs of the Solr core or collection to send documents to.
      Parameters:
      nodes - Solr node URLs
    • getHeaders

      public Map<String,String> getHeaders()
      Gets custom HTTP headers sent with every request.
      Returns:
      a map of header names and values
    • setHeaders

      public void setHeaders(Map<String,String> headers)
      Sets custom HTTP headers sent with every request.
      Parameters:
      headers - a map of header names and values
    • setHeader

      public void setHeader(String name, String value)
      Sets a custom HTTP header sent with every request.
      Parameters:
      name - header name
      value - header value
    • getCredentials

      public Credentials getCredentials()
      Gets Solr authentication credentials.
      Returns:
      credentials
    • setCredentials

      public void setCredentials(Credentials credentials)
      Sets Solr authentication credentials.
      Parameters:
      credentials - the credentials
    • getConnectionMode

      public SolrConnectionMode getConnectionMode()
      How to connect to the Solr nodes. When not set, it is SolrConnectionMode.SINGLE_NODE with one node and SolrConnectionMode.LOAD_BALANCED with several. SolrCloud (with node discovery) must be set explicitly.
    • getHttpVersion

      public SolrHttpVersion getHttpVersion()
      The HTTP protocol version. Default is SolrHttpVersion.AUTO.
    • getSolrClientType

      @Deprecated public SolrClientType getSolrClientType()
      The type of Solr client.
    • getSolrURL

      @Deprecated public String getSolrURL()
      Deprecated.
      use setNodes(List) instead.
      The endpoint URL(s) used to connect to Solr (comma-separated when more than one).
    • isSolrCommitDisabled

      public boolean isSolrCommitDisabled()
      Whether to send an explicit commit request at the end of every batch, or let the server auto-commit.
    • getBearerToken

      public String getBearerToken()
      A bearer token (e.g., JWT) sent as an Authorization header with every request. Ignored when basic authentication credentials are set.
    • getConnectionTimeout

      @NonNull public @NonNull Duration getConnectionTimeout()
      Maximum time to wait for a connection to be established. Default is 10 seconds.
    • getSocketTimeout

      @NonNull public @NonNull Duration getSocketTimeout()
      Maximum time to wait for Solr to respond to a request (a batch of documents). Default is 120 seconds.
    • getSourceIdField

      public String getSourceIdField()
      The document field name containing the value to be stored in Solr ID field. A null value (default) will use the document reference instead of a document field.
    • getTargetIdField

      public String getTargetIdField()
      The name of the Solr field where to store a document unique identifier (sourceIdField). Default is "id".
    • getTargetContentField

      public String getTargetContentField()
      The name of the Solr field where content will be stored. Default is "content". A null value will disable storing the content.
    • setConnectionMode

      public SolrCommitterConfig setConnectionMode(SolrConnectionMode connectionMode)
      How to connect to the Solr nodes. When not set, it is SolrConnectionMode.SINGLE_NODE with one node and SolrConnectionMode.LOAD_BALANCED with several. SolrCloud (with node discovery) must be set explicitly.
      Returns:
      this.
    • setHttpVersion

      public SolrCommitterConfig setHttpVersion(SolrHttpVersion httpVersion)
      The HTTP protocol version. Default is SolrHttpVersion.AUTO.
      Returns:
      this.
    • setSolrClientType

      @Deprecated public SolrCommitterConfig setSolrClientType(SolrClientType solrClientType)
      The type of Solr client.
      Returns:
      this.
    • setSolrURL

      @Deprecated public SolrCommitterConfig setSolrURL(String solrURL)
      Deprecated.
      use setNodes(List) instead.
      The endpoint URL(s) used to connect to Solr (comma-separated when more than one).
      Returns:
      this.
    • setSolrCommitDisabled

      public SolrCommitterConfig setSolrCommitDisabled(boolean solrCommitDisabled)
      Whether to send an explicit commit request at the end of every batch, or let the server auto-commit.
      Returns:
      this.
    • setBearerToken

      public SolrCommitterConfig setBearerToken(String bearerToken)
      A bearer token (e.g., JWT) sent as an Authorization header with every request. Ignored when basic authentication credentials are set.
      Returns:
      this.
    • setConnectionTimeout

      public SolrCommitterConfig setConnectionTimeout(@NonNull @NonNull Duration connectionTimeout)
      Maximum time to wait for a connection to be established. Default is 10 seconds.
      Returns:
      this.
    • setSocketTimeout

      public SolrCommitterConfig setSocketTimeout(@NonNull @NonNull Duration socketTimeout)
      Maximum time to wait for Solr to respond to a request (a batch of documents). Default is 120 seconds.
      Returns:
      this.
    • setSourceIdField

      public SolrCommitterConfig setSourceIdField(String sourceIdField)
      The document field name containing the value to be stored in Solr ID field. A null value (default) will use the document reference instead of a document field.
      Returns:
      this.
    • setTargetIdField

      public SolrCommitterConfig setTargetIdField(String targetIdField)
      The name of the Solr field where to store a document unique identifier (sourceIdField). Default is "id".
      Returns:
      this.
    • setTargetContentField

      public SolrCommitterConfig setTargetContentField(String targetContentField)
      The name of the Solr field where content will be stored. Default is "content". 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