• Home
  • LLMs
  • Docker
  • Kubernetes
  • Java
  • Maven
  • About
Apache Solr | solrconfig.xml
  1. "solrconfig.xml": structure
  2. Init parameters
  3. Request handlers
  4. Search components
  5. Query response writers
  6. Update processors

  1. "solrconfig.xml": structure
    Visit the Solr Wiki page for more information: https://cwiki.apache.org/confluence/display/solr/SolrConfigXml

    See these sample SolrConfig files for more information (9.8.1):
    ► ${SOLR_HOME}/configsets/_default/conf/solrconfig.xml
    ► ${SOLR_HOME}/configsets/sample_techproducts_configs/conf/solrconfig.xml

    <config>
    
        <luceneMatchVersion>9.3</luceneMatchVersion>
    
        <lib dir="" regex="" />
    
        <dataDir>${solr.data.dir:}</dataDir>
    
        <directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}"/>
    
        <codecFactory class="solr.SchemaCodecFactory"/>
    
        <indexConfig>
    
        <jmx />
    
        <initParams path="/update/**,/query,/select,/tvrh,/elevate,/spell,/browse">
            <lst name="defaults">
                <str name="df">_text_</str>
            </lst>
        </initParams>
    
        <updateHandler class="solr.DirectUpdateHandler2">
            <updateLog />
            <autoCommit />
            <autoSoftCommit />
        </updateHandler>
    
        <query>
            <maxBooleanClauses />
            <filterCache />
            <queryResultCache />
            <documentCache />
            <cache />
            <enableLazyFieldLoading />
            <queryResultWindowSize />
            <queryResultMaxDocsCached />
            <listener />
            <useColdSearcher />
        </query>
    
        <requestDispatcher>
            <httpCaching />
        </requestDispatcher>
    
        <requestHandler name="" class="">
            <lst />
        </requestHandler>
    
        <searchComponent path="">
            <str />
            <lst />
        </searchComponent>
    
        <updateProcessor name="" />
    
        <updateRequestProcessorChain name="" />
    
        <queryResponseWriter />
    
    </config>
  2. Init parameters
    <initParams path="/update/**,/query,/select,/tvrh,/elevate,/spell,/browse">
        <lst name="defaults">
            <str name="df">_text_</str>
        </lst>
    </initParams>
  3. Request handlers
    Visit the Solr wiki page for more information: https://wiki.apache.org/solr/SolrRequestHandler

    /query [class: solr.SearchHandler]
    
    /browse [class: solr.SearchHandler]
    
    /select [class: solr.SearchHandler]

    /elevate [class: solr.SearchHandler] [searchComponent: elevator]
    
    /spell [class: solr.SearchHandler] [searchComponent: spellcheck]
    
    /terms [class: solr.SearchHandler] [searchComponent: terms]
    
    /tvrh [class: solr.SearchHandler] [searchComponent: tvComponent]

    /update/extract [class: solr.extraction.ExtractingRequestHandler"]
  4. Search components
    Visit the Solr wiki page for more information: https://wiki.apache.org/solr/SearchComponent

    By default, the following search components are available:
    query [class: solr.QueryComponent]
    
    facet [class: solr.FacetComponent]
    
    mlt [class: solr.MoreLikeThisComponent]
    
    stats [class: solr.StatsComponent]
    
    debug [class: solr.DebugComponent]

    By default, the following search components have a custom configuration:
    elevator [class: solr.QueryElevationComponent]
    
    highlight [class: solr.HighlightComponent]
    
    spellcheck [class: solr.SpellCheckComponent]
    
    terms [class: solr.TermsComponent]
    
    tvComponent [class: solr.TermVectorComponent]
  5. Query response writers
    Visit the Solr wiki page for more information: https://wiki.apache.org/solr/QueryResponseWriter

    By default, the following query response writers are available:
    xml [default: true] [class: solr.XMLResponseWriter]
    
    python [class: solr.PythonResponseWriter]
    
    ruby [class: solr.RubyResponseWriter]
    
    php [class: solr.PHPResponseWriter]
    
    phps [class: solr.PHPSerializedResponseWriter]
    
    csv [class: solr.CSVResponseWriter]
    
    schema.xml [class: solr.SchemaXmlResponseWriter]

    By default, the following query response writers have a custom configuration:
    <queryResponseWriter name="json" class="solr.JSONResponseWriter">
        <str name="content-type">text/plain; charset=UTF-8</str>
    </queryResponseWriter>

    <queryResponseWriter name="velocity" class="solr.VelocityResponseWriter" startup="lazy">
        <str name="template.base.dir">${velocity.template.base.dir:}</str>
        <str name="solr.resource.loader.enabled">${velocity.solr.resource.loader.enabled:true}</str>
        <str name="params.resource.loader.enabled">${velocity.params.resource.loader.enabled:false}</str>
    </queryResponseWriter>

    <queryResponseWriter name="xslt" class="solr.XSLTResponseWriter">
        <int name="xsltCacheLifetimeSeconds">5</int>
    </queryResponseWriter>
  6. Update processors
    Visit the Solr wiki page for more information: https://wiki.apache.org/solr/UpdateRequestProcessor

    uuid [class: solr.UUIDUpdateProcessorFactory]
    
    remove-blank [class: solr.RemoveBlankFieldUpdateProcessorFactory]
    
    field-name-mutating [class: solr.FieldNameMutatingUpdateProcessorFactory]
    
    parse-boolean [class: solr.ParseBooleanFieldUpdateProcessorFactory]
    
    parse-long [class: solr.ParseLongFieldUpdateProcessorFactory]
    
    parse-double [class: solr.ParseDoubleFieldUpdateProcessorFactory]
    
    parse-date [class: solr.ParseDateFieldUpdateProcessorFactory]
    
    add-schema-fields [class: solr.AddSchemaFieldsUpdateProcessorFactory]

    <updateRequestProcessorChain name="add-unknown-fields-to-the-schema" default="${update.autoCreateFields:true}"
        processor="uuid,remove-blank,field-name-mutating,parse-boolean,parse-long,parse-double,parse-date,add-schema-fields">
        <processor class="solr.LogUpdateProcessorFactory" />
        <processor class="solr.DistributedUpdateProcessorFactory" />
        <processor class="solr.RunUpdateProcessorFactory" />
    </updateRequestProcessorChain>
© 2025  mtitek