"Fossies" - the Fresh Open Source Software Archive

Member "solr-8.4.1/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml" (10 Jan 2020, 64960 Bytes) of package /linux/www/solr-8.4.1-src.tgz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) XML source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "solrconfig.xml": 8.4.0_vs_8.4.1.

    1 <?xml version="1.0" encoding="UTF-8" ?>
    2 <!--
    3  Licensed to the Apache Software Foundation (ASF) under one or more
    4  contributor license agreements.  See the NOTICE file distributed with
    5  this work for additional information regarding copyright ownership.
    6  The ASF licenses this file to You under the Apache License, Version 2.0
    7  (the "License"); you may not use this file except in compliance with
    8  the License.  You may obtain a copy of the License at
    9 
   10      http://www.apache.org/licenses/LICENSE-2.0
   11 
   12  Unless required by applicable law or agreed to in writing, software
   13  distributed under the License is distributed on an "AS IS" BASIS,
   14  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   15  See the License for the specific language governing permissions and
   16  limitations under the License.
   17 -->
   18 
   19 <!--
   20      For more details about configurations options that may appear in
   21      this file, see http://wiki.apache.org/solr/SolrConfigXml.
   22 -->
   23 <config>
   24   <!-- In all configuration below, a prefix of "solr." for class names
   25        is an alias that causes solr to search appropriate packages,
   26        including org.apache.solr.(search|update|request|core|analysis)
   27 
   28        You may also specify a fully qualified Java classname if you
   29        have your own custom plugins.
   30     -->
   31 
   32   <!-- Controls what version of Lucene various components of Solr
   33        adhere to.  Generally, you want to use the latest version to
   34        get all bug fixes and improvements. It is highly recommended
   35        that you fully re-index after changing this setting as it can
   36        affect both how text is indexed and queried.
   37   -->
   38   <luceneMatchVersion>8.4.1</luceneMatchVersion>
   39 
   40   <!-- <lib/> directives can be used to instruct Solr to load any Jars
   41        identified and use them to resolve any "plugins" specified in
   42        your solrconfig.xml or schema.xml (ie: Analyzers, Request
   43        Handlers, etc...).
   44 
   45        All directories and paths are resolved relative to the
   46        instanceDir.
   47 
   48        Please note that <lib/> directives are processed in the order
   49        that they appear in your solrconfig.xml file, and are "stacked"
   50        on top of each other when building a ClassLoader - so if you have
   51        plugin jars with dependencies on other jars, the "lower level"
   52        dependency jars should be loaded first.
   53 
   54        If a "./lib" directory exists in your instanceDir, all files
   55        found in it are included as if you had used the following
   56        syntax...
   57 
   58               <lib dir="./lib" />
   59     -->
   60 
   61   <!-- A 'dir' option by itself adds any files found in the directory
   62        to the classpath, this is useful for including all jars in a
   63        directory.
   64 
   65        When a 'regex' is specified in addition to a 'dir', only the
   66        files in that directory which completely match the regex
   67        (anchored on both ends) will be included.
   68 
   69        If a 'dir' option (with or without a regex) is used and nothing
   70        is found that matches, a warning will be logged.
   71 
   72        The examples below can be used to load some solr-contribs along
   73        with their external dependencies.
   74     -->
   75   <lib dir="${solr.install.dir:../../../..}/contrib/extraction/lib" regex=".*\.jar" />
   76   <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-cell-\d.*\.jar" />
   77 
   78   <lib dir="${solr.install.dir:../../../..}/contrib/clustering/lib/" regex=".*\.jar" />
   79   <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-clustering-\d.*\.jar" />
   80 
   81   <lib dir="${solr.install.dir:../../../..}/contrib/langid/lib/" regex=".*\.jar" />
   82   <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-langid-\d.*\.jar" />
   83 
   84   <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-ltr-\d.*\.jar" />
   85 
   86   <lib dir="${solr.install.dir:../../../..}/contrib/velocity/lib" regex=".*\.jar" />
   87   <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-velocity-\d.*\.jar" />
   88 
   89   <!-- an exact 'path' can be used instead of a 'dir' to specify a
   90        specific jar file.  This will cause a serious error to be logged
   91        if it can't be loaded.
   92     -->
   93   <!--
   94      <lib path="../a-jar-that-does-not-exist.jar" />
   95   -->
   96 
   97   <!-- Data Directory
   98 
   99        Used to specify an alternate directory to hold all index data
  100        other than the default ./data under the Solr home.  If
  101        replication is in use, this should match the replication
  102        configuration.
  103     -->
  104   <dataDir>${solr.data.dir:}</dataDir>
  105 
  106 
  107   <!-- The DirectoryFactory to use for indexes.
  108 
  109        solr.StandardDirectoryFactory is filesystem
  110        based and tries to pick the best implementation for the current
  111        JVM and platform.  solr.NRTCachingDirectoryFactory, the default,
  112        wraps solr.StandardDirectoryFactory and caches small files in memory
  113        for better NRT performance.
  114 
  115        One can force a particular implementation via solr.MMapDirectoryFactory,
  116        solr.NIOFSDirectoryFactory, or solr.SimpleFSDirectoryFactory.
  117 
  118        solr.RAMDirectoryFactory is memory based and not persistent.
  119     -->
  120   <directoryFactory name="DirectoryFactory"
  121                     class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}"/>
  122 
  123   <!-- The CodecFactory for defining the format of the inverted index.
  124        The default implementation is SchemaCodecFactory, which is the official Lucene
  125        index format, but hooks into the schema to provide per-field customization of
  126        the postings lists and per-document values in the fieldType element
  127        (postingsFormat/docValuesFormat). Note that most of the alternative implementations
  128        are experimental, so if you choose to customize the index format, it's a good
  129        idea to convert back to the official format e.g. via IndexWriter.addIndexes(IndexReader)
  130        before upgrading to a newer version to avoid unnecessary reindexing.
  131        A "compressionMode" string element can be added to <codecFactory> to choose
  132        between the existing compression modes in the default codec: "BEST_SPEED" (default)
  133        or "BEST_COMPRESSION".
  134   -->
  135   <codecFactory class="solr.SchemaCodecFactory"/>
  136 
  137   <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  138        Index Config - These settings control low-level behavior of indexing
  139        Most example settings here show the default value, but are commented
  140        out, to more easily see where customizations have been made.
  141 
  142        Note: This replaces <indexDefaults> and <mainIndex> from older versions
  143        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  144   <indexConfig>
  145     <!-- maxFieldLength was removed in 4.0. To get similar behavior, include a
  146          LimitTokenCountFilterFactory in your fieldType definition. E.g.
  147      <filter class="solr.LimitTokenCountFilterFactory" maxTokenCount="10000"/>
  148     -->
  149     <!-- Maximum time to wait for a write lock (ms) for an IndexWriter. Default: 1000 -->
  150     <!-- <writeLockTimeout>1000</writeLockTimeout>  -->
  151 
  152     <!-- Expert: Enabling compound file will use less files for the index,
  153          using fewer file descriptors on the expense of performance decrease.
  154          Default in Lucene is "true". Default in Solr is "false" (since 3.6) -->
  155     <!-- <useCompoundFile>false</useCompoundFile> -->
  156 
  157     <!-- ramBufferSizeMB sets the amount of RAM that may be used by Lucene
  158          indexing for buffering added documents and deletions before they are
  159          flushed to the Directory.
  160          maxBufferedDocs sets a limit on the number of documents buffered
  161          before flushing.
  162          If both ramBufferSizeMB and maxBufferedDocs is set, then
  163          Lucene will flush based on whichever limit is hit first.
  164          The default is 100 MB.  -->
  165     <!-- <ramBufferSizeMB>100</ramBufferSizeMB> -->
  166     <!-- <maxBufferedDocs>1000</maxBufferedDocs> -->
  167 
  168     <!-- Expert: ramPerThreadHardLimitMB sets the maximum amount of RAM that can be consumed
  169          per thread before they are flushed. When limit is exceeded, this triggers a forced
  170          flush even if ramBufferSizeMB has not been exceeded.
  171          This is a safety limit to prevent Lucene's DocumentsWriterPerThread from address space
  172          exhaustion due to its internal 32 bit signed integer based memory addressing.
  173          The specified value should be greater than 0 and less than 2048MB. When not specified,
  174          Solr uses Lucene's default value 1945. -->
  175     <!-- <ramPerThreadHardLimitMB>1945</ramPerThreadHardLimitMB> -->
  176 
  177     <!-- Expert: Merge Policy
  178          The Merge Policy in Lucene controls how merging of segments is done.
  179          The default since Solr/Lucene 3.3 is TieredMergePolicy.
  180          The default since Lucene 2.3 was the LogByteSizeMergePolicy,
  181          Even older versions of Lucene used LogDocMergePolicy.
  182       -->
  183     <!--
  184         <mergePolicyFactory class="org.apache.solr.index.TieredMergePolicyFactory">
  185           <int name="maxMergeAtOnce">10</int>
  186           <int name="segmentsPerTier">10</int>
  187           <double name="noCFSRatio">0.1</double>
  188         </mergePolicyFactory>
  189       -->
  190 
  191     <!-- Expert: Merge Scheduler
  192          The Merge Scheduler in Lucene controls how merges are
  193          performed.  The ConcurrentMergeScheduler (Lucene 2.3 default)
  194          can perform merges in the background using separate threads.
  195          The SerialMergeScheduler (Lucene 2.2 default) does not.
  196      -->
  197     <!--
  198        <mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"/>
  199        -->
  200 
  201     <!-- LockFactory
  202 
  203          This option specifies which Lucene LockFactory implementation
  204          to use.
  205 
  206          single = SingleInstanceLockFactory - suggested for a
  207                   read-only index or when there is no possibility of
  208                   another process trying to modify the index.
  209          native = NativeFSLockFactory - uses OS native file locking.
  210                   Do not use when multiple solr webapps in the same
  211                   JVM are attempting to share a single index.
  212          simple = SimpleFSLockFactory  - uses a plain file for locking
  213 
  214          Defaults: 'native' is default for Solr3.6 and later, otherwise
  215                    'simple' is the default
  216 
  217          More details on the nuances of each LockFactory...
  218          http://wiki.apache.org/lucene-java/AvailableLockFactories
  219     -->
  220     <lockType>${solr.lock.type:native}</lockType>
  221 
  222     <!-- Commit Deletion Policy
  223          Custom deletion policies can be specified here. The class must
  224          implement org.apache.lucene.index.IndexDeletionPolicy.
  225 
  226          The default Solr IndexDeletionPolicy implementation supports
  227          deleting index commit points on number of commits, age of
  228          commit point and optimized status.
  229 
  230          The latest commit point should always be preserved regardless
  231          of the criteria.
  232     -->
  233     <!--
  234     <deletionPolicy class="solr.SolrDeletionPolicy">
  235     -->
  236       <!-- The number of commit points to be kept -->
  237       <!-- <str name="maxCommitsToKeep">1</str> -->
  238       <!-- The number of optimized commit points to be kept -->
  239       <!-- <str name="maxOptimizedCommitsToKeep">0</str> -->
  240       <!--
  241           Delete all commit points once they have reached the given age.
  242           Supports DateMathParser syntax e.g.
  243         -->
  244       <!--
  245          <str name="maxCommitAge">30MINUTES</str>
  246          <str name="maxCommitAge">1DAY</str>
  247       -->
  248     <!--
  249     </deletionPolicy>
  250     -->
  251 
  252     <!-- Lucene Infostream
  253 
  254          To aid in advanced debugging, Lucene provides an "InfoStream"
  255          of detailed information when indexing.
  256 
  257          Setting the value to true will instruct the underlying Lucene
  258          IndexWriter to write its info stream to solr's log. By default,
  259          this is enabled here, and controlled through log4j2.xml
  260       -->
  261      <infoStream>true</infoStream>
  262   </indexConfig>
  263 
  264 
  265   <!-- JMX
  266 
  267        This example enables JMX if and only if an existing MBeanServer
  268        is found, use this if you want to configure JMX through JVM
  269        parameters. Remove this to disable exposing Solr configuration
  270        and statistics to JMX.
  271 
  272        For more details see http://wiki.apache.org/solr/SolrJmx
  273     -->
  274   <jmx />
  275   <!-- If you want to connect to a particular server, specify the
  276        agentId
  277     -->
  278   <!-- <jmx agentId="myAgent" /> -->
  279   <!-- If you want to start a new MBeanServer, specify the serviceUrl -->
  280   <!-- <jmx serviceUrl="service:jmx:rmi:///jndi/rmi://localhost:9999/solr"/>
  281     -->
  282 
  283   <!-- The default high-performance update handler -->
  284   <updateHandler class="solr.DirectUpdateHandler2">
  285 
  286     <!-- Enables a transaction log, used for real-time get, durability, and
  287          and solr cloud replica recovery.  The log can grow as big as
  288          uncommitted changes to the index, so use of a hard autoCommit
  289          is recommended (see below).
  290          "dir" - the target directory for transaction logs, defaults to the
  291                 solr data directory.
  292          "numVersionBuckets" - sets the number of buckets used to keep
  293                 track of max version values when checking for re-ordered
  294                 updates; increase this value to reduce the cost of
  295                 synchronizing access to version buckets during high-volume
  296                 indexing, this requires 8 bytes (long) * numVersionBuckets
  297                 of heap space per Solr core.
  298     -->
  299     <updateLog>
  300       <str name="dir">${solr.ulog.dir:}</str>
  301       <int name="numVersionBuckets">${solr.ulog.numVersionBuckets:65536}</int>
  302     </updateLog>
  303 
  304     <!-- AutoCommit
  305 
  306          Perform a hard commit automatically under certain conditions.
  307          Instead of enabling autoCommit, consider using "commitWithin"
  308          when adding documents.
  309 
  310          http://wiki.apache.org/solr/UpdateXmlMessages
  311 
  312          maxDocs - Maximum number of documents to add since the last
  313                    commit before automatically triggering a new commit.
  314 
  315          maxTime - Maximum amount of time in ms that is allowed to pass
  316                    since a document was added before automatically
  317                    triggering a new commit.
  318          openSearcher - if false, the commit causes recent index changes
  319            to be flushed to stable storage, but does not cause a new
  320            searcher to be opened to make those changes visible.
  321 
  322          If the updateLog is enabled, then it's highly recommended to
  323          have some sort of hard autoCommit to limit the log size.
  324       -->
  325      <autoCommit>
  326        <maxTime>${solr.autoCommit.maxTime:15000}</maxTime>
  327        <openSearcher>false</openSearcher>
  328      </autoCommit>
  329 
  330     <!-- softAutoCommit is like autoCommit except it causes a
  331          'soft' commit which only ensures that changes are visible
  332          but does not ensure that data is synced to disk.  This is
  333          faster and more near-realtime friendly than a hard commit.
  334       -->
  335 
  336      <autoSoftCommit>
  337        <maxTime>${solr.autoSoftCommit.maxTime:-1}</maxTime>
  338      </autoSoftCommit>
  339 
  340     <!-- Update Related Event Listeners
  341 
  342          Various IndexWriter related events can trigger Listeners to
  343          take actions.
  344 
  345          postCommit - fired after every commit or optimize command
  346          postOptimize - fired after every optimize command
  347       -->
  348 
  349   </updateHandler>
  350 
  351   <!-- IndexReaderFactory
  352 
  353        Use the following format to specify a custom IndexReaderFactory,
  354        which allows for alternate IndexReader implementations.
  355 
  356        ** Experimental Feature **
  357 
  358        Please note - Using a custom IndexReaderFactory may prevent
  359        certain other features from working. The API to
  360        IndexReaderFactory may change without warning or may even be
  361        removed from future releases if the problems cannot be
  362        resolved.
  363 
  364 
  365        ** Features that may not work with custom IndexReaderFactory **
  366 
  367        The ReplicationHandler assumes a disk-resident index. Using a
  368        custom IndexReader implementation may cause incompatibility
  369        with ReplicationHandler and may cause replication to not work
  370        correctly. See SOLR-1366 for details.
  371 
  372     -->
  373   <!--
  374   <indexReaderFactory name="IndexReaderFactory" class="package.class">
  375     <str name="someArg">Some Value</str>
  376   </indexReaderFactory >
  377   -->
  378 
  379   <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  380        Query section - these settings control query time things like caches
  381        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  382   <query>
  383 
  384     <!-- Maximum number of clauses allowed when parsing a boolean query string.
  385          
  386          This limit only impacts boolean queries specified by a user as part of a query string,
  387          and provides per-collection controls on how complex user specified boolean queries can
  388          be.  Query strings that specify more clauses then this will result in an error.
  389          
  390          If this per-collection limit is greater then the global `maxBooleanClauses` limit
  391          specified in `solr.xml`, it will have no effect, as that setting also limits the size
  392          of user specified boolean queries.
  393       -->
  394     <maxBooleanClauses>${solr.max.booleanClauses:1024}</maxBooleanClauses>
  395 
  396 
  397     <!-- Slow Query Threshold (in millis)
  398 
  399          At high request rates, logging all requests can become a bottleneck
  400          and therefore INFO logging is often turned off. However, it is still
  401          useful to be able to set a latency threshold above which a request
  402          is considered "slow" and log that request at WARN level so we can
  403          easily identify slow queries.
  404     -->
  405     <slowQueryThresholdMillis>-1</slowQueryThresholdMillis>
  406 
  407 
  408     <!-- Solr Internal Query Caches
  409 
  410          There are two implementations of cache available for Solr,
  411          LRUCache, based on a synchronized LinkedHashMap, and
  412          FastLRUCache, based on a ConcurrentHashMap.
  413 
  414          FastLRUCache has faster gets and slower puts in single
  415          threaded operation and thus is generally faster than LRUCache
  416          when the hit ratio of the cache is high (> 75%), and may be
  417          faster under other scenarios on multi-cpu systems.
  418     -->
  419 
  420     <!-- Filter Cache
  421 
  422          Cache used by SolrIndexSearcher for filters (DocSets),
  423          unordered sets of *all* documents that match a query.  When a
  424          new searcher is opened, its caches may be prepopulated or
  425          "autowarmed" using data from caches in the old searcher.
  426          autowarmCount is the number of items to prepopulate.  For
  427          LRUCache, the autowarmed items will be the most recently
  428          accessed items.
  429 
  430          Parameters:
  431            class - the SolrCache implementation LRUCache or
  432                (LRUCache or FastLRUCache)
  433            size - the maximum number of entries in the cache
  434            initialSize - the initial capacity (number of entries) of
  435                the cache.  (see java.util.HashMap)
  436            autowarmCount - the number of entries to prepopulate from
  437                and old cache.
  438            maxRamMB - the maximum amount of RAM (in MB) that this cache is allowed
  439                       to occupy. Note that when this option is specified, the size
  440                       and initialSize parameters are ignored.
  441       -->
  442     <filterCache class="solr.FastLRUCache"
  443                  size="512"
  444                  initialSize="512"
  445                  autowarmCount="0"/>
  446 
  447     <!-- Query Result Cache
  448 
  449         Caches results of searches - ordered lists of document ids
  450         (DocList) based on a query, a sort, and the range of documents requested.
  451         Additional supported parameter by LRUCache:
  452            maxRamMB - the maximum amount of RAM (in MB) that this cache is allowed
  453                       to occupy
  454      -->
  455     <queryResultCache class="solr.LRUCache"
  456                      size="512"
  457                      initialSize="512"
  458                      autowarmCount="0"/>
  459 
  460     <!-- Document Cache
  461 
  462          Caches Lucene Document objects (the stored fields for each
  463          document).  Since Lucene internal document ids are transient,
  464          this cache will not be autowarmed.
  465       -->
  466     <documentCache class="solr.LRUCache"
  467                    size="512"
  468                    initialSize="512"
  469                    autowarmCount="0"/>
  470 
  471     <!-- custom cache currently used by block join -->
  472     <cache name="perSegFilter"
  473       class="solr.search.LRUCache"
  474       size="10"
  475       initialSize="0"
  476       autowarmCount="10"
  477       regenerator="solr.NoOpRegenerator" />
  478 
  479     <!-- Field Value Cache
  480 
  481          Cache used to hold field values that are quickly accessible
  482          by document id.  The fieldValueCache is created by default
  483          even if not configured here.
  484       -->
  485     <!--
  486        <fieldValueCache class="solr.FastLRUCache"
  487                         size="512"
  488                         autowarmCount="128"
  489                         showItems="32" />
  490       -->
  491 
  492     <!-- Feature Values Cache
  493 
  494          Cache used by the Learning To Rank (LTR) contrib module.
  495 
  496          You will need to set the solr.ltr.enabled system property
  497          when running solr to run with ltr enabled:
  498            -Dsolr.ltr.enabled=true
  499 
  500          https://lucene.apache.org/solr/guide/learning-to-rank.html
  501       -->
  502     <cache enable="${solr.ltr.enabled:false}" name="QUERY_DOC_FV"
  503            class="solr.search.LRUCache"
  504            size="4096"
  505            initialSize="2048"
  506            autowarmCount="4096"
  507            regenerator="solr.search.NoOpRegenerator" />
  508 
  509     <!-- Custom Cache
  510 
  511          Example of a generic cache.  These caches may be accessed by
  512          name through SolrIndexSearcher.getCache(),cacheLookup(), and
  513          cacheInsert().  The purpose is to enable easy caching of
  514          user/application level data.  The regenerator argument should
  515          be specified as an implementation of solr.CacheRegenerator
  516          if autowarming is desired.
  517       -->
  518     <!--
  519        <cache name="myUserCache"
  520               class="solr.LRUCache"
  521               size="4096"
  522               initialSize="1024"
  523               autowarmCount="1024"
  524               regenerator="com.mycompany.MyRegenerator"
  525               />
  526       -->
  527 
  528 
  529     <!-- Lazy Field Loading
  530 
  531          If true, stored fields that are not requested will be loaded
  532          lazily.  This can result in a significant speed improvement
  533          if the usual case is to not load all stored fields,
  534          especially if the skipped fields are large compressed text
  535          fields.
  536     -->
  537     <enableLazyFieldLoading>true</enableLazyFieldLoading>
  538 
  539    <!-- Use Filter For Sorted Query
  540 
  541         A possible optimization that attempts to use a filter to
  542         satisfy a search.  If the requested sort does not include
  543         score, then the filterCache will be checked for a filter
  544         matching the query. If found, the filter will be used as the
  545         source of document ids, and then the sort will be applied to
  546         that.
  547 
  548         For most situations, this will not be useful unless you
  549         frequently get the same search repeatedly with different sort
  550         options, and none of them ever use "score"
  551      -->
  552    <!--
  553       <useFilterForSortedQuery>true</useFilterForSortedQuery>
  554      -->
  555 
  556    <!-- Result Window Size
  557 
  558         An optimization for use with the queryResultCache.  When a search
  559         is requested, a superset of the requested number of document ids
  560         are collected.  For example, if a search for a particular query
  561         requests matching documents 10 through 19, and queryWindowSize is 50,
  562         then documents 0 through 49 will be collected and cached.  Any further
  563         requests in that range can be satisfied via the cache.
  564      -->
  565    <queryResultWindowSize>20</queryResultWindowSize>
  566 
  567    <!-- Maximum number of documents to cache for any entry in the
  568         queryResultCache.
  569      -->
  570    <queryResultMaxDocsCached>200</queryResultMaxDocsCached>
  571 
  572    <!-- Query Related Event Listeners
  573 
  574         Various IndexSearcher related events can trigger Listeners to
  575         take actions.
  576 
  577         newSearcher - fired whenever a new searcher is being prepared
  578         and there is a current searcher handling requests (aka
  579         registered).  It can be used to prime certain caches to
  580         prevent long request times for certain requests.
  581 
  582         firstSearcher - fired whenever a new searcher is being
  583         prepared but there is no current registered searcher to handle
  584         requests or to gain autowarming data from.
  585 
  586 
  587      -->
  588     <!-- QuerySenderListener takes an array of NamedList and executes a
  589          local query request for each NamedList in sequence.
  590       -->
  591     <listener event="newSearcher" class="solr.QuerySenderListener">
  592       <arr name="queries">
  593         <!--
  594            <lst><str name="q">solr</str><str name="sort">price asc</str></lst>
  595            <lst><str name="q">rocks</str><str name="sort">weight asc</str></lst>
  596           -->
  597       </arr>
  598     </listener>
  599     <listener event="firstSearcher" class="solr.QuerySenderListener">
  600       <arr name="queries">
  601         <lst>
  602           <str name="q">static firstSearcher warming in solrconfig.xml</str>
  603         </lst>
  604       </arr>
  605     </listener>
  606 
  607     <!-- Use Cold Searcher
  608 
  609          If a search request comes in and there is no current
  610          registered searcher, then immediately register the still
  611          warming searcher and use it.  If "false" then all requests
  612          will block until the first searcher is done warming.
  613       -->
  614     <useColdSearcher>false</useColdSearcher>
  615 
  616   </query>
  617 
  618 
  619   <!-- Request Dispatcher
  620 
  621        This section contains instructions for how the SolrDispatchFilter
  622        should behave when processing requests for this SolrCore.
  623 
  624     -->
  625   <requestDispatcher>
  626     <!-- Request Parsing
  627 
  628          These settings indicate how Solr Requests may be parsed, and
  629          what restrictions may be placed on the ContentStreams from
  630          those requests
  631 
  632          enableRemoteStreaming - enables use of the stream.file
  633          and stream.url parameters for specifying remote streams.
  634 
  635          multipartUploadLimitInKB - specifies the max size (in KiB) of
  636          Multipart File Uploads that Solr will allow in a Request.
  637 
  638          formdataUploadLimitInKB - specifies the max size (in KiB) of
  639          form data (application/x-www-form-urlencoded) sent via
  640          POST. You can use POST to pass request parameters not
  641          fitting into the URL.
  642 
  643          addHttpRequestToContext - if set to true, it will instruct
  644          the requestParsers to include the original HttpServletRequest
  645          object in the context map of the SolrQueryRequest under the
  646          key "httpRequest". It will not be used by any of the existing
  647          Solr components, but may be useful when developing custom
  648          plugins.
  649 
  650          *** WARNING ***
  651          Before enabling remote streaming, you should make sure your
  652          system has authentication enabled.
  653 
  654     <requestParsers enableRemoteStreaming="false"
  655                     multipartUploadLimitInKB="-1"
  656                     formdataUploadLimitInKB="-1"
  657                     addHttpRequestToContext="false"/>
  658       -->
  659 
  660     <!-- HTTP Caching
  661 
  662          Set HTTP caching related parameters (for proxy caches and clients).
  663 
  664          The options below instruct Solr not to output any HTTP Caching
  665          related headers
  666       -->
  667     <httpCaching never304="true" />
  668     <!-- If you include a <cacheControl> directive, it will be used to
  669          generate a Cache-Control header (as well as an Expires header
  670          if the value contains "max-age=")
  671 
  672          By default, no Cache-Control header is generated.
  673 
  674          You can use the <cacheControl> option even if you have set
  675          never304="true"
  676       -->
  677     <!--
  678        <httpCaching never304="true" >
  679          <cacheControl>max-age=30, public</cacheControl>
  680        </httpCaching>
  681       -->
  682     <!-- To enable Solr to respond with automatically generated HTTP
  683          Caching headers, and to response to Cache Validation requests
  684          correctly, set the value of never304="false"
  685 
  686          This will cause Solr to generate Last-Modified and ETag
  687          headers based on the properties of the Index.
  688 
  689          The following options can also be specified to affect the
  690          values of these headers...
  691 
  692          lastModFrom - the default value is "openTime" which means the
  693          Last-Modified value (and validation against If-Modified-Since
  694          requests) will all be relative to when the current Searcher
  695          was opened.  You can change it to lastModFrom="dirLastMod" if
  696          you want the value to exactly correspond to when the physical
  697          index was last modified.
  698 
  699          etagSeed="..." is an option you can change to force the ETag
  700          header (and validation against If-None-Match requests) to be
  701          different even if the index has not changed (ie: when making
  702          significant changes to your config file)
  703 
  704          (lastModifiedFrom and etagSeed are both ignored if you use
  705          the never304="true" option)
  706       -->
  707     <!--
  708        <httpCaching lastModifiedFrom="openTime"
  709                     etagSeed="Solr">
  710          <cacheControl>max-age=30, public</cacheControl>
  711        </httpCaching>
  712       -->
  713   </requestDispatcher>
  714 
  715   <!-- Request Handlers
  716 
  717        http://wiki.apache.org/solr/SolrRequestHandler
  718 
  719        Incoming queries will be dispatched to a specific handler by name
  720        based on the path specified in the request.
  721 
  722        If a Request Handler is declared with startup="lazy", then it will
  723        not be initialized until the first request that uses it.
  724 
  725     -->
  726   <!-- SearchHandler
  727 
  728        http://wiki.apache.org/solr/SearchHandler
  729 
  730        For processing Search Queries, the primary Request Handler
  731        provided with Solr is "SearchHandler" It delegates to a sequent
  732        of SearchComponents (see below) and supports distributed
  733        queries across multiple shards
  734     -->
  735   <requestHandler name="/select" class="solr.SearchHandler">
  736     <!-- default values for query parameters can be specified, these
  737          will be overridden by parameters in the request
  738       -->
  739      <lst name="defaults">
  740        <str name="echoParams">explicit</str>
  741        <int name="rows">10</int>
  742        <!-- Default search field
  743           <str name="df">text</str>
  744          -->
  745        <!-- Change from JSON to XML format (the default prior to Solr 7.0)
  746           <str name="wt">xml</str>
  747          -->
  748        <!-- Controls the distribution of a query to shards other than itself.
  749             Consider making 'preferLocalShards' true when:
  750               1) maxShardsPerNode > 1
  751               2) Number of shards > 1
  752               3) CloudSolrClient or LbHttpSolrServer is used by clients.
  753             Without this option, every core broadcasts the distributed query to
  754             a replica of each shard where the replicas are chosen randomly.
  755             This option directs the cores to prefer cores hosted locally, thus
  756             preventing network delays between machines.
  757             This behavior also immunizes a bad/slow machine from slowing down all
  758             the good machines (if those good machines were querying this bad one).
  759 
  760             Specify this option=false for clients connecting through HttpSolrServer
  761        -->
  762        <bool name="preferLocalShards">false</bool>
  763      </lst>
  764     <!-- In addition to defaults, "appends" params can be specified
  765          to identify values which should be appended to the list of
  766          multi-val params from the query (or the existing "defaults").
  767       -->
  768     <!-- In this example, the param "fq=instock:true" would be appended to
  769          any query time fq params the user may specify, as a mechanism for
  770          partitioning the index, independent of any user selected filtering
  771          that may also be desired (perhaps as a result of faceted searching).
  772 
  773          NOTE: there is *absolutely* nothing a client can do to prevent these
  774          "appends" values from being used, so don't use this mechanism
  775          unless you are sure you always want it.
  776       -->
  777     <!--
  778        <lst name="appends">
  779          <str name="fq">inStock:true</str>
  780        </lst>
  781       -->
  782     <!-- "invariants" are a way of letting the Solr maintainer lock down
  783          the options available to Solr clients.  Any params values
  784          specified here are used regardless of what values may be specified
  785          in either the query, the "defaults", or the "appends" params.
  786 
  787          In this example, the facet.field and facet.query params would
  788          be fixed, limiting the facets clients can use.  Faceting is
  789          not turned on by default - but if the client does specify
  790          facet=true in the request, these are the only facets they
  791          will be able to see counts for; regardless of what other
  792          facet.field or facet.query params they may specify.
  793 
  794          NOTE: there is *absolutely* nothing a client can do to prevent these
  795          "invariants" values from being used, so don't use this mechanism
  796          unless you are sure you always want it.
  797       -->
  798     <!--
  799        <lst name="invariants">
  800          <str name="facet.field">cat</str>
  801          <str name="facet.field">manu_exact</str>
  802          <str name="facet.query">price:[* TO 500]</str>
  803          <str name="facet.query">price:[500 TO *]</str>
  804        </lst>
  805       -->
  806     <!-- If the default list of SearchComponents is not desired, that
  807          list can either be overridden completely, or components can be
  808          prepended or appended to the default list.  (see below)
  809       -->
  810     <!--
  811        <arr name="components">
  812          <str>nameOfCustomComponent1</str>
  813          <str>nameOfCustomComponent2</str>
  814        </arr>
  815       -->
  816     </requestHandler>
  817 
  818   <!-- A request handler that returns indented JSON by default -->
  819   <requestHandler name="/query" class="solr.SearchHandler">
  820      <lst name="defaults">
  821        <str name="echoParams">explicit</str>
  822        <str name="wt">json</str>
  823        <str name="indent">true</str>
  824        <str name="df">text</str>
  825      </lst>
  826   </requestHandler>
  827 
  828   <!-- A Robust Example
  829 
  830        This example SearchHandler declaration shows off usage of the
  831        SearchHandler with many defaults declared
  832 
  833        Note that multiple instances of the same Request Handler
  834        (SearchHandler) can be registered multiple times with different
  835        names (and different init parameters)
  836     -->
  837   <requestHandler name="/browse" class="solr.SearchHandler">
  838      <lst name="defaults">
  839        <str name="echoParams">explicit</str>
  840 
  841        <!-- VelocityResponseWriter settings -->
  842        <str name="wt">velocity</str>
  843        <str name="v.template">browse</str>
  844        <str name="v.layout">layout</str>
  845        <str name="title">Solritas</str>
  846 
  847        <!-- Query settings -->
  848        <str name="defType">edismax</str>
  849        <str name="qf">
  850           text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
  851           title^10.0 description^5.0 keywords^5.0 author^2.0 resourcename^1.0
  852        </str>
  853        <str name="mm">100%</str>
  854        <str name="q.alt">*:*</str>
  855        <str name="rows">10</str>
  856        <str name="fl">*,score</str>
  857 
  858        <str name="mlt.qf">
  859          text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
  860          title^10.0 description^5.0 keywords^5.0 author^2.0 resourcename^1.0
  861        </str>
  862        <str name="mlt.fl">text,features,name,sku,id,manu,cat,title,description,keywords,author,resourcename</str>
  863        <int name="mlt.count">3</int>
  864 
  865        <!-- Faceting defaults -->
  866        <str name="facet">on</str>
  867        <str name="facet.missing">true</str>
  868        <str name="facet.field">cat</str>
  869        <str name="facet.field">manu_exact</str>
  870        <str name="facet.field">content_type</str>
  871        <str name="facet.field">author_s</str>
  872        <str name="facet.query">ipod</str>
  873        <str name="facet.query">GB</str>
  874        <str name="facet.mincount">1</str>
  875        <str name="facet.pivot">cat,inStock</str>
  876        <str name="facet.range.other">after</str>
  877        <str name="facet.range">price</str>
  878        <int name="f.price.facet.range.start">0</int>
  879        <int name="f.price.facet.range.end">600</int>
  880        <int name="f.price.facet.range.gap">50</int>
  881        <str name="facet.range">popularity</str>
  882        <int name="f.popularity.facet.range.start">0</int>
  883        <int name="f.popularity.facet.range.end">10</int>
  884        <int name="f.popularity.facet.range.gap">3</int>
  885        <str name="facet.range">manufacturedate_dt</str>
  886        <str name="f.manufacturedate_dt.facet.range.start">NOW/YEAR-10YEARS</str>
  887        <str name="f.manufacturedate_dt.facet.range.end">NOW</str>
  888        <str name="f.manufacturedate_dt.facet.range.gap">+1YEAR</str>
  889        <str name="f.manufacturedate_dt.facet.range.other">before</str>
  890        <str name="f.manufacturedate_dt.facet.range.other">after</str>
  891 
  892        <!-- Highlighting defaults -->
  893        <str name="hl">on</str>
  894        <str name="hl.fl">content features title name</str>
  895        <str name="hl.preserveMulti">true</str>
  896        <str name="hl.encoder">html</str>
  897        <str name="hl.simple.pre">&lt;b&gt;</str>
  898        <str name="hl.simple.post">&lt;/b&gt;</str>
  899        <str name="f.title.hl.fragsize">0</str>
  900        <str name="f.title.hl.alternateField">title</str>
  901        <str name="f.name.hl.fragsize">0</str>
  902        <str name="f.name.hl.alternateField">name</str>
  903        <str name="f.content.hl.snippets">3</str>
  904        <str name="f.content.hl.fragsize">200</str>
  905        <str name="f.content.hl.alternateField">content</str>
  906        <str name="f.content.hl.maxAlternateFieldLength">750</str>
  907 
  908        <!-- Spell checking defaults -->
  909        <str name="spellcheck">on</str>
  910        <str name="spellcheck.extendedResults">false</str>
  911        <str name="spellcheck.count">5</str>
  912        <str name="spellcheck.alternativeTermCount">2</str>
  913        <str name="spellcheck.maxResultsForSuggest">5</str>
  914        <str name="spellcheck.collate">true</str>
  915        <str name="spellcheck.collateExtendedResults">true</str>
  916        <str name="spellcheck.maxCollationTries">5</str>
  917        <str name="spellcheck.maxCollations">3</str>
  918      </lst>
  919 
  920      <!-- append spellchecking to our list of components -->
  921      <arr name="last-components">
  922        <str>spellcheck</str>
  923      </arr>
  924   </requestHandler>
  925 
  926 
  927   <initParams path="/update/**,/query,/select,/tvrh,/elevate,/spell,/browse,update">
  928     <lst name="defaults">
  929       <str name="df">text</str>
  930     </lst>
  931   </initParams>
  932 
  933   <!-- The following are implicitly added
  934   <requestHandler name="/update/json" class="solr.UpdateRequestHandler">
  935         <lst name="invariants">
  936          <str name="stream.contentType">application/json</str>
  937        </lst>
  938   </requestHandler>
  939   <requestHandler name="/update/csv" class="solr.UpdateRequestHandler">
  940         <lst name="invariants">
  941          <str name="stream.contentType">application/csv</str>
  942        </lst>
  943   </requestHandler>
  944   -->
  945 
  946   <!-- Solr Cell Update Request Handler
  947 
  948        http://wiki.apache.org/solr/ExtractingRequestHandler
  949 
  950     -->
  951   <requestHandler name="/update/extract"
  952                   startup="lazy"
  953                   class="solr.extraction.ExtractingRequestHandler" >
  954     <lst name="defaults">
  955       <str name="lowernames">true</str>
  956       <str name="uprefix">ignored_</str>
  957 
  958       <!-- capture link hrefs but ignore div attributes -->
  959       <str name="captureAttr">true</str>
  960       <str name="fmap.a">links</str>
  961       <str name="fmap.div">ignored_</str>
  962     </lst>
  963   </requestHandler>
  964 
  965   <!-- Search Components
  966 
  967        Search components are registered to SolrCore and used by
  968        instances of SearchHandler (which can access them by name)
  969 
  970        By default, the following components are available:
  971 
  972        <searchComponent name="query"     class="solr.QueryComponent" />
  973        <searchComponent name="facet"     class="solr.FacetComponent" />
  974        <searchComponent name="mlt"       class="solr.MoreLikeThisComponent" />
  975        <searchComponent name="highlight" class="solr.HighlightComponent" />
  976        <searchComponent name="stats"     class="solr.StatsComponent" />
  977        <searchComponent name="debug"     class="solr.DebugComponent" />
  978 
  979        Default configuration in a requestHandler would look like:
  980 
  981        <arr name="components">
  982          <str>query</str>
  983          <str>facet</str>
  984          <str>mlt</str>
  985          <str>highlight</str>
  986          <str>stats</str>
  987          <str>debug</str>
  988        </arr>
  989 
  990        If you register a searchComponent to one of the standard names,
  991        that will be used instead of the default.
  992 
  993        To insert components before or after the 'standard' components, use:
  994 
  995        <arr name="first-components">
  996          <str>myFirstComponentName</str>
  997        </arr>
  998 
  999        <arr name="last-components">
 1000          <str>myLastComponentName</str>
 1001        </arr>
 1002 
 1003        NOTE: The component registered with the name "debug" will
 1004        always be executed after the "last-components"
 1005 
 1006      -->
 1007 
 1008    <!-- Spell Check
 1009 
 1010         The spell check component can return a list of alternative spelling
 1011         suggestions.
 1012 
 1013         http://wiki.apache.org/solr/SpellCheckComponent
 1014      -->
 1015   <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
 1016 
 1017     <str name="queryAnalyzerFieldType">text_general</str>
 1018 
 1019     <!-- Multiple "Spell Checkers" can be declared and used by this
 1020          component
 1021       -->
 1022 
 1023     <!-- a spellchecker built from a field of the main index -->
 1024     <lst name="spellchecker">
 1025       <str name="name">default</str>
 1026       <str name="field">text</str>
 1027       <str name="classname">solr.DirectSolrSpellChecker</str>
 1028       <!-- the spellcheck distance measure used, the default is the internal levenshtein -->
 1029       <str name="distanceMeasure">internal</str>
 1030       <!-- minimum accuracy needed to be considered a valid spellcheck suggestion -->
 1031       <float name="accuracy">0.5</float>
 1032       <!-- the maximum #edits we consider when enumerating terms: can be 1 or 2 -->
 1033       <int name="maxEdits">2</int>
 1034       <!-- the minimum shared prefix when enumerating terms -->
 1035       <int name="minPrefix">1</int>
 1036       <!-- maximum number of inspections per result. -->
 1037       <int name="maxInspections">5</int>
 1038       <!-- minimum length of a query term to be considered for correction -->
 1039       <int name="minQueryLength">4</int>
 1040       <!-- maximum threshold of documents a query term can appear to be considered for correction -->
 1041       <float name="maxQueryFrequency">0.01</float>
 1042       <!-- uncomment this to require suggestions to occur in 1% of the documents
 1043         <float name="thresholdTokenFrequency">.01</float>
 1044       -->
 1045     </lst>
 1046 
 1047     <!-- a spellchecker that can break or combine words.  See "/spell" handler below for usage -->
 1048     <lst name="spellchecker">
 1049       <str name="name">wordbreak</str>
 1050       <str name="classname">solr.WordBreakSolrSpellChecker</str>
 1051       <str name="field">name</str>
 1052       <str name="combineWords">true</str>
 1053       <str name="breakWords">true</str>
 1054       <int name="maxChanges">10</int>
 1055     </lst>
 1056 
 1057     <!-- a spellchecker that uses a different distance measure -->
 1058     <!--
 1059        <lst name="spellchecker">
 1060          <str name="name">jarowinkler</str>
 1061          <str name="field">spell</str>
 1062          <str name="classname">solr.DirectSolrSpellChecker</str>
 1063          <str name="distanceMeasure">
 1064            org.apache.lucene.search.spell.JaroWinklerDistance
 1065          </str>
 1066        </lst>
 1067      -->
 1068 
 1069     <!-- a spellchecker that use an alternate comparator
 1070 
 1071          comparatorClass be one of:
 1072           1. score (default)
 1073           2. freq (Frequency first, then score)
 1074           3. A fully qualified class name
 1075       -->
 1076     <!--
 1077        <lst name="spellchecker">
 1078          <str name="name">freq</str>
 1079          <str name="field">lowerfilt</str>
 1080          <str name="classname">solr.DirectSolrSpellChecker</str>
 1081          <str name="comparatorClass">freq</str>
 1082       </lst>
 1083       -->
 1084 
 1085     <!-- A spellchecker that reads the list of words from a file -->
 1086     <!--
 1087        <lst name="spellchecker">
 1088          <str name="classname">solr.FileBasedSpellChecker</str>
 1089          <str name="name">file</str>
 1090          <str name="sourceLocation">spellings.txt</str>
 1091          <str name="characterEncoding">UTF-8</str>
 1092          <str name="spellcheckIndexDir">spellcheckerFile</str>
 1093        </lst>
 1094       -->
 1095   </searchComponent>
 1096 
 1097   <!-- A request handler for demonstrating the spellcheck component.
 1098 
 1099        NOTE: This is purely as an example.  The whole purpose of the
 1100        SpellCheckComponent is to hook it into the request handler that
 1101        handles your normal user queries so that a separate request is
 1102        not needed to get suggestions.
 1103 
 1104        IN OTHER WORDS, THERE IS REALLY GOOD CHANCE THE SETUP BELOW IS
 1105        NOT WHAT YOU WANT FOR YOUR PRODUCTION SYSTEM!
 1106 
 1107        See http://wiki.apache.org/solr/SpellCheckComponent for details
 1108        on the request parameters.
 1109     -->
 1110   <requestHandler name="/spell" class="solr.SearchHandler" startup="lazy">
 1111     <lst name="defaults">
 1112       <!-- Solr will use suggestions from both the 'default' spellchecker
 1113            and from the 'wordbreak' spellchecker and combine them.
 1114            collations (re-written queries) can include a combination of
 1115            corrections from both spellcheckers -->
 1116       <str name="spellcheck.dictionary">default</str>
 1117       <str name="spellcheck.dictionary">wordbreak</str>
 1118       <str name="spellcheck">on</str>
 1119       <str name="spellcheck.extendedResults">true</str>
 1120       <str name="spellcheck.count">10</str>
 1121       <str name="spellcheck.alternativeTermCount">5</str>
 1122       <str name="spellcheck.maxResultsForSuggest">5</str>
 1123       <str name="spellcheck.collate">true</str>
 1124       <str name="spellcheck.collateExtendedResults">true</str>
 1125       <str name="spellcheck.maxCollationTries">10</str>
 1126       <str name="spellcheck.maxCollations">5</str>
 1127     </lst>
 1128     <arr name="last-components">
 1129       <str>spellcheck</str>
 1130     </arr>
 1131   </requestHandler>
 1132 
 1133   <!-- The SuggestComponent in Solr provides users with automatic suggestions for query terms.
 1134        You can use this to implement a powerful auto-suggest feature in your search application.
 1135        As with the rest of this solrconfig.xml file, the configuration of this component is purely
 1136        an example that applies specifically to this configset and example documents.
 1137 
 1138        More information about this component and other configuration options are described in the
 1139        "Suggester" section of the reference guide available at
 1140        http://archive.apache.org/dist/lucene/solr/ref-guide
 1141     -->
 1142   <searchComponent name="suggest" class="solr.SuggestComponent">
 1143     <lst name="suggester">
 1144       <str name="name">mySuggester</str>
 1145       <str name="lookupImpl">FuzzyLookupFactory</str>
 1146       <str name="dictionaryImpl">DocumentDictionaryFactory</str>
 1147       <str name="field">cat</str>
 1148       <str name="weightField">price</str>
 1149       <str name="suggestAnalyzerFieldType">string</str>
 1150       <str name="buildOnStartup">false</str>
 1151     </lst>
 1152   </searchComponent>
 1153 
 1154   <requestHandler name="/suggest" class="solr.SearchHandler"
 1155                   startup="lazy" >
 1156     <lst name="defaults">
 1157       <str name="suggest">true</str>
 1158       <str name="suggest.count">10</str>
 1159     </lst>
 1160     <arr name="components">
 1161       <str>suggest</str>
 1162     </arr>
 1163   </requestHandler>
 1164 
 1165 
 1166   <!-- Term Vector Component
 1167 
 1168        http://wiki.apache.org/solr/TermVectorComponent
 1169     -->
 1170   <searchComponent name="tvComponent" class="solr.TermVectorComponent"/>
 1171 
 1172   <!-- A request handler for demonstrating the term vector component
 1173 
 1174        This is purely as an example.
 1175 
 1176        In reality you will likely want to add the component to your
 1177        already specified request handlers.
 1178     -->
 1179   <requestHandler name="/tvrh" class="solr.SearchHandler" startup="lazy">
 1180     <lst name="defaults">
 1181       <bool name="tv">true</bool>
 1182     </lst>
 1183     <arr name="last-components">
 1184       <str>tvComponent</str>
 1185     </arr>
 1186   </requestHandler>
 1187 
 1188   <!-- Clustering Component
 1189 
 1190        You'll need to set the solr.clustering.enabled system property
 1191        when running solr to run with clustering enabled:
 1192        -Dsolr.clustering.enabled=true
 1193 
 1194        https://lucene.apache.org/solr/guide/result-clustering.html
 1195     -->
 1196   <searchComponent name="clustering"
 1197                    enable="${solr.clustering.enabled:false}"
 1198                    class="solr.clustering.ClusteringComponent" >
 1199     <!--
 1200     Declaration of "engines" (clustering algorithms).
 1201 
 1202     The open source algorithms from Carrot2.org project:
 1203       * org.carrot2.clustering.lingo.LingoClusteringAlgorithm
 1204       * org.carrot2.clustering.stc.STCClusteringAlgorithm
 1205       * org.carrot2.clustering.kmeans.BisectingKMeansClusteringAlgorithm
 1206     See http://project.carrot2.org/algorithms.html for more information.
 1207 
 1208     Commercial algorithm Lingo3G (needs to be installed separately):
 1209       * com.carrotsearch.lingo3g.Lingo3GClusteringAlgorithm
 1210     -->
 1211 
 1212     <lst name="engine">
 1213       <str name="name">lingo3g</str>
 1214       <bool name="optional">true</bool>
 1215       <str name="carrot.algorithm">com.carrotsearch.lingo3g.Lingo3GClusteringAlgorithm</str>
 1216       <str name="carrot.resourcesDir">clustering/carrot2</str>
 1217     </lst>
 1218 
 1219     <lst name="engine">
 1220       <str name="name">lingo</str>
 1221       <str name="carrot.algorithm">org.carrot2.clustering.lingo.LingoClusteringAlgorithm</str>
 1222       <str name="carrot.resourcesDir">clustering/carrot2</str>
 1223     </lst>
 1224 
 1225     <lst name="engine">
 1226       <str name="name">stc</str>
 1227       <str name="carrot.algorithm">org.carrot2.clustering.stc.STCClusteringAlgorithm</str>
 1228       <str name="carrot.resourcesDir">clustering/carrot2</str>
 1229     </lst>
 1230 
 1231     <lst name="engine">
 1232       <str name="name">kmeans</str>
 1233       <str name="carrot.algorithm">org.carrot2.clustering.kmeans.BisectingKMeansClusteringAlgorithm</str>
 1234       <str name="carrot.resourcesDir">clustering/carrot2</str>
 1235     </lst>
 1236   </searchComponent>
 1237 
 1238   <!-- A request handler for demonstrating the clustering component.
 1239        This is meant as an example.
 1240        In reality you will likely want to add the component to your
 1241        already specified request handlers.
 1242     -->
 1243   <requestHandler name="/clustering"
 1244                   startup="lazy"
 1245                   enable="${solr.clustering.enabled:false}"
 1246                   class="solr.SearchHandler">
 1247     <lst name="defaults">
 1248       <bool name="clustering">true</bool>
 1249       <bool name="clustering.results">true</bool>
 1250       <!-- Field name with the logical "title" of a each document (optional) -->
 1251       <str name="carrot.title">name</str>
 1252       <!-- Field name with the logical "URL" of a each document (optional) -->
 1253       <str name="carrot.url">id</str>
 1254       <!-- Field name with the logical "content" of a each document (optional) -->
 1255       <str name="carrot.snippet">features</str>
 1256       <!-- Apply highlighter to the title/ content and use this for clustering. -->
 1257       <bool name="carrot.produceSummary">true</bool>
 1258       <!-- the maximum number of labels per cluster -->
 1259       <!--<int name="carrot.numDescriptions">5</int>-->
 1260       <!-- produce sub clusters -->
 1261       <bool name="carrot.outputSubClusters">false</bool>
 1262 
 1263       <!-- Configure the remaining request handler parameters. -->
 1264       <str name="defType">edismax</str>
 1265       <str name="qf">
 1266         text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
 1267       </str>
 1268       <str name="q.alt">*:*</str>
 1269       <str name="rows">100</str>
 1270       <str name="fl">*,score</str>
 1271     </lst>
 1272     <arr name="last-components">
 1273       <str>clustering</str>
 1274     </arr>
 1275   </requestHandler>
 1276 
 1277   <!-- Terms Component
 1278 
 1279        http://wiki.apache.org/solr/TermsComponent
 1280 
 1281        A component to return terms and document frequency of those
 1282        terms
 1283     -->
 1284   <searchComponent name="terms" class="solr.TermsComponent"/>
 1285 
 1286   <!-- A request handler for demonstrating the terms component -->
 1287   <requestHandler name="/terms" class="solr.SearchHandler" startup="lazy">
 1288      <lst name="defaults">
 1289       <bool name="terms">true</bool>
 1290       <bool name="distrib">false</bool>
 1291     </lst>
 1292     <arr name="components">
 1293       <str>terms</str>
 1294     </arr>
 1295   </requestHandler>
 1296 
 1297 
 1298   <!-- Query Elevation Component
 1299 
 1300        http://wiki.apache.org/solr/QueryElevationComponent
 1301 
 1302        a search component that enables you to configure the top
 1303        results for a given query regardless of the normal lucene
 1304        scoring.
 1305     -->
 1306   <searchComponent name="elevator" class="solr.QueryElevationComponent" >
 1307     <!-- pick a fieldType to analyze queries -->
 1308     <str name="queryFieldType">string</str>
 1309     <str name="config-file">elevate.xml</str>
 1310   </searchComponent>
 1311 
 1312   <!-- A request handler for demonstrating the elevator component -->
 1313   <requestHandler name="/elevate" class="solr.SearchHandler" startup="lazy">
 1314     <lst name="defaults">
 1315       <str name="echoParams">explicit</str>
 1316     </lst>
 1317     <arr name="last-components">
 1318       <str>elevator</str>
 1319     </arr>
 1320   </requestHandler>
 1321 
 1322   <!-- Highlighting Component
 1323 
 1324        http://wiki.apache.org/solr/HighlightingParameters
 1325     -->
 1326   <searchComponent class="solr.HighlightComponent" name="highlight">
 1327     <highlighting>
 1328       <!-- Configure the standard fragmenter -->
 1329       <!-- This could most likely be commented out in the "default" case -->
 1330       <fragmenter name="gap"
 1331                   default="true"
 1332                   class="solr.highlight.GapFragmenter">
 1333         <lst name="defaults">
 1334           <int name="hl.fragsize">100</int>
 1335         </lst>
 1336       </fragmenter>
 1337 
 1338       <!-- A regular-expression-based fragmenter
 1339            (for sentence extraction)
 1340         -->
 1341       <fragmenter name="regex"
 1342                   class="solr.highlight.RegexFragmenter">
 1343         <lst name="defaults">
 1344           <!-- slightly smaller fragsizes work better because of slop -->
 1345           <int name="hl.fragsize">70</int>
 1346           <!-- allow 50% slop on fragment sizes -->
 1347           <float name="hl.regex.slop">0.5</float>
 1348           <!-- a basic sentence pattern -->
 1349           <str name="hl.regex.pattern">[-\w ,/\n\&quot;&apos;]{20,200}</str>
 1350         </lst>
 1351       </fragmenter>
 1352 
 1353       <!-- Configure the standard formatter -->
 1354       <formatter name="html"
 1355                  default="true"
 1356                  class="solr.highlight.HtmlFormatter">
 1357         <lst name="defaults">
 1358           <str name="hl.simple.pre"><![CDATA[<em>]]></str>
 1359           <str name="hl.simple.post"><![CDATA[</em>]]></str>
 1360         </lst>
 1361       </formatter>
 1362 
 1363       <!-- Configure the standard encoder -->
 1364       <encoder name="html"
 1365                class="solr.highlight.HtmlEncoder" />
 1366 
 1367       <!-- Configure the standard fragListBuilder -->
 1368       <fragListBuilder name="simple"
 1369                        class="solr.highlight.SimpleFragListBuilder"/>
 1370 
 1371       <!-- Configure the single fragListBuilder -->
 1372       <fragListBuilder name="single"
 1373                        class="solr.highlight.SingleFragListBuilder"/>
 1374 
 1375       <!-- Configure the weighted fragListBuilder -->
 1376       <fragListBuilder name="weighted"
 1377                        default="true"
 1378                        class="solr.highlight.WeightedFragListBuilder"/>
 1379 
 1380       <!-- default tag FragmentsBuilder -->
 1381       <fragmentsBuilder name="default"
 1382                         default="true"
 1383                         class="solr.highlight.ScoreOrderFragmentsBuilder">
 1384         <!--
 1385         <lst name="defaults">
 1386           <str name="hl.multiValuedSeparatorChar">/</str>
 1387         </lst>
 1388         -->
 1389       </fragmentsBuilder>
 1390 
 1391       <!-- multi-colored tag FragmentsBuilder -->
 1392       <fragmentsBuilder name="colored"
 1393                         class="solr.highlight.ScoreOrderFragmentsBuilder">
 1394         <lst name="defaults">
 1395           <str name="hl.tag.pre"><![CDATA[
 1396                <b style="background:yellow">,<b style="background:lawgreen">,
 1397                <b style="background:aquamarine">,<b style="background:magenta">,
 1398                <b style="background:palegreen">,<b style="background:coral">,
 1399                <b style="background:wheat">,<b style="background:khaki">,
 1400                <b style="background:lime">,<b style="background:deepskyblue">]]></str>
 1401           <str name="hl.tag.post"><![CDATA[</b>]]></str>
 1402         </lst>
 1403       </fragmentsBuilder>
 1404 
 1405       <boundaryScanner name="default"
 1406                        default="true"
 1407                        class="solr.highlight.SimpleBoundaryScanner">
 1408         <lst name="defaults">
 1409           <str name="hl.bs.maxScan">10</str>
 1410           <str name="hl.bs.chars">.,!? &#9;&#10;&#13;</str>
 1411         </lst>
 1412       </boundaryScanner>
 1413 
 1414       <boundaryScanner name="breakIterator"
 1415                        class="solr.highlight.BreakIteratorBoundaryScanner">
 1416         <lst name="defaults">
 1417           <!-- type should be one of CHARACTER, WORD(default), LINE and SENTENCE -->
 1418           <str name="hl.bs.type">WORD</str>
 1419           <!-- language and country are used when constructing Locale object.  -->
 1420           <!-- And the Locale object will be used when getting instance of BreakIterator -->
 1421           <str name="hl.bs.language">en</str>
 1422           <str name="hl.bs.country">US</str>
 1423         </lst>
 1424       </boundaryScanner>
 1425     </highlighting>
 1426   </searchComponent>
 1427 
 1428   <!-- Update Processors
 1429 
 1430        Chains of Update Processor Factories for dealing with Update
 1431        Requests can be declared, and then used by name in Update
 1432        Request Processors
 1433 
 1434        http://wiki.apache.org/solr/UpdateRequestProcessor
 1435 
 1436     -->
 1437   <!-- Deduplication
 1438 
 1439        An example dedup update processor that creates the "id" field
 1440        on the fly based on the hash code of some other fields.  This
 1441        example has overwriteDupes set to false since we are using the
 1442        id field as the signatureField and Solr will maintain
 1443        uniqueness based on that anyway.
 1444 
 1445     -->
 1446   <!--
 1447      <updateRequestProcessorChain name="dedupe">
 1448        <processor class="solr.processor.SignatureUpdateProcessorFactory">
 1449          <bool name="enabled">true</bool>
 1450          <str name="signatureField">id</str>
 1451          <bool name="overwriteDupes">false</bool>
 1452          <str name="fields">name,features,cat</str>
 1453          <str name="signatureClass">solr.processor.Lookup3Signature</str>
 1454        </processor>
 1455        <processor class="solr.LogUpdateProcessorFactory" />
 1456        <processor class="solr.RunUpdateProcessorFactory" />
 1457      </updateRequestProcessorChain>
 1458     -->
 1459 
 1460   <!-- Language identification
 1461 
 1462        This example update chain identifies the language of the incoming
 1463        documents using the langid contrib. The detected language is
 1464        written to field language_s. No field name mapping is done.
 1465        The fields used for detection are text, title, subject and description,
 1466        making this example suitable for detecting languages form full-text
 1467        rich documents injected via ExtractingRequestHandler.
 1468        See more about langId at http://wiki.apache.org/solr/LanguageDetection
 1469     -->
 1470     <!--
 1471      <updateRequestProcessorChain name="langid">
 1472        <processor class="org.apache.solr.update.processor.TikaLanguageIdentifierUpdateProcessorFactory">
 1473          <str name="langid.fl">text,title,subject,description</str>
 1474          <str name="langid.langField">language_s</str>
 1475          <str name="langid.fallback">en</str>
 1476        </processor>
 1477        <processor class="solr.LogUpdateProcessorFactory" />
 1478        <processor class="solr.RunUpdateProcessorFactory" />
 1479      </updateRequestProcessorChain>
 1480     -->
 1481 
 1482   <!-- Script update processor
 1483 
 1484     This example hooks in an update processor implemented using JavaScript.
 1485 
 1486     See more about the script update processor at http://wiki.apache.org/solr/ScriptUpdateProcessor
 1487   -->
 1488   <!--
 1489     <updateRequestProcessorChain name="script">
 1490       <processor class="solr.StatelessScriptUpdateProcessorFactory">
 1491         <str name="script">update-script.js</str>
 1492         <lst name="params">
 1493           <str name="config_param">example config parameter</str>
 1494         </lst>
 1495       </processor>
 1496       <processor class="solr.RunUpdateProcessorFactory" />
 1497     </updateRequestProcessorChain>
 1498   -->
 1499 
 1500   <!-- Response Writers
 1501 
 1502        http://wiki.apache.org/solr/QueryResponseWriter
 1503 
 1504        Request responses will be written using the writer specified by
 1505        the 'wt' request parameter matching the name of a registered
 1506        writer.
 1507 
 1508        The "default" writer is the default and will be used if 'wt' is
 1509        not specified in the request.
 1510     -->
 1511   <!-- The following response writers are implicitly configured unless
 1512        overridden...
 1513     -->
 1514   <!--
 1515      <queryResponseWriter name="xml"
 1516                           default="true"
 1517                           class="solr.XMLResponseWriter" />
 1518      <queryResponseWriter name="json" class="solr.JSONResponseWriter"/>
 1519      <queryResponseWriter name="python" class="solr.PythonResponseWriter"/>
 1520      <queryResponseWriter name="ruby" class="solr.RubyResponseWriter"/>
 1521      <queryResponseWriter name="php" class="solr.PHPResponseWriter"/>
 1522      <queryResponseWriter name="phps" class="solr.PHPSerializedResponseWriter"/>
 1523      <queryResponseWriter name="csv" class="solr.CSVResponseWriter"/>
 1524      <queryResponseWriter name="schema.xml" class="solr.SchemaXmlResponseWriter"/>
 1525     -->
 1526 
 1527   <queryResponseWriter name="json" class="solr.JSONResponseWriter">
 1528      <!-- For the purposes of the tutorial, JSON responses are written as
 1529       plain text so that they are easy to read in *any* browser.
 1530       If you expect a MIME type of "application/json" just remove this override.
 1531      -->
 1532     <str name="content-type">text/plain; charset=UTF-8</str>
 1533   </queryResponseWriter>
 1534 
 1535   <!--
 1536      Custom response writers can be declared as needed...
 1537     -->
 1538     <queryResponseWriter name="velocity" class="solr.VelocityResponseWriter" startup="lazy">
 1539       <str name="template.base.dir">${velocity.template.base.dir:}</str>
 1540     </queryResponseWriter>
 1541 
 1542 
 1543   <!-- XSLT response writer transforms the XML output by any xslt file found
 1544        in Solr's conf/xslt directory.  Changes to xslt files are checked for
 1545        every xsltCacheLifetimeSeconds.
 1546     -->
 1547   <queryResponseWriter name="xslt" class="solr.XSLTResponseWriter">
 1548     <int name="xsltCacheLifetimeSeconds">5</int>
 1549   </queryResponseWriter>
 1550 
 1551   <!-- Query Parsers
 1552 
 1553        https://lucene.apache.org/solr/guide/query-syntax-and-parsing.html
 1554 
 1555        Multiple QParserPlugins can be registered by name, and then
 1556        used in either the "defType" param for the QueryComponent (used
 1557        by SearchHandler) or in LocalParams
 1558     -->
 1559   <!-- example of registering a query parser -->
 1560   <!--
 1561      <queryParser name="myparser" class="com.mycompany.MyQParserPlugin"/>
 1562     -->
 1563 
 1564   <!-- Function Parsers
 1565 
 1566        http://wiki.apache.org/solr/FunctionQuery
 1567 
 1568        Multiple ValueSourceParsers can be registered by name, and then
 1569        used as function names when using the "func" QParser.
 1570     -->
 1571   <!-- example of registering a custom function parser  -->
 1572   <!--
 1573      <valueSourceParser name="myfunc"
 1574                         class="com.mycompany.MyValueSourceParser" />
 1575     -->
 1576 
 1577   <!--  LTR query parser
 1578 
 1579         You will need to set the solr.ltr.enabled system property
 1580         when running solr to run with ltr enabled:
 1581           -Dsolr.ltr.enabled=true
 1582 
 1583         https://lucene.apache.org/solr/guide/learning-to-rank.html
 1584 
 1585         Query parser is used to rerank top docs with a provided model
 1586     -->
 1587   <queryParser enable="${solr.ltr.enabled:false}" name="ltr" class="org.apache.solr.ltr.search.LTRQParserPlugin"/>
 1588 
 1589   <!-- Document Transformers
 1590        http://wiki.apache.org/solr/DocTransformers
 1591     -->
 1592   <!--
 1593      Could be something like:
 1594      <transformer name="db" class="com.mycompany.LoadFromDatabaseTransformer" >
 1595        <int name="connection">jdbc://....</int>
 1596      </transformer>
 1597 
 1598      To add a constant value to all docs, use:
 1599      <transformer name="mytrans2" class="org.apache.solr.response.transform.ValueAugmenterFactory" >
 1600        <int name="value">5</int>
 1601      </transformer>
 1602 
 1603      If you want the user to still be able to change it with _value:something_ use this:
 1604      <transformer name="mytrans3" class="org.apache.solr.response.transform.ValueAugmenterFactory" >
 1605        <double name="defaultValue">5</double>
 1606      </transformer>
 1607 
 1608       If you are using the QueryElevationComponent, you may wish to mark documents that get boosted.  The
 1609       EditorialMarkerFactory will do exactly that:
 1610      <transformer name="qecBooster" class="org.apache.solr.response.transform.EditorialMarkerFactory" />
 1611     -->
 1612 
 1613     <!--
 1614       LTR Transformer will encode the document features in the response. For each document the transformer
 1615       will add the features as an extra field in the response. The name of the field will be the
 1616       name of the transformer enclosed between brackets (in this case [features]).
 1617       In order to get the feature vector you will have to specify that you
 1618       want the field (e.g., fl="*,[features])
 1619 
 1620       You will need to set the solr.ltr.enabled system property
 1621       when running solr to run with ltr enabled:
 1622         -Dsolr.ltr.enabled=true
 1623 
 1624       https://lucene.apache.org/solr/guide/learning-to-rank.html
 1625       -->
 1626     <transformer enable="${solr.ltr.enabled:false}" name="features" class="org.apache.solr.ltr.response.transform.LTRFeatureLoggerTransformerFactory">
 1627       <str name="fvCacheName">QUERY_DOC_FV</str>
 1628     </transformer>
 1629 
 1630 </config>