Package org.opencms.search.solr
Class CmsSolrConfiguration
java.lang.Object
org.opencms.search.solr.CmsSolrConfiguration
The Solr configuration class.
- Since:
- 8.5.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The 'conf' folder inside the Solr home directory.static final String
The default config set path.static final int
The default maximum number of results to return in a Solr search.static final String
The Solr configuration file name.static final String
The Solr configuration name.static final long
The default max time in ms before a commit will happen (10 seconds by default).static final String
The default name of the Solr home directory.static final String
The system property name for the Solr home directory.static final String
The Solr schema name. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetHome()
Returns the home directory of Solr as String.Returns the configured Solr home.int
Returns the maximal number of results processed when querying a Solr index.Returns the servers URL if embedded is set tofalse
.long
Returns the max time (in ms) before a commit will happen.org.apache.solr.core.SolrConfig
Returns the Solr configuration (object representation of'solrconfig.xml'
).Returns the solr configuration file, default:'conf/solrconfig.xml'
.Returns the Solr xml file, default:'solr.xml'
.Returns the Solr xml file name, default:'solr.xml'
.org.apache.solr.schema.IndexSchema
Returns the Solr index schema.Returns the Solr index schema file.boolean
Returnstrue
if the Solr server is embedded,false
otherwise.void
setEnabled
(String isEnabled) Sets the enabled flag.void
setHomeFolderPath
(String homeFolderPath) Sets the home folder for Solr.void
setMaxProcessedResults
(String maxProcessedResults) Sets the maximal number of results processed for a query to a Solr index.void
setServerUrl
(String url) Sets the external servers URL, should be not null if the embedded falg isfalse
.void
setSolrCommitMs
(String time) Sets the max time (in ms) before a commit will happen.void
setSolrFileName
(String name) Sets the Solr file name.
-
Field Details
-
DEFAULT_CONFIGSET_FOLDER
The default config set path. -
CONF_FOLDER
The 'conf' folder inside the Solr home directory. -
SOLR_CONFIG_FILE
The Solr configuration file name.- See Also:
-
DEFAULT_MAX_PROCESSED_RESULTS
The default maximum number of results to return in a Solr search.- See Also:
-
SOLR_DEFAULT_COMMIT_MS
The default max time in ms before a commit will happen (10 seconds by default).Can be configured in 'opencms-search.xml'.
- See Also:
-
SOLR_HOME_DEFAULT
The default name of the Solr home directory. -
SOLR_HOME_PROPERTY
The system property name for the Solr home directory.- See Also:
-
SOLR_SCHEMA_NAME
The Solr schema name.- See Also:
-
SOLR_CONFIG_NAME
The Solr configuration name.- See Also:
-
-
Constructor Details
-
CmsSolrConfiguration
public CmsSolrConfiguration()Default constructor.
-
-
Method Details
-
getHome
Returns the home directory of Solr as String.- Returns:
- the home directory of Solr as String
-
getHomeFolderPath
Returns the configured Solr home.- Returns:
- the configured Solr home
-
getMaxProcessedResults
Returns the maximal number of results processed when querying a Solr index. Each index has a configuration option to overwrite this global value.- Returns:
- the maximal number of results processed when querying a Solr index.
-
getServerUrl
Returns the servers URL if embedded is set tofalse
.- Returns:
- the external servers URL
-
getSolrCommitMs
Returns the max time (in ms) before a commit will happen.- Returns:
- the max time (in ms) before a commit will happen
-
getSolrConfig
Returns the Solr configuration (object representation of'solrconfig.xml'
).- Returns:
- the Solr configuration
-
getSolrConfigFile
Returns the solr configuration file, default:'conf/solrconfig.xml'
.- Returns:
- the solr configuration file
-
getSolrFile
Returns the Solr xml file, default:'solr.xml'
.- Returns:
- the Solr xml file
-
getSolrFileName
Returns the Solr xml file name, default:'solr.xml'
.- Returns:
- the Solr xml file name
-
getSolrSchema
Returns the Solr index schema.- Returns:
- the Solr index schema
-
getSolrSchemaFile
Returns the Solr index schema file.- Returns:
- the Solr index schema file
-
isEnabled
Returnstrue
if the Solr server is embedded,false
otherwise.- Returns:
true
if the Solr server is embedded,false
otherwise
-
setEnabled
Sets the enabled flag.- Parameters:
isEnabled
-true
, if the Solr server should be used,false
otherwise
-
setHomeFolderPath
Sets the home folder for Solr.- Parameters:
homeFolderPath
- the Solr home folder to set
-
setMaxProcessedResults
Sets the maximal number of results processed for a query to a Solr index.The globally set value can be overwritten for each index.
- Parameters:
maxProcessedResults
- the maximal number of results processed for a query to a Solr index.
-
setServerUrl
Sets the external servers URL, should be not null if the embedded falg isfalse
.- Parameters:
url
- the URL
-
setSolrCommitMs
Sets the max time (in ms) before a commit will happen.- Parameters:
time
- the time as long value
-
setSolrFileName
Sets the Solr file name.- Parameters:
name
- the file name to set
-