org.apache.solr.core
Class SolrConfig

java.lang.Object
  extended by org.apache.solr.core.Config
      extended by org.apache.solr.core.SolrConfig

public class SolrConfig
extends Config

Provides a static reference to a Config object modeling the main configuration data for a a Solr instance -- typically found in "solrconfig.xml".

Version:
$Id: SolrConfig.java 1305693 2012-03-27 00:43:47Z janhoy $

Nested Class Summary
static class SolrConfig.HttpCachingConfig
           
static class SolrConfig.JmxConfiguration
           
static class SolrConfig.UpdateHandlerInfo
           
 
Field Summary
 int booleanQueryMaxClauseCount
           
static SolrConfig config
          Deprecated. Use SolrCore.getSolrConfig() instead.
protected  String dataDir
           
static String DEFAULT_CONF_FILE
           
 SolrIndexConfig defaultIndexConfig
          Deprecated. 
 CacheConfig documentCacheConfig
           
 boolean enableLazyFieldLoading
           
 CacheConfig fieldValueCacheConfig
           
 CacheConfig filterCacheConfig
           
 int hashDocSetMaxSize
           
 float hashSetInverseLoadFactor
           
 SolrIndexConfig indexConfig
           
 SolrConfig.JmxConfiguration jmxConfig
           
static org.slf4j.Logger log
           
 Version luceneMatchVersion
           
 SolrIndexConfig mainIndexConfig
          Deprecated. 
 int maxWarmingSearchers
           
 CacheConfig queryResultCacheConfig
           
 int queryResultMaxDocsCached
           
 int queryResultWindowSize
           
 boolean reopenReaders
           
static Collection<Throwable> severeErrors
          Deprecated. should simply be removed from code, this funcitonality is handled now by logging from the top-most leve.
 boolean unlockOnStartup
           
protected  SolrConfig.UpdateHandlerInfo updateHandlerInfo
           
 boolean useColdSearcher
           
 boolean useFilterForSortedQuery
           
 CacheConfig[] userCacheConfigs
           
 
Constructor Summary
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(String instanceDir, String name, InputSource is)
          Creates a configuration instance from an instance directory, configuration name and stream.
 
Method Summary
 String getDataDir()
           
 SolrConfig.HttpCachingConfig getHttpCachingConfig()
           
 SolrQueryRequest getPingQueryRequest(SolrCore core)
          Deprecated. use PingRequestHandler instead
 PluginInfo getPluginInfo(String type)
           
 List<PluginInfo> getPluginInfos(String type)
          SolrConfig keeps a repository of plugins by the type.
 SolrConfig.UpdateHandlerInfo getUpdateHandlerInfo()
           
protected  SolrConfig.UpdateHandlerInfo loadUpdatehandlerInfo()
           
 List<PluginInfo> readPluginInfos(String tag, boolean requireName, boolean requireClass)
           
 
Methods inherited from class org.apache.solr.core.Config
evaluate, findClass, get, get, getBool, getBool, getConfigDir, getDocument, getDouble, getDouble, getFloat, getFloat, getInstanceDir, getInt, getInt, getLines, getLuceneVersion, getLuceneVersion, getName, getNode, getResourceLoader, getResourceName, getVal, getXPath, newInstance, openResource, parseLuceneVersionString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static final org.slf4j.Logger log

DEFAULT_CONF_FILE

public static final String DEFAULT_CONF_FILE
See Also:
Constant Field Values

config

@Deprecated
public static SolrConfig config
Deprecated. Use SolrCore.getSolrConfig() instead.
Compatibility feature for single-core (pre-solr{215,350} patch); should go away at solr-2.0


severeErrors

@Deprecated
public static final Collection<Throwable> severeErrors
Deprecated. should simply be removed from code, this funcitonality is handled now by logging from the top-most leve.
Singleton keeping track of configuration errors Simply going away in 4.x


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 CacheConfig[] userCacheConfigs

useFilterForSortedQuery

public final boolean useFilterForSortedQuery

queryResultWindowSize

public final int queryResultWindowSize

queryResultMaxDocsCached

public final int queryResultMaxDocsCached

enableLazyFieldLoading

public final boolean enableLazyFieldLoading

reopenReaders

public final boolean reopenReaders

hashSetInverseLoadFactor

public final float hashSetInverseLoadFactor

hashDocSetMaxSize

public final int hashDocSetMaxSize

defaultIndexConfig

@Deprecated
public final SolrIndexConfig defaultIndexConfig
Deprecated. 

mainIndexConfig

@Deprecated
public final SolrIndexConfig mainIndexConfig
Deprecated. 

indexConfig

public final SolrIndexConfig indexConfig

updateHandlerInfo

protected SolrConfig.UpdateHandlerInfo updateHandlerInfo

maxWarmingSearchers

public final int maxWarmingSearchers

unlockOnStartup

public final boolean unlockOnStartup

useColdSearcher

public final boolean useColdSearcher

luceneMatchVersion

public final Version luceneMatchVersion

dataDir

protected String dataDir

jmxConfig

public final SolrConfig.JmxConfiguration jmxConfig
Constructor Detail

SolrConfig

public SolrConfig()
           throws ParserConfigurationException,
                  IOException,
                  SAXException
Creates a default instance from the solrconfig.xml.

Throws:
ParserConfigurationException
IOException
SAXException

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 name
is - the configuration stream
Throws:
ParserConfigurationException
IOException
SAXException

SolrConfig

public SolrConfig(String 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 loader
name - the configuration name used by the loader if the stream is null
is - the configuration stream
Throws:
ParserConfigurationException
IOException
SAXException
Method Detail

loadUpdatehandlerInfo

protected SolrConfig.UpdateHandlerInfo loadUpdatehandlerInfo()

readPluginInfos

public List<PluginInfo> readPluginInfos(String tag,
                                        boolean requireName,
                                        boolean requireClass)

getHttpCachingConfig

public SolrConfig.HttpCachingConfig getHttpCachingConfig()

getPingQueryRequest

@Deprecated
public SolrQueryRequest getPingQueryRequest(SolrCore core)
Deprecated. use PingRequestHandler instead

Returns a Request object based on the admin/pingQuery section of the Solr config file.


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

getPluginInfo

public PluginInfo getPluginInfo(String type)