Package org.apache.solr.core
Class SolrConfig
- java.lang.Object
-
- org.apache.solr.core.SolrConfig
-
- All Implemented Interfaces:
org.apache.solr.common.MapSerializable
public class SolrConfig extends Object implements org.apache.solr.common.MapSerializable
Provides a static reference to a Config object modeling the main configuration data for a Solr instance -- typically found in "solrconfig.xml".
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSolrConfig.HttpCachingConfigstatic classSolrConfig.PluginOptsstatic classSolrConfig.SolrPluginInfostatic classSolrConfig.UpdateHandlerInfo
-
Field Summary
Fields Modifier and Type Field Description intbooleanQueryMaxClauseCountstatic Map<String,SolrConfig.SolrPluginInfo>classVsSolrPluginInfoprotected StringdataDirstatic StringDEFAULT_CONF_FILEstatic intDEFAULT_MIN_PREFIX_QUERY_TERM_LENGTHCacheConfigdocumentCacheConfigbooleanenableLazyFieldLoadingCacheConfigfieldValueCacheConfigCacheConfigfilterCacheConfigSolrIndexConfigindexConfigstatic StringLIB_ENABLED_SYSPROPorg.apache.lucene.util.VersionluceneMatchVersionintmaxWarmingSearchersstatic StringMIN_PREFIX_QUERY_TERM_LENGTHstatic List<SolrConfig.SolrPluginInfo>pluginsintprefixQueryMinPrefixLengthCacheConfigqueryResultCacheConfigintqueryResultMaxDocsCachedintqueryResultWindowSizeintslowQueryThresholdMillisprotected SolrConfig.UpdateHandlerInfoupdateHandlerInfobooleanuseColdSearcherbooleanuseFilterForSortedQueryMap<String,CacheConfig>userCacheConfigs
-
Constructor Summary
Constructors Constructor Description SolrConfig(Path instanceDir, String name)TEST-ONLY: Creates a configuration instance from an instance directory and file name
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static longconvertHeapOptionStyleConfigStringToBytes(String configStr)Converts a Java heap option-like config string to bytes.StringeffectiveId()Generates a String ID to represent theSolrConfigorg.apache.solr.common.ConfigNodeget(String name)fetches a child node by name.org.apache.solr.common.ConfigNodeget(String name, Predicate<org.apache.solr.common.ConfigNode> test)static ConfigOverlaygetConfigOverlay(SolrResourceLoader loader)StringgetDataDir()intgetFormUploadLimitKB()SolrConfig.HttpCachingConfiggetHttpCachingConfig()Map<String,InitParams>getInitParams()intgetMultipartUploadLimitKB()StringgetName()ConfigOverlaygetOverlay()PluginInfogetPluginInfo(String type)List<PluginInfo>getPluginInfos(String type)SolrConfig keeps a repository of plugins by the type.RequestParamsgetRequestParams()SolrRequestParsersgetRequestParsers()SolrResourceLoadergetResourceLoader()StringgetResourceName()PropertiesgetSubstituteProperties()SolrConfig.UpdateHandlerInfogetUpdateHandlerInfo()intgetZnodeVersion()booleanisAddHttpRequestToContext()booleanisHandleSelect()protected SolrConfig.UpdateHandlerInfoloadUpdatehandlerInfo()StringmaxPackageVersion(String pkg)The version of package that should be loaded for a given package name This information is stored in the params.json in the same configset If params.json is absent or there is no corresponding version specified for a given package, this returns a null and the latest is used by the callerstatic org.apache.lucene.util.VersionparseLuceneVersionString(String matchVersion)static SolrConfigreadFromResourceLoader(SolrResourceLoader loader, String name, boolean isConfigsetTrusted, Properties substitutableProperties)List<PluginInfo>readPluginInfos(SolrConfig.SolrPluginInfo info, boolean requireName, boolean requireClass)RequestParamsrefreshRequestParams()Map<String,Object>toMap(Map<String,Object> result)
-
-
-
Field Detail
-
DEFAULT_CONF_FILE
public static final String DEFAULT_CONF_FILE
- See Also:
- Constant Field Values
-
MIN_PREFIX_QUERY_TERM_LENGTH
public static final String MIN_PREFIX_QUERY_TERM_LENGTH
- See Also:
- Constant Field Values
-
DEFAULT_MIN_PREFIX_QUERY_TERM_LENGTH
public static final int DEFAULT_MIN_PREFIX_QUERY_TERM_LENGTH
- 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
-
prefixQueryMinPrefixLength
public final int prefixQueryMinPrefixLength
-
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
-
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
-
LIB_ENABLED_SYSPROP
public static final String LIB_ENABLED_SYSPROP
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SolrConfig
public SolrConfig(Path instanceDir, String name) throws IOException
TEST-ONLY: Creates a configuration instance from an instance directory and file name- Parameters:
instanceDir- the directory used to create the resource loadername- the configuration name used by the loader if the stream is null- Throws:
IOException
-
-
Method Detail
-
readFromResourceLoader
public static SolrConfig readFromResourceLoader(SolrResourceLoader loader, String name, boolean isConfigsetTrusted, Properties substitutableProperties)
-
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(SolrConfig.SolrPluginInfo info, 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()
-
toMap
public Map<String,Object> toMap(Map<String,Object> result)
- Specified by:
toMapin interfaceorg.apache.solr.common.MapSerializable
-
getSubstituteProperties
public Properties getSubstituteProperties()
-
getOverlay
public ConfigOverlay getOverlay()
-
getRequestParams
public RequestParams getRequestParams()
-
maxPackageVersion
public String maxPackageVersion(String pkg)
The version of package that should be loaded for a given package name This information is stored in the params.json in the same configset If params.json is absent or there is no corresponding version specified for a given package, this returns a null and the latest is used by the caller
-
refreshRequestParams
public RequestParams refreshRequestParams()
-
getResourceLoader
public SolrResourceLoader getResourceLoader()
-
getZnodeVersion
public int getZnodeVersion()
-
getName
public String getName()
-
getResourceName
public String getResourceName()
-
get
public org.apache.solr.common.ConfigNode get(String name)
fetches a child node by name. An "empty node" is returned if the child does not exist This never returns a null
-
get
public org.apache.solr.common.ConfigNode get(String name, Predicate<org.apache.solr.common.ConfigNode> test)
-
effectiveId
public String effectiveId()
Generates a String ID to represent theSolrConfigRelies on the name of the SolrConfig,
String.hashCode()to generate a "unique" id for the solr.xml data (including substitutions), and the version of the overlay. These 3 pieces of data should combine to make a "unique" identifier for SolrConfigs, since those are ultimately all inputs to modifying the solr.xml result.
-
-