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