You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

solrconfig.xml 68KB

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