Package org.apache.solr.core
Class SolrConfig
- java.lang.Object
-
- org.apache.solr.core.XmlConfigFile
-
- org.apache.solr.core.SolrConfig
-
- All Implemented Interfaces:
MapSerializable
public class SolrConfig extends XmlConfigFile implements MapSerializable
Provides a static reference to a Config object modeling the main configuration data for a a Solr instance -- typically found in "solrconfig.xml".
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SolrConfig.HttpCachingConfig
static class
SolrConfig.PluginOpts
static class
SolrConfig.SolrPluginInfo
static class
SolrConfig.UpdateHandlerInfo
-
Field Summary
Fields Modifier and Type Field Description int
booleanQueryMaxClauseCount
static Map<String,SolrConfig.SolrPluginInfo>
classVsSolrPluginInfo
protected String
dataDir
static String
DEFAULT_CONF_FILE
CacheConfig
documentCacheConfig
boolean
enableLazyFieldLoading
CacheConfig
fieldValueCacheConfig
CacheConfig
filterCacheConfig
int
hashDocSetMaxSize
float
hashSetInverseLoadFactor
SolrIndexConfig
indexConfig
org.apache.lucene.util.Version
luceneMatchVersion
int
maxWarmingSearchers
static List<SolrConfig.SolrPluginInfo>
plugins
CacheConfig
queryResultCacheConfig
int
queryResultMaxDocsCached
int
queryResultWindowSize
int
slowQueryThresholdMillis
protected SolrConfig.UpdateHandlerInfo
updateHandlerInfo
boolean
useColdSearcher
boolean
useFilterForSortedQuery
boolean
useRangeVersionsForPeerSync
Map<String,CacheConfig>
userCacheConfigs
-
Constructor Summary
Constructors Constructor Description SolrConfig()
Creates a default instance from the solrconfig.xml.SolrConfig(String name)
Creates a configuration instance from a configuration name.SolrConfig(String name, InputSource is)
Creates a configuration instance from a configuration name and stream.SolrConfig(Path instanceDir, String name, InputSource is)
Creates a configuration instance from an instance directory, configuration name and stream.SolrConfig(SolrResourceLoader loader, String name, InputSource is)
Creates a configuration instance from a resource loader, a configuration name and a stream.
-
Method Summary
-
Methods inherited from class org.apache.solr.core.XmlConfigFile
assertWarnOrFail, complainAboutUnknownAttributes, evaluate, getBool, getDocument, getDouble, getDouble, getFloat, getFloat, getName, getNode, getNode, getNodeList, getOriginalConfig, getResourceLoader, getResourceName, getUnknownAttributes, getUnsubstitutedNode, getVal, getXPath, getZnodeVersion, substituteProperties
-
-
-
-
Field Detail
-
DEFAULT_CONF_FILE
public static final String DEFAULT_CONF_FILE
- See Also:
- Constant Field Values
-
plugins
public static final List<SolrConfig.SolrPluginInfo> plugins
-
classVsSolrPluginInfo
public static final Map<String,SolrConfig.SolrPluginInfo> classVsSolrPluginInfo
-
booleanQueryMaxClauseCount
public final int booleanQueryMaxClauseCount
-
filterCacheConfig
public final CacheConfig filterCacheConfig
-
queryResultCacheConfig
public final CacheConfig queryResultCacheConfig
-
documentCacheConfig
public final CacheConfig documentCacheConfig
-
fieldValueCacheConfig
public final CacheConfig fieldValueCacheConfig
-
userCacheConfigs
public final Map<String,CacheConfig> userCacheConfigs
-
useFilterForSortedQuery
public final boolean useFilterForSortedQuery
-
queryResultWindowSize
public final int queryResultWindowSize
-
queryResultMaxDocsCached
public final int queryResultMaxDocsCached
-
enableLazyFieldLoading
public final boolean enableLazyFieldLoading
-
useRangeVersionsForPeerSync
public final boolean useRangeVersionsForPeerSync
-
hashSetInverseLoadFactor
public final float hashSetInverseLoadFactor
-
hashDocSetMaxSize
public final int hashDocSetMaxSize
-
indexConfig
public final SolrIndexConfig indexConfig
-
updateHandlerInfo
protected SolrConfig.UpdateHandlerInfo updateHandlerInfo
-
maxWarmingSearchers
public final int maxWarmingSearchers
-
useColdSearcher
public final boolean useColdSearcher
-
luceneMatchVersion
public final org.apache.lucene.util.Version luceneMatchVersion
-
dataDir
protected String dataDir
-
slowQueryThresholdMillis
public final int slowQueryThresholdMillis
-
-
Constructor Detail
-
SolrConfig
public SolrConfig() throws ParserConfigurationException, IOException, SAXException
Creates a default instance from the solrconfig.xml.
-
SolrConfig
public SolrConfig(String name) throws ParserConfigurationException, IOException, SAXException
Creates a configuration instance from a configuration name. A default resource loader will be created (@see SolrResourceLoader)- Parameters:
name
- the configuration name used by the loader- Throws:
ParserConfigurationException
IOException
SAXException
-
SolrConfig
public SolrConfig(String name, InputSource is) throws ParserConfigurationException, IOException, SAXException
Creates a configuration instance from a configuration name and stream. A default resource loader will be created (@see SolrResourceLoader). If the stream is null, the resource loader will open the configuration stream. If the stream is not null, no attempt to load the resource will occur (the name is not used).- Parameters:
name
- the configuration nameis
- the configuration stream- Throws:
ParserConfigurationException
IOException
SAXException
-
SolrConfig
public SolrConfig(Path instanceDir, String name, InputSource is) throws ParserConfigurationException, IOException, SAXException
Creates a configuration instance from an instance directory, configuration name and stream.- Parameters:
instanceDir
- the directory used to create the resource loadername
- the configuration name used by the loader if the stream is nullis
- the configuration stream- Throws:
ParserConfigurationException
IOException
SAXException
-
SolrConfig
public SolrConfig(SolrResourceLoader loader, String name, InputSource is) throws ParserConfigurationException, IOException, SAXException
Creates a configuration instance from a resource loader, a configuration name and a stream. If the stream is null, the resource loader will open the configuration stream. If the stream is not null, no attempt to load the resource will occur (the name is not used).- Parameters:
loader
- the resource loadername
- the configuration nameis
- the configuration stream- Throws:
ParserConfigurationException
IOException
SAXException
-
-
Method Detail
-
readFromResourceLoader
public static SolrConfig readFromResourceLoader(SolrResourceLoader loader, String name)
-
parseLuceneVersionString
public static final org.apache.lucene.util.Version parseLuceneVersionString(String matchVersion)
-
getConfigOverlay
public static ConfigOverlay getConfigOverlay(SolrResourceLoader loader)
-
getInitParams
public Map<String,InitParams> getInitParams()
-
loadUpdatehandlerInfo
protected SolrConfig.UpdateHandlerInfo loadUpdatehandlerInfo()
-
convertHeapOptionStyleConfigStringToBytes
protected static long convertHeapOptionStyleConfigStringToBytes(String configStr)
Converts a Java heap option-like config string to bytes. Valid suffixes are: 'k', 'm', 'g' (case insensitive). If there is no suffix, the default unit is bytes. For example, 50k = 50KB, 20m = 20MB, 4g = 4GB, 300 = 300 bytes- Parameters:
configStr
- the config setting to parse- Returns:
- the size, in bytes. -1 if the given config string is empty
-
readPluginInfos
public List<PluginInfo> readPluginInfos(String tag, boolean requireName, boolean requireClass)
-
getRequestParsers
public SolrRequestParsers getRequestParsers()
-
getHttpCachingConfig
public SolrConfig.HttpCachingConfig getHttpCachingConfig()
-
getUpdateHandlerInfo
public SolrConfig.UpdateHandlerInfo getUpdateHandlerInfo()
-
getDataDir
public String getDataDir()
-
getPluginInfos
public List<PluginInfo> getPluginInfos(String type)
SolrConfig keeps a repository of plugins by the type. The known interfaces are the types.- Parameters:
type
- The key is FQN of the plugin class there are a few known types : SolrFormatter, SolrFragmenter SolrRequestHandler,QParserPlugin, QueryResponseWriter,ValueSourceParser, SearchComponent, QueryConverter, SolrEventListener, DirectoryFactory, IndexDeletionPolicy, IndexReaderFactory,TransformerFactory
-
getPluginInfo
public PluginInfo getPluginInfo(String type)
-
getMultipartUploadLimitKB
public int getMultipartUploadLimitKB()
-
getFormUploadLimitKB
public int getFormUploadLimitKB()
-
isHandleSelect
public boolean isHandleSelect()
-
isAddHttpRequestToContext
public boolean isAddHttpRequestToContext()
-
isEnableRemoteStreams
public boolean isEnableRemoteStreams()
-
isEnableStreamBody
public boolean isEnableStreamBody()
-
getInt
public int getInt(String path)
- Overrides:
getInt
in classXmlConfigFile
-
getInt
public int getInt(String path, int def)
- Overrides:
getInt
in classXmlConfigFile
-
getBool
public boolean getBool(String path, boolean def)
- Overrides:
getBool
in classXmlConfigFile
-
get
public String get(String path)
- Overrides:
get
in classXmlConfigFile
-
get
public String get(String path, String def)
- Overrides:
get
in classXmlConfigFile
-
toMap
public Map<String,Object> toMap(Map<String,Object> result)
- Specified by:
toMap
in interfaceMapSerializable
-
getSubstituteProperties
protected Properties getSubstituteProperties()
- Overrides:
getSubstituteProperties
in classXmlConfigFile
-
getOverlay
public ConfigOverlay getOverlay()
-
getRequestParams
public RequestParams getRequestParams()
-
refreshRequestParams
public RequestParams refreshRequestParams()
-
-