Package com.norconex.committer.solr
Class SolrCommitterConfig
java.lang.Object
com.norconex.committer.core.BaseCommitterConfig
com.norconex.committer.core.batch.BaseBatchCommitterConfig
com.norconex.committer.solr.SolrCommitterConfig
Configuration for SolrCommitter.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanA bearer token (e.g., JWT) sent as anAuthorizationheader with every request.How to connect to the Solr nodes.@NonNull DurationMaximum time to wait for a connection to be established.Gets Solr authentication credentials.Gets custom HTTP headers sent with every request.The HTTP protocol version.getNodes()Gets the URLs of the Solr core or collection to send documents to.@NonNull DurationMaximum time to wait for Solr to respond to a request (a batch of documents).Deprecated.Deprecated.usesetNodes(List)instead.The document field name containing the value to be stored in Solr ID field.The name of the Solr field where content will be stored.The name of the Solr field where to store a document unique identifier (sourceIdField).getUpdateUrlParam(String name) Gets a URL parameter value by its parameter name.Gets the update URL parameter names.Gets URL parameters to be added on Solr HTTP calls.inthashCode()booleanWhether to send an explicit commit request at the end of every batch, or let the server auto-commit.setBearerToken(String bearerToken) A bearer token (e.g., JWT) sent as anAuthorizationheader with every request.setConnectionMode(SolrConnectionMode connectionMode) How to connect to the Solr nodes.setConnectionTimeout(@NonNull Duration connectionTimeout) Maximum time to wait for a connection to be established.voidsetCredentials(Credentials credentials) Sets Solr authentication credentials.voidSets a custom HTTP header sent with every request.voidsetHeaders(Map<String, String> headers) Sets custom HTTP headers sent with every request.setHttpVersion(SolrHttpVersion httpVersion) The HTTP protocol version.voidSets the URLs of the Solr core or collection to send documents to.setSocketTimeout(@NonNull Duration socketTimeout) Maximum time to wait for Solr to respond to a request (a batch of documents).setSolrClientType(SolrClientType solrClientType) Deprecated.usesetConnectionMode(SolrConnectionMode)andsetHttpVersion(SolrHttpVersion)instead.setSolrCommitDisabled(boolean solrCommitDisabled) Whether to send an explicit commit request at the end of every batch, or let the server auto-commit.setSolrURL(String solrURL) Deprecated.usesetNodes(List)instead.setSourceIdField(String sourceIdField) The document field name containing the value to be stored in Solr ID field.setTargetContentField(String targetContentField) The name of the Solr field where content will be stored.setTargetIdField(String targetIdField) The name of the Solr field where to store a document unique identifier (sourceIdField).voidsetUpdateUrlParam(String name, String value) Sets a URL parameter to be added on Solr HTTP calls.voidsetUpdateUrlParams(Map<String, String> updateUrlParams) Sets URL parameters to be added on Solr HTTP calls.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, getAcl, getFieldMappings, getRestrictions, removeFieldMapping, removeRestriction, removeRestriction, setAcl, setFieldMapping, setFieldMappings
-
Field Details
-
DEFAULT_SOLR_ID_FIELD
Default Solr ID field- See Also:
-
DEFAULT_SOLR_CONTENT_FIELD
Default Solr content field- See Also:
-
DEFAULT_CONNECTION_TIMEOUT
Default time to wait for a connection to be established -
DEFAULT_SOCKET_TIMEOUT
Default time to wait for Solr to respond to a request
-
-
Constructor Details
-
SolrCommitterConfig
public SolrCommitterConfig()
-
-
Method Details
-
getUpdateUrlParams
Gets URL parameters to be added on Solr HTTP calls.- Returns:
- a map of parameter names and values
-
setUpdateUrlParams
Sets URL parameters to be added on Solr HTTP calls.- Parameters:
updateUrlParams- a map of parameter names and values
-
setUpdateUrlParam
Sets a URL parameter to be added on Solr HTTP calls.- Parameters:
name- parameter namevalue- parameter value
-
getUpdateUrlParam
Gets a URL parameter value by its parameter name.- Parameters:
name- parameter name- Returns:
- parameter value
-
getUpdateUrlParamNames
Gets the update URL parameter names.- Returns:
- parameter names
-
getNodes
Gets the URLs of the Solr core or collection to send documents to.- Returns:
- Solr node URLs
-
setNodes
Sets the URLs of the Solr core or collection to send documents to.- Parameters:
nodes- Solr node URLs
-
getHeaders
Gets custom HTTP headers sent with every request.- Returns:
- a map of header names and values
-
setHeaders
Sets custom HTTP headers sent with every request.- Parameters:
headers- a map of header names and values
-
setHeader
Sets a custom HTTP header sent with every request.- Parameters:
name- header namevalue- header value
-
getCredentials
Gets Solr authentication credentials.- Returns:
- credentials
-
setCredentials
Sets Solr authentication credentials.- Parameters:
credentials- the credentials
-
getConnectionMode
How to connect to the Solr nodes. When not set, it isSolrConnectionMode.SINGLE_NODEwith one node andSolrConnectionMode.LOAD_BALANCEDwith several. SolrCloud (with node discovery) must be set explicitly. -
getHttpVersion
The HTTP protocol version. Default isSolrHttpVersion.AUTO. -
getSolrClientType
Deprecated.usesetConnectionMode(SolrConnectionMode)andsetHttpVersion(SolrHttpVersion)instead.The type of Solr client. -
getSolrURL
Deprecated.usesetNodes(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
A bearer token (e.g., JWT) sent as anAuthorizationheader with every request. Ignored when basic authentication credentials are set. -
getConnectionTimeout
Maximum time to wait for a connection to be established. Default is 10 seconds. -
getSocketTimeout
Maximum time to wait for Solr to respond to a request (a batch of documents). Default is 120 seconds. -
getSourceIdField
The document field name containing the value to be stored in Solr ID field. Anullvalue (default) will use the document reference instead of a document field. -
getTargetIdField
The name of the Solr field where to store a document unique identifier (sourceIdField). Default is "id". -
getTargetContentField
The name of the Solr field where content will be stored. Default is "content". Anullvalue will disable storing the content. -
setConnectionMode
How to connect to the Solr nodes. When not set, it isSolrConnectionMode.SINGLE_NODEwith one node andSolrConnectionMode.LOAD_BALANCEDwith several. SolrCloud (with node discovery) must be set explicitly.- Returns:
this.
-
setHttpVersion
The HTTP protocol version. Default isSolrHttpVersion.AUTO.- Returns:
this.
-
setSolrClientType
Deprecated.usesetConnectionMode(SolrConnectionMode)andsetHttpVersion(SolrHttpVersion)instead.The type of Solr client.- Returns:
this.
-
setSolrURL
Deprecated.usesetNodes(List)instead.The endpoint URL(s) used to connect to Solr (comma-separated when more than one).- Returns:
this.
-
setSolrCommitDisabled
Whether to send an explicit commit request at the end of every batch, or let the server auto-commit.- Returns:
this.
-
setBearerToken
A bearer token (e.g., JWT) sent as anAuthorizationheader with every request. Ignored when basic authentication credentials are set.- Returns:
this.
-
setConnectionTimeout
Maximum time to wait for a connection to be established. Default is 10 seconds.- Returns:
this.
-
setSocketTimeout
Maximum time to wait for Solr to respond to a request (a batch of documents). Default is 120 seconds.- Returns:
this.
-
setSourceIdField
The document field name containing the value to be stored in Solr ID field. Anullvalue (default) will use the document reference instead of a document field.- Returns:
this.
-
setTargetIdField
The name of the Solr field where to store a document unique identifier (sourceIdField). Default is "id".- Returns:
this.
-
setTargetContentField
The name of the Solr field where content will be stored. Default is "content". 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
-
setConnectionMode(SolrConnectionMode)andsetHttpVersion(SolrHttpVersion)instead.