1 <?xml version="1.0" encoding="UTF-8" ?>
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
10 http://www.apache.org/licenses/LICENSE-2.0
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.
20 For more details about configurations options that may appear in
21 this file, see http://wiki.apache.org/solr/SolrConfigXml.
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)
28 You may also specify a fully qualified Java classname if you
29 have your own custom plugins.
32 <!-- Set this to 'false' if you want solr to continue working after
33 it has encountered an severe configuration error. In a
34 production environment, you may want solr to keep working even
35 if one handler is mis-configured.
37 You may also set this to false using by setting the system
40 -Dsolr.abortOnConfigurationError=false
42 <abortOnConfigurationError>${solr.abortOnConfigurationError:true}</abortOnConfigurationError>
44 <!-- Controls what version of Lucene various components of Solr
45 adhere to. Generally, you want to use the latest version to
46 get all bug fixes and improvements. It is highly recommended
47 that you fully re-index after changing this setting as it can
48 affect both how text is indexed and queried.
50 <luceneMatchVersion>LUCENE_43</luceneMatchVersion>
52 <!-- lib directives can be used to instruct Solr to load an Jars
53 identified and use them to resolve any "plugins" specified in
54 your solrconfig.xml or schema.xml (ie: Analyzers, Request
57 All directories and paths are resolved relative to the
60 If a "./lib" directory exists in your instanceDir, all files
61 found in it are included as if you had used the following
66 <!-- A dir option by itself adds any files found in the directory to
67 the classpath, this is useful for including all jars in a
70 <lib dir="../../contrib/extraction/lib" />
71 <!-- When a regex is specified in addition to a directory, only the
72 files in that directory which completely match the regex
73 (anchored on both ends) will be included.
75 <lib dir="../../dist/" regex="apache-solr-cell-\d.*\.jar" />
76 <lib dir="../../dist/" regex="apache-solr-clustering-\d.*\.jar" />
77 <lib dir="../../dist/" regex="apache-solr-dataimporthandler-\d.*\.jar" />
79 <!-- If a dir option (with or without a regex) is used and nothing
80 is found that matches, it will be ignored
82 <lib dir="../../contrib/clustering/lib/" />
83 <lib dir="/total/crap/dir/ignored" />
84 <!-- an exact path can be used to specify a specific file. This
85 will cause a serious error to be logged if it can't be loaded.
88 <lib path="../a-jar-that-does-not-exist.jar" />
93 Used to specify an alternate directory to hold all index data
94 other than the default ./data under the Solr home. If
95 replication is in use, this should match the replication
98 <dataDir>${solr.data.dir:/var/lib/masterkey/lui/solr4/slave}</dataDir>
100 <!-- The DirectoryFactory to use for indexes.
102 solr.StandardDirectoryFactory, the default, is filesystem
103 based. solr.RAMDirectoryFactory is memory based, not
104 persistent, and doesn't work with replication.
106 <directoryFactory name="DirectoryFactory"
107 class="${solr.directoryFactory:solr.StandardDirectoryFactory}"/>
112 Values here affect all index writers and act as a default
115 WARNING: See also the <mainIndex> section below for parameters
116 that overfor Solr's main Lucene index.
120 <useCompoundFile>false</useCompoundFile>
122 <mergeFactor>10</mergeFactor>
123 <!-- Sets the amount of RAM that may be used by Lucene indexing
124 for buffering added documents and deletions before they are
125 flushed to the Directory. -->
126 <ramBufferSizeMB>32</ramBufferSizeMB>
127 <!-- If both ramBufferSizeMB and maxBufferedDocs is set, then
128 Lucene will flush based on whichever limit is hit first.
130 <!-- <maxBufferedDocs>1000</maxBufferedDocs> -->
132 <maxFieldLength>10000</maxFieldLength>
133 <writeLockTimeout>1000</writeLockTimeout>
134 <commitLockTimeout>10000</commitLockTimeout>
136 <!-- Expert: Merge Policy
138 The Merge Policy in Lucene controls how merging is handled by
139 Lucene. The default in Solr 3.3 is TieredMergePolicy.
141 The default in 2.3 was the LogByteSizeMergePolicy,
142 previous versions used LogDocMergePolicy.
144 LogByteSizeMergePolicy chooses segments to merge based on
145 their size. The Lucene 2.2 default, LogDocMergePolicy chose
146 when to merge based on number of documents
148 Other implementations of MergePolicy must have a no-argument
152 <mergePolicy class="org.apache.lucene.index.TieredMergePolicy"/>
155 <!-- Expert: Merge Scheduler
157 The Merge Scheduler in Lucene controls how merges are
158 performed. The ConcurrentMergeScheduler (Lucene 2.3 default)
159 can perform merges in the background using separate threads.
160 The SerialMergeScheduler (Lucene 2.2 default) does not.
163 <mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"/>
168 This option specifies which Lucene LockFactory implementation
171 single = SingleInstanceLockFactory - suggested for a
172 read-only index or when there is no possibility of
173 another process trying to modify the index.
174 native = NativeFSLockFactory - uses OS native file locking.
175 Do not use when multiple solr webapps in the same
176 JVM are attempting to share a single index.
177 simple = SimpleFSLockFactory - uses a plain file for locking
179 (For backwards compatibility with Solr 1.2, 'simple' is the
180 default if not specified.)
182 More details on the nuances of each LockFactory...
183 http://wiki.apache.org/lucene-java/AvailableLockFactories
185 <lockType>native</lockType>
187 <!-- Expert: Controls how often Lucene loads terms into memory
188 Default is 128 and is likely good for most everyone.
190 <!-- <termIndexInterval>256</termIndexInterval> -->
195 Values here override the values in the <indexDefaults> section
196 for the main on disk index.
200 <useCompoundFile>false</useCompoundFile>
201 <ramBufferSizeMB>32</ramBufferSizeMB>
202 <mergeFactor>10</mergeFactor>
204 <!-- Unlock On Startup
206 If true, unlock any held write or commit locks on startup.
207 This defeats the locking mechanism that allows multiple
208 processes to safely access a lucene index, and should be used
211 This is not needed if lock type is 'none' or 'single'
213 <unlockOnStartup>false</unlockOnStartup>
215 <!-- If true, IndexReaders will be reopened (often more efficient)
216 instead of closed and then opened.
218 <reopenReaders>true</reopenReaders>
220 <!-- Commit Deletion Policy
222 Custom deletion policies can specified here. The class must
223 implement org.apache.lucene.index.IndexDeletionPolicy.
225 http://lucene.apache.org/java/2_9_1/api/all/org/apache/lucene/index/IndexDeletionPolicy.html
227 The standard Solr IndexDeletionPolicy implementation supports
228 deleting index commit points on number of commits, age of
229 commit point and optimized status.
231 The latest commit point should always be preserved regardless
234 <deletionPolicy class="solr.SolrDeletionPolicy">
235 <!-- The number of commit points to be kept -->
236 <str name="maxCommitsToKeep">1</str>
237 <!-- The number of optimized commit points to be kept -->
238 <str name="maxOptimizedCommitsToKeep">0</str>
240 Delete all commit points once they have reached the given age.
241 Supports DateMathParser syntax e.g.
244 <str name="maxCommitAge">30MINUTES</str>
245 <str name="maxCommitAge">1DAY</str>
249 <!-- Lucene Infostream
251 To aid in advanced debugging, Lucene provides an "InfoStream"
252 of detailed information when indexing.
254 Setting The value to true will instruct the underlying Lucene
255 IndexWriter to write its debugging info the specified file
257 <infoStream file="INFOSTREAM.txt">false</infoStream>
263 This example enables JMX if and only if an existing MBeanServer
264 is found, use this if you want to configure JMX through JVM
265 parameters. Remove this to disable exposing Solr configuration
266 and statistics to JMX.
268 For more details see http://wiki.apache.org/solr/SolrJmx
271 <!-- If you want to connect to a particular server, specify the
274 <!-- <jmx agentId="myAgent" /> -->
275 <!-- If you want to start a new MBeanServer, specify the serviceUrl -->
276 <!-- <jmx serviceUrl="service:jmx:rmi:///jndi/rmi://localhost:9999/solr"/>
279 <!-- The default high-performance update handler -->
280 <updateHandler class="solr.DirectUpdateHandler2">
284 Perform a <commit/> automatically under certain conditions.
285 Instead of enabling autoCommit, consider using "commitWithin"
286 when adding documents.
288 http://wiki.apache.org/solr/UpdateXmlMessages
290 maxDocs - Maximum number of documents to add since the last
291 commit before automatically triggering a new commit.
293 maxTime - Maximum amount of time that is allowed to pass
294 since a document was added before automaticly
295 triggering a new commit.
299 <maxDocs>10000</maxDocs>
300 <maxTime>1000</maxTime>
304 <!-- Update Related Event Listeners
306 Various IndexWriter related events can trigger Listeners to
309 postCommit - fired after every commit or optimize command
310 postOptimize - fired after every optimize command
312 <!-- The RunExecutableListener executes an external command from a
313 hook such as postCommit or postOptimize.
315 exe - the name of the executable to run
316 dir - dir to use as the current working directory. (default=".")
317 wait - the calling thread waits until the executable returns.
319 args - the arguments to pass to the program. (default is none)
320 env - environment variables to set. (default is none)
322 <!-- This example shows how RunExecutableListener could be used
323 with the script based replication...
324 http://wiki.apache.org/solr/CollectionDistribution
327 <listener event="postCommit" class="solr.RunExecutableListener">
328 <str name="exe">solr/bin/snapshooter</str>
329 <str name="dir">.</str>
330 <bool name="wait">true</bool>
331 <arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
332 <arr name="env"> <str>MYVAR=val1</str> </arr>
337 <!-- IndexReaderFactory
339 Use the following format to specify a custom IndexReaderFactory,
340 which allows for alternate IndexReader implementations.
342 ** Experimental Feature **
344 Please note - Using a custom IndexReaderFactory may prevent
345 certain other features from working. The API to
346 IndexReaderFactory may change without warning or may even be
347 removed from future releases if the problems cannot be
351 ** Features that may not work with custom IndexReaderFactory **
353 The ReplicationHandler assumes a disk-resident index. Using a
354 custom IndexReader implementation may cause incompatibility
355 with ReplicationHandler and may cause replication to not work
356 correctly. See SOLR-1366 for details.
360 <indexReaderFactory name="IndexReaderFactory" class="package.class">
361 <str name="someArg">Some Value</str>
362 </indexReaderFactory >
364 <!-- By explicitly declaring the Factory, the termIndexDivisor can
368 <indexReaderFactory name="IndexReaderFactory"
369 class="solr.StandardIndexReaderFactory">
370 <int name="setTermIndexDivisor">12</int>
371 </indexReaderFactory >
376 <!-- Max Boolean Clauses
378 Maximum number of clauses in each BooleanQuery, an exception
379 is thrown if exceeded.
383 This option actually modifies a global Lucene property that
384 will affect all SolrCores. If multiple solrconfig.xml files
385 disagree on this property, the value at any given moment will
386 be based on the last SolrCore to be initialized.
389 <maxBooleanClauses>1024</maxBooleanClauses>
392 <!-- Solr Internal Query Caches
394 There are two implementations of cache available for Solr,
395 LRUCache, based on a synchronized LinkedHashMap, and
396 FastLRUCache, based on a ConcurrentHashMap.
398 FastLRUCache has faster gets and slower puts in single
399 threaded operation and thus is generally faster than LRUCache
400 when the hit ratio of the cache is high (> 75%), and may be
401 faster under other scenarios on multi-cpu systems.
406 Cache used by SolrIndexSearcher for filters (DocSets),
407 unordered sets of *all* documents that match a query. When a
408 new searcher is opened, its caches may be prepopulated or
409 "autowarmed" using data from caches in the old searcher.
410 autowarmCount is the number of items to prepopulate. For
411 LRUCache, the autowarmed items will be the most recently
415 class - the SolrCache implementation LRUCache or
416 (LRUCache or FastLRUCache)
417 size - the maximum number of entries in the cache
418 initialSize - the initial capacity (number of entries) of
419 the cache. (see java.util.HashMap)
420 autowarmCount - the number of entries to prepopulate from
423 <filterCache class="solr.FastLRUCache"
428 <!-- Query Result Cache
430 Caches results of searches - ordered lists of document ids
431 (DocList) based on a query, a sort, and the range of documents requested.
433 <queryResultCache class="solr.LRUCache"
440 Caches Lucene Document objects (the stored fields for each
441 document). Since Lucene internal document ids are transient,
442 this cache will not be autowarmed.
444 <documentCache class="solr.LRUCache"
449 <!-- Field Value Cache
451 Cache used to hold field values that are quickly accessible
452 by document id. The fieldValueCache is created by default
453 even if not configured here.
456 <fieldValueCache class="solr.FastLRUCache"
464 Example of a generic cache. These caches may be accessed by
465 name through SolrIndexSearcher.getCache(),cacheLookup(), and
466 cacheInsert(). The purpose is to enable easy caching of
467 user/application level data. The regenerator argument should
468 be specified as an implementation of solr.CacheRegenerator
469 if autowarming is desired.
472 <cache name="myUserCache"
473 class="solr.LRUCache"
477 regenerator="com.mycompany.MyRegenerator"
482 <!-- Lazy Field Loading
484 If true, stored fields that are not requested will be loaded
485 lazily. This can result in a significant speed improvement
486 if the usual case is to not load all stored fields,
487 especially if the skipped fields are large compressed text
490 <enableLazyFieldLoading>true</enableLazyFieldLoading>
492 <!-- Use Filter For Sorted Query
494 A possible optimization that attempts to use a filter to
495 satisfy a search. If the requested sort does not include
496 score, then the filterCache will be checked for a filter
497 matching the query. If found, the filter will be used as the
498 source of document ids, and then the sort will be applied to
501 For most situations, this will not be useful unless you
502 frequently get the same search repeatedly with different sort
503 options, and none of them ever use "score"
506 <useFilterForSortedQuery>true</useFilterForSortedQuery>
509 <!-- Result Window Size
511 An optimization for use with the queryResultCache. When a search
512 is requested, a superset of the requested number of document ids
513 are collected. For example, if a search for a particular query
514 requests matching documents 10 through 19, and queryWindowSize is 50,
515 then documents 0 through 49 will be collected and cached. Any further
516 requests in that range can be satisfied via the cache.
518 <queryResultWindowSize>20</queryResultWindowSize>
520 <!-- Maximum number of documents to cache for any entry in the
523 <queryResultMaxDocsCached>200</queryResultMaxDocsCached>
525 <!-- Query Related Event Listeners
527 Various IndexSearcher related events can trigger Listeners to
530 newSearcher - fired whenever a new searcher is being prepared
531 and there is a current searcher handling requests (aka
532 registered). It can be used to prime certain caches to
533 prevent long request times for certain requests.
535 firstSearcher - fired whenever a new searcher is being
536 prepared but there is no current registered searcher to handle
537 requests or to gain autowarming data from.
541 <!-- QuerySenderListener takes an array of NamedList and executes a
542 local query request for each NamedList in sequence.
544 <listener event="newSearcher" class="solr.QuerySenderListener">
547 <str name="q">database:*</str>
548 <str name="facet">true</str>
549 <str name="facet.mincount">1</str>
550 <str name="facet.field">author_exact</str>
551 <str name="facet.field">subject_exact</str>
552 <str name="facet.field">medium_exact</str>
553 <str name="facet.field">date</str>
554 <str name="facet.field">database</str>
558 <listener event="firstSearcher" class="solr.QuerySenderListener">
561 <str name="q">database:*</str>
562 <str name="facet">true</str>
563 <str name="facet.mincount">1</str>
564 <str name="facet.field">author_exact</str>
565 <str name="facet.field">subject_exact</str>
566 <str name="facet.field">medium_exact</str>
567 <str name="facet.field">date</str>
568 <str name="facet.field">database</str>
573 <!-- Use Cold Searcher
575 If a search request comes in and there is no current
576 registered searcher, then immediately register the still
577 warming searcher and use it. If "false" then all requests
578 will block until the first searcher is done warming.
580 <useColdSearcher>false</useColdSearcher>
582 <!-- Max Warming Searchers
584 Maximum number of searchers that may be warming in the
585 background concurrently. An error is returned if this limit
588 Recommend values of 1-2 for read-only slaves, higher for
589 masters w/o cache warming.
591 <maxWarmingSearchers>2</maxWarmingSearchers>
596 <!-- Request Dispatcher
598 This section contains instructions for how the SolrDispatchFilter
599 should behave when processing requests for this SolrCore.
601 handleSelect affects the behavior of requests such as /select?qt=XXX
603 handleSelect="true" will cause the SolrDispatchFilter to process
604 the request and will result in consistent error handling and
605 formatting for all types of requests.
607 handleSelect="false" will cause the SolrDispatchFilter to
608 ignore "/select" requests and fallback to using the legacy
609 SolrServlet and it's Solr 1.1 style error formatting
611 <requestDispatcher handleSelect="true" >
614 These settings indicate how Solr Requests may be parsed, and
615 what restrictions may be placed on the ContentStreams from
618 enableRemoteStreaming - enables use of the stream.file
619 and stream.url parameters for specifying remote streams.
621 multipartUploadLimitInKB - specifies the max size of
622 Multipart File Uploads that Solr will allow in a Request.
625 The settings below authorize Solr to fetch remote files, You
626 should make sure your system has some authentication before
627 using enableRemoteStreaming="true"
630 <requestParsers enableRemoteStreaming="true"
631 multipartUploadLimitInKB="2048000" />
635 Set HTTP caching related parameters (for proxy caches and clients).
637 The options below instruct Solr not to output any HTTP Caching
640 <httpCaching never304="true" />
641 <!-- If you include a <cacheControl> directive, it will be used to
642 generate a Cache-Control header (as well as an Expires header
643 if the value contains "max-age=")
645 By default, no Cache-Control header is generated.
647 You can use the <cacheControl> option even if you have set
651 <httpCaching never304="true" >
652 <cacheControl>max-age=30, public</cacheControl>
655 <!-- To enable Solr to respond with automatically generated HTTP
656 Caching headers, and to response to Cache Validation requests
657 correctly, set the value of never304="false"
659 This will cause Solr to generate Last-Modified and ETag
660 headers based on the properties of the Index.
662 The following options can also be specified to affect the
663 values of these headers...
665 lastModFrom - the default value is "openTime" which means the
666 Last-Modified value (and validation against If-Modified-Since
667 requests) will all be relative to when the current Searcher
668 was opened. You can change it to lastModFrom="dirLastMod" if
669 you want the value to exactly correspond to when the physical
670 index was last modified.
672 etagSeed="..." is an option you can change to force the ETag
673 header (and validation against If-None-Match requests) to be
674 different even if the index has not changed (ie: when making
675 significant changes to your config file)
677 (lastModifiedFrom and etagSeed are both ignored if you use
678 the never304="true" option)
681 <httpCaching lastModifiedFrom="openTime"
683 <cacheControl>max-age=30, public</cacheControl>
688 <!-- Request Handlers
690 http://wiki.apache.org/solr/SolrRequestHandler
692 incoming queries will be dispatched to the correct handler
693 based on the path or the qt (query type) param.
695 Names starting with a '/' are accessed with the a path equal to
696 the registered name. Names without a leading '/' are accessed
697 with: http://host/app/[core/]select?qt=name
699 If a /select request is processed with out a qt param
700 specified, the requestHandler that declares default="true" will
703 If a Request Handler is declared with startup="lazy", then it will
704 not be initialized until the first request that uses it.
709 http://wiki.apache.org/solr/SearchHandler
711 For processing Search Queries, the primary Request Handler
712 provided with Solr is "SearchHandler" It delegates to a sequent
713 of SearchComponents (see below) and supports distributed
714 queries across multiple shards
716 <requestHandler name="search" class="solr.SearchHandler" default="true">
717 <lst name="defaults">
718 <str name="echoParams">explicit</str>
719 <str name="spellcheck.dictionary">text</str>
720 <!-- omp = Only More Popular -->
721 <str name="spellcheck.onlyMorePopular">false</str>
722 <!-- exr = Extended Results -->
723 <str name="spellcheck.extendedResults">true</str>
724 <!-- The number of suggestions to return -->
725 <str name="spellcheck.count">5</str>
726 <str name="spellcheck">true</str>
728 <arr name="last-components">
729 <str>spellcheck</str>
733 <!-- A Robust Example
735 This example SearchHandler declaration shows off usage of the
736 SearchHandler with many defaults declared
738 Note that multiple instances of the same Request Handler
739 (SearchHandler) can be registered multiple times with different
740 names (and different init parameters)
742 <requestHandler name="/browse" class="solr.SearchHandler">
743 <lst name="defaults">
744 <str name="echoParams">explicit</str>
746 <!-- VelocityResponseWriter settings -->
747 <str name="wt">velocity</str>
749 <str name="v.template">browse</str>
750 <str name="v.layout">layout</str>
751 <str name="title">Solritas</str>
753 <str name="defType">edismax</str>
754 <str name="q.alt">*:*</str>
755 <str name="rows">10</str>
756 <str name="fl">*,score</str>
758 text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
760 <str name="mlt.fl">text,features,name,sku,id,manu,cat</str>
761 <int name="mlt.count">3</int>
764 text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
767 <str name="facet">on</str>
768 <str name="facet.field">cat</str>
769 <str name="facet.field">manu_exact</str>
770 <str name="facet.query">ipod</str>
771 <str name="facet.query">GB</str>
772 <str name="facet.mincount">1</str>
773 <str name="facet.pivot">cat,inStock</str>
774 <str name="facet.range">price</str>
775 <int name="f.price.facet.range.start">0</int>
776 <int name="f.price.facet.range.end">600</int>
777 <int name="f.price.facet.range.gap">50</int>
778 <str name="f.price.facet.range.other">after</str>
779 <str name="facet.range">manufacturedate_dt</str>
780 <str name="f.manufacturedate_dt.facet.range.start">NOW/YEAR-10YEARS</str>
781 <str name="f.manufacturedate_dt.facet.range.end">NOW</str>
782 <str name="f.manufacturedate_dt.facet.range.gap">+1YEAR</str>
783 <str name="f.manufacturedate_dt.facet.range.other">before</str>
784 <str name="f.manufacturedate_dt.facet.range.other">after</str>
787 <!-- Highlighting defaults -->
788 <str name="hl">on</str>
789 <str name="hl.fl">text features name</str>
790 <str name="f.name.hl.fragsize">0</str>
791 <str name="f.name.hl.alternateField">name</str>
793 <arr name="last-components">
794 <str>spellcheck</str>
797 <str name="url-scheme">httpx</str>
801 <!-- XML Update Request Handler.
803 http://wiki.apache.org/solr/UpdateXmlMessages
805 The canonical Request Handler for Modifying the Index through
806 commands specified using XML.
808 Note: Since solr1.1 requestHandlers requires a valid content
809 type header if posted in the body. For example, curl now
810 requires: -H 'Content-type:text/xml; charset=utf-8'
812 <requestHandler name="/update"
813 class="solr.XmlUpdateRequestHandler">
814 <!-- See below for information on defining
815 updateRequestProcessorChains that can be used by name
816 on each Update Request
819 <lst name="defaults">
820 <str name="update.chain">dedupe</str>
824 <!-- Binary Update Request Handler
825 http://wiki.apache.org/solr/javabin
827 <requestHandler name="/update/javabin"
828 class="solr.BinaryUpdateRequestHandler" />
830 <!-- CSV Update Request Handler
831 http://wiki.apache.org/solr/UpdateCSV
833 <requestHandler name="/update/csv"
834 class="solr.CSVRequestHandler"
837 <!-- JSON Update Request Handler
838 http://wiki.apache.org/solr/UpdateJSON
840 <requestHandler name="/update/json"
841 class="solr.JsonUpdateRequestHandler"
844 <!-- Solr Cell Update Request Handler
846 http://wiki.apache.org/solr/ExtractingRequestHandler
849 <requestHandler name="/update/extract"
851 class="solr.extraction.ExtractingRequestHandler" >
852 <lst name="defaults">
853 <!-- All the main content goes into "text"... if you need to return
854 the extracted text or do highlighting, use a stored field. -->
855 <str name="fmap.content">text</str>
856 <str name="lowernames">true</str>
857 <str name="uprefix">ignored_</str>
859 <!-- capture link hrefs but ignore div attributes -->
860 <str name="captureAttr">true</str>
861 <str name="fmap.a">links</str>
862 <str name="fmap.div">ignored_</str>
866 <!-- Field Analysis Request Handler
868 RequestHandler that provides much the same functionality as
869 analysis.jsp. Provides the ability to specify multiple field
870 types and field names in the same request and outputs
871 index-time and query-time analysis for each of them.
873 Request parameters are:
874 analysis.fieldname - field name whose analyzers are to be used
876 analysis.fieldtype - field type whose analyzers are to be used
877 analysis.fieldvalue - text for index-time analysis
878 q (or analysis.q) - text for query time analysis
879 analysis.showmatch (true|false) - When set to true and when
880 query analysis is performed, the produced tokens of the
881 field value analysis will be marked as "matched" for every
882 token that is produces by the query analysis
884 <requestHandler name="/analysis/field"
886 class="solr.FieldAnalysisRequestHandler" />
889 <!-- Document Analysis Handler
891 http://wiki.apache.org/solr/AnalysisRequestHandler
893 An analysis handler that provides a breakdown of the analysis
894 process of provided docuemnts. This handler expects a (single)
895 content stream with the following format:
899 <field name="id">1</field>
900 <field name="name">The Name</field>
901 <field name="text">The Text Value</field>
908 Note: Each document must contain a field which serves as the
909 unique key. This key is used in the returned response to associate
910 an analysis breakdown to the analyzed document.
912 Like the FieldAnalysisRequestHandler, this handler also supports
913 query analysis by sending either an "analysis.query" or "q"
914 request parameter that holds the query text to be analyzed. It
915 also supports the "analysis.showmatch" parameter which when set to
916 true, all field tokens that match the query tokens will be marked
919 <requestHandler name="/analysis/document"
920 class="solr.DocumentAnalysisRequestHandler"
925 Admin Handlers - This will register all the standard admin
928 <requestHandler name="/admin/"
929 class="solr.admin.AdminHandlers" />
930 <!-- This single handler is equivalent to the following... -->
932 <requestHandler name="/admin/luke" class="solr.admin.LukeRequestHandler" />
933 <requestHandler name="/admin/system" class="solr.admin.SystemInfoHandler" />
934 <requestHandler name="/admin/plugins" class="solr.admin.PluginInfoHandler" />
935 <requestHandler name="/admin/threads" class="solr.admin.ThreadDumpHandler" />
936 <requestHandler name="/admin/properties" class="solr.admin.PropertiesRequestHandler" />
937 <requestHandler name="/admin/file" class="solr.admin.ShowFileRequestHandler" >
939 <!-- If you wish to hide files under ${solr.home}/conf, explicitly
940 register the ShowFileRequestHandler using:
943 <requestHandler name="/admin/file"
944 class="solr.admin.ShowFileRequestHandler" >
945 <lst name="invariants">
946 <str name="hidden">synonyms.txt</str>
947 <str name="hidden">anotherfile.txt</str>
952 <!-- ping/healthcheck -->
953 <requestHandler name="/admin/ping" class="solr.PingRequestHandler">
954 <lst name="defaults">
955 <str name="qt">search</str>
956 <str name="q">solrpingquery</str>
957 <str name="echoParams">all</str>
961 <!-- Echo the request contents back to the client -->
962 <requestHandler name="/debug/dump" class="solr.DumpRequestHandler" >
963 <lst name="defaults">
964 <str name="echoParams">explicit</str>
965 <str name="echoHandler">true</str>
969 <!-- Solr Replication
971 The SolrReplicationHandler supports replicating indexes from a
972 "master" used for indexing and "salves" used for queries.
974 http://wiki.apache.org/solr/SolrReplication
976 In the example below, remove the <lst name="master"> section if
977 this is just a slave and remove the <lst name="slave"> section
978 if this is just a master.
981 <requestHandler name="/replication" class="solr.ReplicationHandler" >
984 <str name="replicateAfter">commit</str>
985 <str name="replicateAfter">startup</str>
986 <str name="confFiles">schema.xml,stopwords.txt</str>
990 <str name="masterUrl">http://localhost:8983/solr/replication</str>
991 <str name="pollInterval">00:00:60</str>
996 <!-- Search Components
998 Search components are registered to SolrCore and used by
999 instances of SearchHandler (which can access them by name)
1001 By default, the following components are available:
1003 <searchComponent name="query" class="solr.QueryComponent" />
1004 <searchComponent name="facet" class="solr.FacetComponent" />
1005 <searchComponent name="mlt" class="solr.MoreLikeThisComponent" />
1006 <searchComponent name="highlight" class="solr.HighlightComponent" />
1007 <searchComponent name="stats" class="solr.StatsComponent" />
1008 <searchComponent name="debug" class="solr.DebugComponent" />
1010 Default configuration in a requestHandler would look like:
1012 <arr name="components">
1016 <str>highlight</str>
1021 If you register a searchComponent to one of the standard names,
1022 that will be used instead of the default.
1024 To insert components before or after the 'standard' components, use:
1026 <arr name="first-components">
1027 <str>myFirstComponentName</str>
1030 <arr name="last-components">
1031 <str>myLastComponentName</str>
1034 NOTE: The component registered with the name "debug" will
1035 always be executed after the "last-components"
1041 The spell check component can return a list of alternative spelling
1044 http://wiki.apache.org/solr/SpellCheckComponent
1046 <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
1048 <str name="queryAnalyzerFieldType">text</str>
1050 <lst name="spellchecker">
1051 <str name="classname">solr.IndexBasedSpellChecker</str>
1052 <str name="name">text</str>
1053 <str name="field">text</str>
1054 <str name="buildOnOptimize">true</str>
1055 <str name="spellcheckIndexDir">./spellchecker</str>
1056 <!-- uncomment this to require terms to occur in 1% of the documents in order to be included in the dictionary
1057 <float name="thresholdTokenFrequency">.01</float>
1062 <!-- a spellchecker that uses a different distance measure -->
1064 <lst name="spellchecker">
1065 <str name="name">jarowinkler</str>
1066 <str name="field">spell</str>
1067 <str name="distanceMeasure">
1068 org.apache.lucene.search.spell.JaroWinklerDistance
1070 <str name="spellcheckIndexDir">spellcheckerJaro</str>
1074 <!-- a spellchecker that use an alternate comparator
1076 comparatorClass be one of:
1078 2. freq (Frequency first, then score)
1079 3. A fully qualified class name
1082 <lst name="spellchecker">
1083 <str name="name">freq</str>
1084 <str name="field">lowerfilt</str>
1085 <str name="spellcheckIndexDir">spellcheckerFreq</str>
1086 <str name="comparatorClass">freq</str>
1087 <str name="buildOnCommit">true</str>
1090 <!-- A spellchecker that reads the list of words from a file -->
1092 <lst name="spellchecker">
1093 <str name="classname">solr.FileBasedSpellChecker</str>
1094 <str name="name">file</str>
1095 <str name="sourceLocation">spellings.txt</str>
1096 <str name="characterEncoding">UTF-8</str>
1097 <str name="spellcheckIndexDir">spellcheckerFile</str>
1102 <!-- A request handler for demonstrating the spellcheck component.
1104 NOTE: This is purely as an example. The whole purpose of the
1105 SpellCheckComponent is to hook it into the request handler that
1106 handles your normal user queries so that a separate request is
1107 not needed to get suggestions.
1109 IN OTHER WORDS, THERE IS REALLY GOOD CHANCE THE SETUP BELOW IS
1110 NOT WHAT YOU WANT FOR YOUR PRODUCTION SYSTEM!
1112 See http://wiki.apache.org/solr/SpellCheckComponent for details
1113 on the request parameters.
1115 <requestHandler name="/spell" class="solr.SearchHandler" startup="lazy">
1116 <lst name="defaults">
1117 <str name="spellcheck.onlyMorePopular">false</str>
1118 <str name="spellcheck.extendedResults">false</str>
1119 <str name="spellcheck.count">1</str>
1121 <arr name="last-components">
1122 <str>spellcheck</str>
1126 <!-- Term Vector Component
1128 http://wiki.apache.org/solr/TermVectorComponent
1130 <searchComponent name="tvComponent" class="solr.TermVectorComponent"/>
1132 <!-- A request handler for demonstrating the term vector component
1134 This is purely as an example.
1136 In reality you will likely want to add the component to your
1137 already specified request handlers.
1139 <requestHandler name="tvrh" class="solr.SearchHandler" startup="lazy">
1140 <lst name="defaults">
1141 <bool name="tv">true</bool>
1143 <arr name="last-components">
1144 <str>tvComponent</str>
1148 <!-- Clustering Component
1150 http://wiki.apache.org/solr/ClusteringComponent
1152 This relies on third party jars which are notincluded in the
1153 release. To use this component (and the "/clustering" handler)
1154 Those jars will need to be downloaded, and you'll need to set
1155 the solr.cluster.enabled system property when running solr...
1157 java -Dsolr.clustering.enabled=true -jar start.jar
1159 <searchComponent name="clustering"
1160 enable="${solr.clustering.enabled:false}"
1161 class="solr.clustering.ClusteringComponent" >
1162 <!-- Declare an engine -->
1164 <!-- The name, only one can be named "default" -->
1165 <str name="name">default</str>
1167 <!-- Class name of Carrot2 clustering algorithm.
1169 Currently available algorithms are:
1171 * org.carrot2.clustering.lingo.LingoClusteringAlgorithm
1172 * org.carrot2.clustering.stc.STCClusteringAlgorithm
1173 * org.carrot2.clustering.kmeans.BisectingKMeansClusteringAlgorithm
1175 See http://project.carrot2.org/algorithms.html for the
1176 algorithm's characteristics.
1178 <str name="carrot.algorithm">org.carrot2.clustering.lingo.LingoClusteringAlgorithm</str>
1180 <!-- Overriding values for Carrot2 default algorithm attributes.
1182 For a description of all available attributes, see:
1183 http://download.carrot2.org/stable/manual/#chapter.components.
1184 Use attribute key as name attribute of str elements
1185 below. These can be further overridden for individual
1186 requests by specifying attribute key as request parameter
1187 name and attribute value as parameter value.
1189 <str name="LingoClusteringAlgorithm.desiredClusterCountBase">20</str>
1191 <!-- Location of Carrot2 lexical resources.
1193 A directory from which to load Carrot2-specific stop words
1194 and stop labels. Absolute or relative to Solr config directory.
1195 If a specific resource (e.g. stopwords.en) is present in the
1196 specified dir, it will completely override the corresponding
1197 default one that ships with Carrot2.
1199 For an overview of Carrot2 lexical resources, see:
1200 http://download.carrot2.org/head/manual/#chapter.lexical-resources
1202 <str name="carrot.lexicalResourcesDir">clustering/carrot2</str>
1204 <!-- The language to assume for the documents.
1206 For a list of allowed values, see:
1207 http://download.carrot2.org/stable/manual/#section.attribute.lingo.MultilingualClustering.defaultLanguage
1209 <str name="MultilingualClustering.defaultLanguage">ENGLISH</str>
1212 <str name="name">stc</str>
1213 <str name="carrot.algorithm">org.carrot2.clustering.stc.STCClusteringAlgorithm</str>
1217 <!-- A request handler for demonstrating the clustering component
1219 This is purely as an example.
1221 In reality you will likely want to add the component to your
1222 already specified request handlers.
1224 <requestHandler name="/clustering"
1226 enable="${solr.clustering.enabled:false}"
1227 class="solr.SearchHandler">
1228 <lst name="defaults">
1229 <bool name="clustering">true</bool>
1230 <str name="clustering.engine">default</str>
1231 <bool name="clustering.results">true</bool>
1232 <!-- The title field -->
1233 <str name="carrot.title">name</str>
1234 <str name="carrot.url">id</str>
1235 <!-- The field to cluster on -->
1236 <str name="carrot.snippet">features</str>
1237 <!-- produce summaries -->
1238 <bool name="carrot.produceSummary">true</bool>
1239 <!-- the maximum number of labels per cluster -->
1240 <!--<int name="carrot.numDescriptions">5</int>-->
1241 <!-- produce sub clusters -->
1242 <bool name="carrot.outputSubClusters">false</bool>
1244 <str name="defType">edismax</str>
1246 text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
1248 <str name="q.alt">*:*</str>
1249 <str name="rows">10</str>
1250 <str name="fl">*,score</str>
1252 <arr name="last-components">
1253 <str>clustering</str>
1257 <!-- Terms Component
1259 http://wiki.apache.org/solr/TermsComponent
1261 A component to return terms and document frequency of those
1264 <searchComponent name="terms" class="solr.TermsComponent"/>
1266 <!-- A request handler for demonstrating the terms component -->
1267 <requestHandler name="/terms" class="solr.SearchHandler" startup="lazy">
1268 <lst name="defaults">
1269 <bool name="terms">true</bool>
1271 <arr name="components">
1277 <!-- Query Elevation Component
1279 http://wiki.apache.org/solr/QueryElevationComponent
1281 a search component that enables you to configure the top
1282 results for a given query regardless of the normal lucene
1285 <searchComponent name="elevator" class="solr.QueryElevationComponent" >
1286 <!-- pick a fieldType to analyze queries -->
1287 <str name="queryFieldType">string</str>
1288 <str name="config-file">elevate.xml</str>
1291 <!-- A request handler for demonstrating the elevator component -->
1292 <requestHandler name="/elevate" class="solr.SearchHandler" startup="lazy">
1293 <lst name="defaults">
1294 <str name="echoParams">explicit</str>
1296 <arr name="last-components">
1301 <!-- Highlighting Component
1303 http://wiki.apache.org/solr/HighlightingParameters
1305 <searchComponent class="solr.HighlightComponent" name="highlight">
1307 <!-- Configure the standard fragmenter -->
1308 <!-- This could most likely be commented out in the "default" case -->
1309 <fragmenter name="gap"
1311 class="solr.highlight.GapFragmenter">
1312 <lst name="defaults">
1313 <int name="hl.fragsize">100</int>
1317 <!-- A regular-expression-based fragmenter
1318 (for sentence extraction)
1320 <fragmenter name="regex"
1321 class="solr.highlight.RegexFragmenter">
1322 <lst name="defaults">
1323 <!-- slightly smaller fragsizes work better because of slop -->
1324 <int name="hl.fragsize">70</int>
1325 <!-- allow 50% slop on fragment sizes -->
1326 <float name="hl.regex.slop">0.5</float>
1327 <!-- a basic sentence pattern -->
1328 <str name="hl.regex.pattern">[-\w ,/\n\"']{20,200}</str>
1332 <!-- Configure the standard formatter -->
1333 <formatter name="html"
1335 class="solr.highlight.HtmlFormatter">
1336 <lst name="defaults">
1337 <str name="hl.simple.pre"><![CDATA[<em>]]></str>
1338 <str name="hl.simple.post"><![CDATA[</em>]]></str>
1342 <!-- Configure the standard encoder -->
1343 <encoder name="html"
1344 class="solr.highlight.HtmlEncoder" />
1346 <!-- Configure the standard fragListBuilder -->
1347 <fragListBuilder name="simple"
1349 class="solr.highlight.SimpleFragListBuilder"/>
1351 <!-- Configure the single fragListBuilder -->
1352 <fragListBuilder name="single"
1353 class="solr.highlight.SingleFragListBuilder"/>
1355 <!-- default tag FragmentsBuilder -->
1356 <fragmentsBuilder name="default"
1358 class="solr.highlight.ScoreOrderFragmentsBuilder">
1360 <lst name="defaults">
1361 <str name="hl.multiValuedSeparatorChar">/</str>
1366 <!-- multi-colored tag FragmentsBuilder -->
1367 <fragmentsBuilder name="colored"
1368 class="solr.highlight.ScoreOrderFragmentsBuilder">
1369 <lst name="defaults">
1370 <str name="hl.tag.pre"><![CDATA[
1371 <b style="background:yellow">,<b style="background:lawgreen">,
1372 <b style="background:aquamarine">,<b style="background:magenta">,
1373 <b style="background:palegreen">,<b style="background:coral">,
1374 <b style="background:wheat">,<b style="background:khaki">,
1375 <b style="background:lime">,<b style="background:deepskyblue">]]></str>
1376 <str name="hl.tag.post"><![CDATA[</b>]]></str>
1382 <!-- Update Processors
1384 Chains of Update Processor Factories for dealing with Update
1385 Requests can be declared, and then used by name in Update
1388 http://wiki.apache.org/solr/UpdateRequestProcessor
1393 An example dedup update processor that creates the "id" field
1394 on the fly based on the hash code of some other fields. This
1395 example has overwriteDupes set to false since we are using the
1396 id field as the signatureField and Solr will maintain
1397 uniqueness based on that anyway.
1401 <updateRequestProcessorChain name="dedupe">
1402 <processor class="solr.processor.SignatureUpdateProcessorFactory">
1403 <bool name="enabled">true</bool>
1404 <str name="signatureField">id</str>
1405 <bool name="overwriteDupes">false</bool>
1406 <str name="fields">name,features,cat</str>
1407 <str name="signatureClass">solr.processor.Lookup3Signature</str>
1409 <processor class="solr.LogUpdateProcessorFactory" />
1410 <processor class="solr.RunUpdateProcessorFactory" />
1411 </updateRequestProcessorChain>
1414 <!-- Response Writers
1416 http://wiki.apache.org/solr/QueryResponseWriter
1418 Request responses will be written using the writer specified by
1419 the 'wt' request parameter matching the name of a registered
1422 The "default" writer is the default and will be used if 'wt' is
1423 not specified in the request.
1425 <!-- The following response writers are implicitly configured unless
1429 <queryResponseWriter name="xml"
1431 class="solr.XMLResponseWriter" />
1432 <queryResponseWriter name="json" class="solr.JSONResponseWriter"/>
1433 <queryResponseWriter name="python" class="solr.PythonResponseWriter"/>
1434 <queryResponseWriter name="ruby" class="solr.RubyResponseWriter"/>
1435 <queryResponseWriter name="php" class="solr.PHPResponseWriter"/>
1436 <queryResponseWriter name="phps" class="solr.PHPSerializedResponseWriter"/>
1437 <queryResponseWriter name="velocity" class="solr.VelocityResponseWriter"/>
1438 <queryResponseWriter name="csv" class="solr.CSVResponseWriter"/>
1441 Custom response writers can be declared as needed...
1444 <queryResponseWriter name="custom" class="com.example.MyResponseWriter"/>
1447 <!-- XSLT response writer transforms the XML output by any xslt file found
1448 in Solr's conf/xslt directory. Changes to xslt files are checked for
1449 every xsltCacheLifetimeSeconds.
1451 <queryResponseWriter name="xslt" class="solr.XSLTResponseWriter">
1452 <int name="xsltCacheLifetimeSeconds">5</int>
1453 </queryResponseWriter>
1457 http://wiki.apache.org/solr/SolrQuerySyntax
1459 Multiple QParserPlugins can be registered by name, and then
1460 used in either the "defType" param for the QueryComponent (used
1461 by SearchHandler) or in LocalParams
1463 <!-- example of registering a query parser -->
1465 <queryParser name="myparser" class="com.mycompany.MyQParserPlugin"/>
1468 <!-- Function Parsers
1470 http://wiki.apache.org/solr/FunctionQuery
1472 Multiple ValueSourceParsers can be registered by name, and then
1473 used as function names when using the "func" QParser.
1475 <!-- example of registering a custom function parser -->
1477 <valueSourceParser name="myfunc"
1478 class="com.mycompany.MyValueSourceParser" />
1481 <!-- Legacy config for the admin interface -->
1483 <defaultQuery>*:*</defaultQuery>
1485 <!-- configure a healthcheck file for servers behind a
1489 <healthcheck type="file">server-enabled</healthcheck>