solrconfig.xml 70 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773
  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>5.5.2</luceneMatchVersion>
  34. <!-- <lib/> directives can be used to instruct Solr to load any 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. If a 'dir' option (with or without a regex) is used and nothing
  57. is found that matches, a warning will be logged.
  58. The examples below can be used to load some solr-contribs along
  59. with their external dependencies.
  60. -->
  61. <lib dir="${solr.install.dir:../../../..}/contrib/extraction/lib" regex=".*\.jar" />
  62. <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-cell-\d.*\.jar" />
  63. <lib dir="${solr.install.dir:../../../..}/contrib/clustering/lib/" regex=".*\.jar" />
  64. <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-clustering-\d.*\.jar" />
  65. <lib dir="${solr.install.dir:../../../..}/contrib/langid/lib/" regex=".*\.jar" />
  66. <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-langid-\d.*\.jar" />
  67. <lib dir="${solr.install.dir:../../../..}/contrib/velocity/lib" regex=".*\.jar" />
  68. <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-velocity-\d.*\.jar" />
  69. <!-- an exact 'path' can be used instead of a 'dir' to specify a
  70. specific jar file. This will cause a serious error to be logged
  71. if it can't be loaded.
  72. -->
  73. <!--
  74. <lib path="../a-jar-that-does-not-exist.jar" />
  75. -->
  76. <!-- Data Directory
  77. Used to specify an alternate directory to hold all index data
  78. other than the default ./data under the Solr home. If
  79. replication is in use, this should match the replication
  80. configuration.
  81. -->
  82. <dataDir>${solr.data.dir:}</dataDir>
  83. <!-- The DirectoryFactory to use for indexes.
  84. solr.StandardDirectoryFactory is filesystem
  85. based and tries to pick the best implementation for the current
  86. JVM and platform. solr.NRTCachingDirectoryFactory, the default,
  87. wraps solr.StandardDirectoryFactory and caches small files in memory
  88. for better NRT performance.
  89. One can force a particular implementation via solr.MMapDirectoryFactory,
  90. solr.NIOFSDirectoryFactory, or solr.SimpleFSDirectoryFactory.
  91. solr.RAMDirectoryFactory is memory based, not
  92. persistent, and doesn't work with replication.
  93. -->
  94. <directoryFactory name="DirectoryFactory"
  95. class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}"/>
  96. <!-- The CodecFactory for defining the format of the inverted index.
  97. The default implementation is SchemaCodecFactory, which is the official Lucene
  98. index format, but hooks into the schema to provide per-field customization of
  99. the postings lists and per-document values in the fieldType element
  100. (postingsFormat/docValuesFormat). Note that most of the alternative implementations
  101. are experimental, so if you choose to customize the index format, it's a good
  102. idea to convert back to the official format e.g. via IndexWriter.addIndexes(IndexReader)
  103. before upgrading to a newer version to avoid unnecessary reindexing.
  104. A "compressionMode" string element can be added to <codecFactory> to choose
  105. between the existing compression modes in the default codec: "BEST_SPEED" (default)
  106. or "BEST_COMPRESSION".
  107. -->
  108. <codecFactory class="solr.SchemaCodecFactory"/>
  109. <!-- To disable dynamic schema REST APIs, use the following for <schemaFactory>:
  110. <schemaFactory class="ClassicIndexSchemaFactory"/>
  111. When ManagedIndexSchemaFactory is specified instead, Solr will load the schema from
  112. the resource named in 'managedSchemaResourceName', rather than from schema.xml.
  113. Note that the managed schema resource CANNOT be named schema.xml. If the managed
  114. schema does not exist, Solr will create it after reading schema.xml, then rename
  115. 'schema.xml' to 'schema.xml.bak'.
  116. Do NOT hand edit the managed schema - external modifications will be ignored and
  117. overwritten as a result of schema modification REST API calls.
  118. When ManagedIndexSchemaFactory is specified with mutable = true, schema
  119. modification REST API calls will be allowed; otherwise, error responses will be
  120. sent back for these requests.
  121. -->
  122. <schemaFactory class="ManagedIndexSchemaFactory">
  123. <bool name="mutable">true</bool>
  124. <str name="managedSchemaResourceName">managed-schema</str>
  125. </schemaFactory>
  126. <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  127. Index Config - These settings control low-level behavior of indexing
  128. Most example settings here show the default value, but are commented
  129. out, to more easily see where customizations have been made.
  130. Note: This replaces <indexDefaults> and <mainIndex> from older versions
  131. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  132. <indexConfig>
  133. <!-- maxFieldLength was removed in 4.0. To get similar behavior, include a
  134. LimitTokenCountFilterFactory in your fieldType definition. E.g.
  135. <filter class="solr.LimitTokenCountFilterFactory" maxTokenCount="10000"/>
  136. -->
  137. <!-- Maximum time to wait for a write lock (ms) for an IndexWriter. Default: 1000 -->
  138. <!-- <writeLockTimeout>1000</writeLockTimeout> -->
  139. <!-- Expert: Enabling compound file will use less files for the index,
  140. using fewer file descriptors on the expense of performance decrease.
  141. Default in Lucene is "true". Default in Solr is "false" (since 3.6) -->
  142. <!-- <useCompoundFile>false</useCompoundFile> -->
  143. <!-- ramBufferSizeMB sets the amount of RAM that may be used by Lucene
  144. indexing for buffering added documents and deletions before they are
  145. flushed to the Directory.
  146. maxBufferedDocs sets a limit on the number of documents buffered
  147. before flushing.
  148. If both ramBufferSizeMB and maxBufferedDocs is set, then
  149. Lucene will flush based on whichever limit is hit first.
  150. The default is 100 MB. -->
  151. <!-- <ramBufferSizeMB>100</ramBufferSizeMB> -->
  152. <!-- <maxBufferedDocs>1000</maxBufferedDocs> -->
  153. <!-- Expert: Merge Policy
  154. The Merge Policy in Lucene controls how merging of segments is done.
  155. The default since Solr/Lucene 3.3 is TieredMergePolicy.
  156. The default since Lucene 2.3 was the LogByteSizeMergePolicy,
  157. Even older versions of Lucene used LogDocMergePolicy.
  158. -->
  159. <!--
  160. <mergePolicyFactory class="org.apache.solr.index.TieredMergePolicyFactory">
  161. <int name="maxMergeAtOnce">10</int>
  162. <int name="segmentsPerTier">10</int>
  163. <double name="noCFSRatio">0.1</double>
  164. </mergePolicyFactory>
  165. -->
  166. <!-- Expert: Merge Scheduler
  167. The Merge Scheduler in Lucene controls how merges are
  168. performed. The ConcurrentMergeScheduler (Lucene 2.3 default)
  169. can perform merges in the background using separate threads.
  170. The SerialMergeScheduler (Lucene 2.2 default) does not.
  171. -->
  172. <!--
  173. <mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"/>
  174. -->
  175. <!-- LockFactory
  176. This option specifies which Lucene LockFactory implementation
  177. to use.
  178. single = SingleInstanceLockFactory - suggested for a
  179. read-only index or when there is no possibility of
  180. another process trying to modify the index.
  181. native = NativeFSLockFactory - uses OS native file locking.
  182. Do not use when multiple solr webapps in the same
  183. JVM are attempting to share a single index.
  184. simple = SimpleFSLockFactory - uses a plain file for locking
  185. Defaults: 'native' is default for Solr3.6 and later, otherwise
  186. 'simple' is the default
  187. More details on the nuances of each LockFactory...
  188. http://wiki.apache.org/lucene-java/AvailableLockFactories
  189. -->
  190. <lockType>${solr.lock.type:native}</lockType>
  191. <!-- Commit Deletion Policy
  192. Custom deletion policies can be specified here. The class must
  193. implement org.apache.lucene.index.IndexDeletionPolicy.
  194. The default Solr IndexDeletionPolicy implementation supports
  195. deleting index commit points on number of commits, age of
  196. commit point and optimized status.
  197. The latest commit point should always be preserved regardless
  198. of the criteria.
  199. -->
  200. <!--
  201. <deletionPolicy class="solr.SolrDeletionPolicy">
  202. -->
  203. <!-- The number of commit points to be kept -->
  204. <!-- <str name="maxCommitsToKeep">1</str> -->
  205. <!-- The number of optimized commit points to be kept -->
  206. <!-- <str name="maxOptimizedCommitsToKeep">0</str> -->
  207. <!--
  208. Delete all commit points once they have reached the given age.
  209. Supports DateMathParser syntax e.g.
  210. -->
  211. <!--
  212. <str name="maxCommitAge">30MINUTES</str>
  213. <str name="maxCommitAge">1DAY</str>
  214. -->
  215. <!--
  216. </deletionPolicy>
  217. -->
  218. <!-- Lucene Infostream
  219. To aid in advanced debugging, Lucene provides an "InfoStream"
  220. of detailed information when indexing.
  221. Setting the value to true will instruct the underlying Lucene
  222. IndexWriter to write its info stream to solr's log. By default,
  223. this is enabled here, and controlled through log4j.properties.
  224. -->
  225. <infoStream>true</infoStream>
  226. </indexConfig>
  227. <!-- JMX
  228. This example enables JMX if and only if an existing MBeanServer
  229. is found, use this if you want to configure JMX through JVM
  230. parameters. Remove this to disable exposing Solr configuration
  231. and statistics to JMX.
  232. For more details see http://wiki.apache.org/solr/SolrJmx
  233. -->
  234. <jmx />
  235. <!-- If you want to connect to a particular server, specify the
  236. agentId
  237. -->
  238. <!-- <jmx agentId="myAgent" /> -->
  239. <!-- If you want to start a new MBeanServer, specify the serviceUrl -->
  240. <!-- <jmx serviceUrl="service:jmx:rmi:///jndi/rmi://localhost:9999/solr"/>
  241. -->
  242. <!-- The default high-performance update handler -->
  243. <updateHandler class="solr.DirectUpdateHandler2">
  244. <!-- Enables a transaction log, used for real-time get, durability, and
  245. and solr cloud replica recovery. The log can grow as big as
  246. uncommitted changes to the index, so use of a hard autoCommit
  247. is recommended (see below).
  248. "dir" - the target directory for transaction logs, defaults to the
  249. solr data directory.
  250. "numVersionBuckets" - sets the number of buckets used to keep
  251. track of max version values when checking for re-ordered
  252. updates; increase this value to reduce the cost of
  253. synchronizing access to version buckets during high-volume
  254. indexing, this requires 8 bytes (long) * numVersionBuckets
  255. of heap space per Solr core.
  256. -->
  257. <updateLog>
  258. <str name="dir">${solr.ulog.dir:}</str>
  259. <int name="numVersionBuckets">${solr.ulog.numVersionBuckets:65536}</int>
  260. </updateLog>
  261. <!-- AutoCommit
  262. Perform a hard commit automatically under certain conditions.
  263. Instead of enabling autoCommit, consider using "commitWithin"
  264. when adding documents.
  265. http://wiki.apache.org/solr/UpdateXmlMessages
  266. maxDocs - Maximum number of documents to add since the last
  267. commit before automatically triggering a new commit.
  268. maxTime - Maximum amount of time in ms that is allowed to pass
  269. since a document was added before automatically
  270. triggering a new commit.
  271. openSearcher - if false, the commit causes recent index changes
  272. to be flushed to stable storage, but does not cause a new
  273. searcher to be opened to make those changes visible.
  274. If the updateLog is enabled, then it's highly recommended to
  275. have some sort of hard autoCommit to limit the log size.
  276. -->
  277. <autoCommit>
  278. <maxTime>${solr.autoCommit.maxTime:15000}</maxTime>
  279. <openSearcher>false</openSearcher>
  280. </autoCommit>
  281. <!-- softAutoCommit is like autoCommit except it causes a
  282. 'soft' commit which only ensures that changes are visible
  283. but does not ensure that data is synced to disk. This is
  284. faster and more near-realtime friendly than a hard commit.
  285. -->
  286. <autoSoftCommit>
  287. <maxTime>${solr.autoSoftCommit.maxTime:-1}</maxTime>
  288. </autoSoftCommit>
  289. <!-- Update Related Event Listeners
  290. Various IndexWriter related events can trigger Listeners to
  291. take actions.
  292. postCommit - fired after every commit or optimize command
  293. postOptimize - fired after every optimize command
  294. -->
  295. <!-- The RunExecutableListener executes an external command from a
  296. hook such as postCommit or postOptimize.
  297. exe - the name of the executable to run
  298. dir - dir to use as the current working directory. (default=".")
  299. wait - the calling thread waits until the executable returns.
  300. (default="true")
  301. args - the arguments to pass to the program. (default is none)
  302. env - environment variables to set. (default is none)
  303. -->
  304. <!-- This example shows how RunExecutableListener could be used
  305. with the script based replication...
  306. http://wiki.apache.org/solr/CollectionDistribution
  307. -->
  308. <!--
  309. <listener event="postCommit" class="solr.RunExecutableListener">
  310. <str name="exe">solr/bin/snapshooter</str>
  311. <str name="dir">.</str>
  312. <bool name="wait">true</bool>
  313. <arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
  314. <arr name="env"> <str>MYVAR=val1</str> </arr>
  315. </listener>
  316. -->
  317. </updateHandler>
  318. <!-- IndexReaderFactory
  319. Use the following format to specify a custom IndexReaderFactory,
  320. which allows for alternate IndexReader implementations.
  321. ** Experimental Feature **
  322. Please note - Using a custom IndexReaderFactory may prevent
  323. certain other features from working. The API to
  324. IndexReaderFactory may change without warning or may even be
  325. removed from future releases if the problems cannot be
  326. resolved.
  327. ** Features that may not work with custom IndexReaderFactory **
  328. The ReplicationHandler assumes a disk-resident index. Using a
  329. custom IndexReader implementation may cause incompatibility
  330. with ReplicationHandler and may cause replication to not work
  331. correctly. See SOLR-1366 for details.
  332. -->
  333. <!--
  334. <indexReaderFactory name="IndexReaderFactory" class="package.class">
  335. <str name="someArg">Some Value</str>
  336. </indexReaderFactory >
  337. -->
  338. <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  339. Query section - these settings control query time things like caches
  340. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  341. <query>
  342. <!-- Max Boolean Clauses
  343. Maximum number of clauses in each BooleanQuery, an exception
  344. is thrown if exceeded.
  345. ** WARNING **
  346. This option actually modifies a global Lucene property that
  347. will affect all SolrCores. If multiple solrconfig.xml files
  348. disagree on this property, the value at any given moment will
  349. be based on the last SolrCore to be initialized.
  350. -->
  351. <maxBooleanClauses>1024</maxBooleanClauses>
  352. <!-- Slow Query Threshold (in millis)
  353. At high request rates, logging all requests can become a bottleneck
  354. and therefore INFO logging is often turned off. However, it is still
  355. useful to be able to set a latency threshold above which a request
  356. is considered "slow" and log that request at WARN level so we can
  357. easily identify slow queries.
  358. -->
  359. <slowQueryThresholdMillis>-1</slowQueryThresholdMillis>
  360. <!-- Solr Internal Query Caches
  361. There are two implementations of cache available for Solr,
  362. LRUCache, based on a synchronized LinkedHashMap, and
  363. FastLRUCache, based on a ConcurrentHashMap.
  364. FastLRUCache has faster gets and slower puts in single
  365. threaded operation and thus is generally faster than LRUCache
  366. when the hit ratio of the cache is high (> 75%), and may be
  367. faster under other scenarios on multi-cpu systems.
  368. -->
  369. <!-- Filter Cache
  370. Cache used by SolrIndexSearcher for filters (DocSets),
  371. unordered sets of *all* documents that match a query. When a
  372. new searcher is opened, its caches may be prepopulated or
  373. "autowarmed" using data from caches in the old searcher.
  374. autowarmCount is the number of items to prepopulate. For
  375. LRUCache, the autowarmed items will be the most recently
  376. accessed items.
  377. Parameters:
  378. class - the SolrCache implementation LRUCache or
  379. (LRUCache or FastLRUCache)
  380. size - the maximum number of entries in the cache
  381. initialSize - the initial capacity (number of entries) of
  382. the cache. (see java.util.HashMap)
  383. autowarmCount - the number of entries to prepopulate from
  384. and old cache.
  385. -->
  386. <filterCache class="solr.FastLRUCache"
  387. size="512"
  388. initialSize="512"
  389. autowarmCount="0"/>
  390. <!-- Query Result Cache
  391. Caches results of searches - ordered lists of document ids
  392. (DocList) based on a query, a sort, and the range of documents requested.
  393. Additional supported parameter by LRUCache:
  394. maxRamMB - the maximum amount of RAM (in MB) that this cache is allowed
  395. to occupy
  396. -->
  397. <queryResultCache class="solr.LRUCache"
  398. size="512"
  399. initialSize="512"
  400. autowarmCount="0"/>
  401. <!-- Document Cache
  402. Caches Lucene Document objects (the stored fields for each
  403. document). Since Lucene internal document ids are transient,
  404. this cache will not be autowarmed.
  405. -->
  406. <documentCache class="solr.LRUCache"
  407. size="512"
  408. initialSize="512"
  409. autowarmCount="0"/>
  410. <!-- custom cache currently used by block join -->
  411. <cache name="perSegFilter"
  412. class="solr.search.LRUCache"
  413. size="10"
  414. initialSize="0"
  415. autowarmCount="10"
  416. regenerator="solr.NoOpRegenerator" />
  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. addHttpRequestToContext - if set to true, it will instruct
  553. the requestParsers to include the original HttpServletRequest
  554. object in the context map of the SolrQueryRequest under the
  555. key "httpRequest". It will not be used by any of the existing
  556. Solr components, but may be useful when developing custom
  557. plugins.
  558. *** WARNING ***
  559. The settings below authorize Solr to fetch remote files, You
  560. should make sure your system has some authentication before
  561. using enableRemoteStreaming="true"
  562. -->
  563. <requestParsers enableRemoteStreaming="true"
  564. multipartUploadLimitInKB="2048000"
  565. formdataUploadLimitInKB="2048"
  566. addHttpRequestToContext="false"/>
  567. <!-- HTTP Caching
  568. Set HTTP caching related parameters (for proxy caches and clients).
  569. The options below instruct Solr not to output any HTTP Caching
  570. related headers
  571. -->
  572. <httpCaching never304="true" />
  573. <!-- If you include a <cacheControl> directive, it will be used to
  574. generate a Cache-Control header (as well as an Expires header
  575. if the value contains "max-age=")
  576. By default, no Cache-Control header is generated.
  577. You can use the <cacheControl> option even if you have set
  578. never304="true"
  579. -->
  580. <!--
  581. <httpCaching never304="true" >
  582. <cacheControl>max-age=30, public</cacheControl>
  583. </httpCaching>
  584. -->
  585. <!-- To enable Solr to respond with automatically generated HTTP
  586. Caching headers, and to response to Cache Validation requests
  587. correctly, set the value of never304="false"
  588. This will cause Solr to generate Last-Modified and ETag
  589. headers based on the properties of the Index.
  590. The following options can also be specified to affect the
  591. values of these headers...
  592. lastModFrom - the default value is "openTime" which means the
  593. Last-Modified value (and validation against If-Modified-Since
  594. requests) will all be relative to when the current Searcher
  595. was opened. You can change it to lastModFrom="dirLastMod" if
  596. you want the value to exactly correspond to when the physical
  597. index was last modified.
  598. etagSeed="..." is an option you can change to force the ETag
  599. header (and validation against If-None-Match requests) to be
  600. different even if the index has not changed (ie: when making
  601. significant changes to your config file)
  602. (lastModifiedFrom and etagSeed are both ignored if you use
  603. the never304="true" option)
  604. -->
  605. <!--
  606. <httpCaching lastModifiedFrom="openTime"
  607. etagSeed="Solr">
  608. <cacheControl>max-age=30, public</cacheControl>
  609. </httpCaching>
  610. -->
  611. </requestDispatcher>
  612. <!-- Request Handlers
  613. http://wiki.apache.org/solr/SolrRequestHandler
  614. Incoming queries will be dispatched to a specific handler by name
  615. based on the path specified in the request.
  616. Legacy behavior: If the request path uses "/select" but no Request
  617. Handler has that name, and if handleSelect="true" has been specified in
  618. the requestDispatcher, then the Request Handler is dispatched based on
  619. the qt parameter. Handlers without a leading '/' are accessed this way
  620. like so: http://host/app/[core/]select?qt=name If no qt is
  621. given, then the requestHandler that declares default="true" will be
  622. used or the one named "standard".
  623. If a Request Handler is declared with startup="lazy", then it will
  624. not be initialized until the first request that uses it.
  625. -->
  626. <!-- SearchHandler
  627. http://wiki.apache.org/solr/SearchHandler
  628. For processing Search Queries, the primary Request Handler
  629. provided with Solr is "SearchHandler" It delegates to a sequent
  630. of SearchComponents (see below) and supports distributed
  631. queries across multiple shards
  632. -->
  633. <requestHandler name="/select" class="solr.SearchHandler">
  634. <!-- default values for query parameters can be specified, these
  635. will be overridden by parameters in the request
  636. -->
  637. <lst name="defaults">
  638. <str name="echoParams">explicit</str>
  639. <int name="rows">10</int>
  640. <!-- Controls the distribution of a query to shards other than itself.
  641. Consider making 'preferLocalShards' true when:
  642. 1) maxShardsPerNode > 1
  643. 2) Number of shards > 1
  644. 3) CloudSolrClient or LbHttpSolrServer is used by clients.
  645. Without this option, every core broadcasts the distributed query to
  646. a replica of each shard where the replicas are chosen randomly.
  647. This option directs the cores to prefer cores hosted locally, thus
  648. preventing network delays between machines.
  649. This behavior also immunizes a bad/slow machine from slowing down all
  650. the good machines (if those good machines were querying this bad one).
  651. Specify this option=false for clients connecting through HttpSolrServer
  652. -->
  653. <bool name="preferLocalShards">false</bool>
  654. </lst>
  655. <!-- In addition to defaults, "appends" params can be specified
  656. to identify values which should be appended to the list of
  657. multi-val params from the query (or the existing "defaults").
  658. -->
  659. <!-- In this example, the param "fq=instock:true" would be appended to
  660. any query time fq params the user may specify, as a mechanism for
  661. partitioning the index, independent of any user selected filtering
  662. that may also be desired (perhaps as a result of faceted searching).
  663. NOTE: there is *absolutely* nothing a client can do to prevent these
  664. "appends" values from being used, so don't use this mechanism
  665. unless you are sure you always want it.
  666. -->
  667. <!--
  668. <lst name="appends">
  669. <str name="fq">inStock:true</str>
  670. </lst>
  671. -->
  672. <!-- "invariants" are a way of letting the Solr maintainer lock down
  673. the options available to Solr clients. Any params values
  674. specified here are used regardless of what values may be specified
  675. in either the query, the "defaults", or the "appends" params.
  676. In this example, the facet.field and facet.query params would
  677. be fixed, limiting the facets clients can use. Faceting is
  678. not turned on by default - but if the client does specify
  679. facet=true in the request, these are the only facets they
  680. will be able to see counts for; regardless of what other
  681. facet.field or facet.query params they may specify.
  682. NOTE: there is *absolutely* nothing a client can do to prevent these
  683. "invariants" values from being used, so don't use this mechanism
  684. unless you are sure you always want it.
  685. -->
  686. <!--
  687. <lst name="invariants">
  688. <str name="facet.field">cat</str>
  689. <str name="facet.field">manu_exact</str>
  690. <str name="facet.query">price:[* TO 500]</str>
  691. <str name="facet.query">price:[500 TO *]</str>
  692. </lst>
  693. -->
  694. <!-- If the default list of SearchComponents is not desired, that
  695. list can either be overridden completely, or components can be
  696. prepended or appended to the default list. (see below)
  697. -->
  698. <!--
  699. <arr name="components">
  700. <str>nameOfCustomComponent1</str>
  701. <str>nameOfCustomComponent2</str>
  702. </arr>
  703. -->
  704. </requestHandler>
  705. <!-- A request handler that returns indented JSON by default -->
  706. <requestHandler name="/query" class="solr.SearchHandler">
  707. <lst name="defaults">
  708. <str name="echoParams">explicit</str>
  709. <str name="wt">json</str>
  710. <str name="indent">true</str>
  711. <str name="df">text</str>
  712. </lst>
  713. </requestHandler>
  714. <!--
  715. The export request handler is used to export full sorted result sets.
  716. Do not change these defaults.
  717. -->
  718. <requestHandler name="/export" class="solr.SearchHandler">
  719. <lst name="invariants">
  720. <str name="rq">{!xport}</str>
  721. <str name="wt">xsort</str>
  722. <str name="distrib">false</str>
  723. </lst>
  724. <arr name="components">
  725. <str>query</str>
  726. </arr>
  727. </requestHandler>
  728. <!--
  729. Uncomment for distributed Stream processing.
  730. SECURTIY WARNING: This feature uses Java Serialization for RPC (Remote Procedure Calls) to send executable
  731. Java Objects to Worker nodes.
  732. Solr also currently has apache commons-collections in it's classpath.
  733. This makes Solr vulnerable to this security exploit:
  734. https://issues.apache.org/jira/browse/COLLECTIONS-580.
  735. <requestHandler name="/stream" class="solr.StreamHandler">
  736. <lst name="invariants">
  737. <str name="wt">json</str>
  738. <str name="distrib">false</str>
  739. </lst>
  740. </requestHandler>
  741. -->
  742. <!-- A Robust Example
  743. This example SearchHandler declaration shows off usage of the
  744. SearchHandler with many defaults declared
  745. Note that multiple instances of the same Request Handler
  746. (SearchHandler) can be registered multiple times with different
  747. names (and different init parameters)
  748. -->
  749. <requestHandler name="/browse" class="solr.SearchHandler">
  750. <lst name="defaults">
  751. <str name="echoParams">explicit</str>
  752. <!-- VelocityResponseWriter settings -->
  753. <str name="wt">velocity</str>
  754. <str name="v.template">browse</str>
  755. <str name="v.layout">layout</str>
  756. <str name="title">Solritas</str>
  757. <!-- Query settings -->
  758. <str name="defType">edismax</str>
  759. <str name="qf">
  760. text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
  761. title^10.0 description^5.0 keywords^5.0 author^2.0 resourcename^1.0
  762. </str>
  763. <str name="mm">100%</str>
  764. <str name="q.alt">*:*</str>
  765. <str name="rows">10</str>
  766. <str name="fl">*,score</str>
  767. <str name="mlt.qf">
  768. text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
  769. title^10.0 description^5.0 keywords^5.0 author^2.0 resourcename^1.0
  770. </str>
  771. <str name="mlt.fl">text,features,name,sku,id,manu,cat,title,description,keywords,author,resourcename</str>
  772. <int name="mlt.count">3</int>
  773. <!-- Faceting defaults -->
  774. <str name="facet">on</str>
  775. <str name="facet.missing">true</str>
  776. <str name="facet.field">cat</str>
  777. <str name="facet.field">manu_exact</str>
  778. <str name="facet.field">content_type</str>
  779. <str name="facet.field">author_s</str>
  780. <str name="facet.query">ipod</str>
  781. <str name="facet.query">GB</str>
  782. <str name="facet.mincount">1</str>
  783. <str name="facet.pivot">cat,inStock</str>
  784. <str name="facet.range.other">after</str>
  785. <str name="facet.range">price</str>
  786. <int name="f.price.facet.range.start">0</int>
  787. <int name="f.price.facet.range.end">600</int>
  788. <int name="f.price.facet.range.gap">50</int>
  789. <str name="facet.range">popularity</str>
  790. <int name="f.popularity.facet.range.start">0</int>
  791. <int name="f.popularity.facet.range.end">10</int>
  792. <int name="f.popularity.facet.range.gap">3</int>
  793. <str name="facet.range">manufacturedate_dt</str>
  794. <str name="f.manufacturedate_dt.facet.range.start">NOW/YEAR-10YEARS</str>
  795. <str name="f.manufacturedate_dt.facet.range.end">NOW</str>
  796. <str name="f.manufacturedate_dt.facet.range.gap">+1YEAR</str>
  797. <str name="f.manufacturedate_dt.facet.range.other">before</str>
  798. <str name="f.manufacturedate_dt.facet.range.other">after</str>
  799. <!-- Highlighting defaults -->
  800. <str name="hl">on</str>
  801. <str name="hl.fl">content features title name</str>
  802. <str name="hl.preserveMulti">true</str>
  803. <str name="hl.encoder">html</str>
  804. <str name="hl.simple.pre">&lt;b&gt;</str>
  805. <str name="hl.simple.post">&lt;/b&gt;</str>
  806. <str name="f.title.hl.fragsize">0</str>
  807. <str name="f.title.hl.alternateField">title</str>
  808. <str name="f.name.hl.fragsize">0</str>
  809. <str name="f.name.hl.alternateField">name</str>
  810. <str name="f.content.hl.snippets">3</str>
  811. <str name="f.content.hl.fragsize">200</str>
  812. <str name="f.content.hl.alternateField">content</str>
  813. <str name="f.content.hl.maxAlternateFieldLength">750</str>
  814. <!-- Spell checking defaults -->
  815. <str name="spellcheck">on</str>
  816. <str name="spellcheck.extendedResults">false</str>
  817. <str name="spellcheck.count">5</str>
  818. <str name="spellcheck.alternativeTermCount">2</str>
  819. <str name="spellcheck.maxResultsForSuggest">5</str>
  820. <str name="spellcheck.collate">true</str>
  821. <str name="spellcheck.collateExtendedResults">true</str>
  822. <str name="spellcheck.maxCollationTries">5</str>
  823. <str name="spellcheck.maxCollations">3</str>
  824. </lst>
  825. <!-- append spellchecking to our list of components -->
  826. <arr name="last-components">
  827. <str>spellcheck</str>
  828. </arr>
  829. </requestHandler>
  830. <initParams path="/update/**,/query,/select,/tvrh,/elevate,/spell,/browse">
  831. <lst name="defaults">
  832. <str name="df">text</str>
  833. </lst>
  834. </initParams>
  835. <initParams path="/update/json/docs">
  836. <lst name="defaults">
  837. <!--this ensures that the entire json doc will be stored verbatim into one field-->
  838. <str name="srcField">_src_</str>
  839. <!--This means a the uniqueKeyField will be extracted from the fields and
  840. all fields go into the 'df' field. In this config df is already configured to be 'text'
  841. -->
  842. <str name="mapUniqueKeyOnly">true</str>
  843. </lst>
  844. </initParams>
  845. <!-- The following are implicitly added
  846. <requestHandler name="/update/json" class="solr.UpdateRequestHandler">
  847. <lst name="defaults">
  848. <str name="stream.contentType">application/json</str>
  849. </lst>
  850. </requestHandler>
  851. <requestHandler name="/update/csv" class="solr.UpdateRequestHandler">
  852. <lst name="defaults">
  853. <str name="stream.contentType">application/csv</str>
  854. </lst>
  855. </requestHandler>
  856. -->
  857. <!-- Solr Cell Update Request Handler
  858. http://wiki.apache.org/solr/ExtractingRequestHandler
  859. -->
  860. <requestHandler name="/update/extract"
  861. startup="lazy"
  862. class="solr.extraction.ExtractingRequestHandler" >
  863. <lst name="defaults">
  864. <str name="lowernames">true</str>
  865. <str name="uprefix">ignored_</str>
  866. <!-- capture link hrefs but ignore div attributes -->
  867. <str name="captureAttr">true</str>
  868. <str name="fmap.a">links</str>
  869. <str name="fmap.div">ignored_</str>
  870. </lst>
  871. </requestHandler>
  872. <!-- Field Analysis Request Handler
  873. RequestHandler that provides much the same functionality as
  874. analysis.jsp. Provides the ability to specify multiple field
  875. types and field names in the same request and outputs
  876. index-time and query-time analysis for each of them.
  877. Request parameters are:
  878. analysis.fieldname - field name whose analyzers are to be used
  879. analysis.fieldtype - field type whose analyzers are to be used
  880. analysis.fieldvalue - text for index-time analysis
  881. q (or analysis.q) - text for query time analysis
  882. analysis.showmatch (true|false) - When set to true and when
  883. query analysis is performed, the produced tokens of the
  884. field value analysis will be marked as "matched" for every
  885. token that is produces by the query analysis
  886. -->
  887. <requestHandler name="/analysis/field"
  888. startup="lazy"
  889. class="solr.FieldAnalysisRequestHandler" />
  890. <!-- Document Analysis Handler
  891. http://wiki.apache.org/solr/AnalysisRequestHandler
  892. An analysis handler that provides a breakdown of the analysis
  893. process of provided documents. This handler expects a (single)
  894. content stream with the following format:
  895. <docs>
  896. <doc>
  897. <field name="id">1</field>
  898. <field name="name">The Name</field>
  899. <field name="text">The Text Value</field>
  900. </doc>
  901. <doc>...</doc>
  902. <doc>...</doc>
  903. ...
  904. </docs>
  905. Note: Each document must contain a field which serves as the
  906. unique key. This key is used in the returned response to associate
  907. an analysis breakdown to the analyzed document.
  908. Like the FieldAnalysisRequestHandler, this handler also supports
  909. query analysis by sending either an "analysis.query" or "q"
  910. request parameter that holds the query text to be analyzed. It
  911. also supports the "analysis.showmatch" parameter which when set to
  912. true, all field tokens that match the query tokens will be marked
  913. as a "match".
  914. -->
  915. <requestHandler name="/analysis/document"
  916. class="solr.DocumentAnalysisRequestHandler"
  917. startup="lazy" />
  918. <!-- Echo the request contents back to the client -->
  919. <requestHandler name="/debug/dump" class="solr.DumpRequestHandler" >
  920. <lst name="defaults">
  921. <str name="echoParams">explicit</str>
  922. <str name="echoHandler">true</str>
  923. </lst>
  924. </requestHandler>
  925. <!-- Search Components
  926. Search components are registered to SolrCore and used by
  927. instances of SearchHandler (which can access them by name)
  928. By default, the following components are available:
  929. <searchComponent name="query" class="solr.QueryComponent" />
  930. <searchComponent name="facet" class="solr.FacetComponent" />
  931. <searchComponent name="mlt" class="solr.MoreLikeThisComponent" />
  932. <searchComponent name="highlight" class="solr.HighlightComponent" />
  933. <searchComponent name="stats" class="solr.StatsComponent" />
  934. <searchComponent name="debug" class="solr.DebugComponent" />
  935. Default configuration in a requestHandler would look like:
  936. <arr name="components">
  937. <str>query</str>
  938. <str>facet</str>
  939. <str>mlt</str>
  940. <str>highlight</str>
  941. <str>stats</str>
  942. <str>debug</str>
  943. </arr>
  944. If you register a searchComponent to one of the standard names,
  945. that will be used instead of the default.
  946. To insert components before or after the 'standard' components, use:
  947. <arr name="first-components">
  948. <str>myFirstComponentName</str>
  949. </arr>
  950. <arr name="last-components">
  951. <str>myLastComponentName</str>
  952. </arr>
  953. NOTE: The component registered with the name "debug" will
  954. always be executed after the "last-components"
  955. -->
  956. <!-- Spell Check
  957. The spell check component can return a list of alternative spelling
  958. suggestions.
  959. http://wiki.apache.org/solr/SpellCheckComponent
  960. -->
  961. <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
  962. <str name="queryAnalyzerFieldType">text_general</str>
  963. <!-- Multiple "Spell Checkers" can be declared and used by this
  964. component
  965. -->
  966. <!-- a spellchecker built from a field of the main index -->
  967. <lst name="spellchecker">
  968. <str name="name">default</str>
  969. <str name="field">text</str>
  970. <str name="classname">solr.DirectSolrSpellChecker</str>
  971. <!-- the spellcheck distance measure used, the default is the internal levenshtein -->
  972. <str name="distanceMeasure">internal</str>
  973. <!-- minimum accuracy needed to be considered a valid spellcheck suggestion -->
  974. <float name="accuracy">0.5</float>
  975. <!-- the maximum #edits we consider when enumerating terms: can be 1 or 2 -->
  976. <int name="maxEdits">2</int>
  977. <!-- the minimum shared prefix when enumerating terms -->
  978. <int name="minPrefix">1</int>
  979. <!-- maximum number of inspections per result. -->
  980. <int name="maxInspections">5</int>
  981. <!-- minimum length of a query term to be considered for correction -->
  982. <int name="minQueryLength">4</int>
  983. <!-- maximum threshold of documents a query term can appear to be considered for correction -->
  984. <float name="maxQueryFrequency">0.01</float>
  985. <!-- uncomment this to require suggestions to occur in 1% of the documents
  986. <float name="thresholdTokenFrequency">.01</float>
  987. -->
  988. </lst>
  989. <!-- a spellchecker that can break or combine words. See "/spell" handler below for usage -->
  990. <lst name="spellchecker">
  991. <str name="name">wordbreak</str>
  992. <str name="classname">solr.WordBreakSolrSpellChecker</str>
  993. <str name="field">name</str>
  994. <str name="combineWords">true</str>
  995. <str name="breakWords">true</str>
  996. <int name="maxChanges">10</int>
  997. </lst>
  998. <!-- a spellchecker that uses a different distance measure -->
  999. <!--
  1000. <lst name="spellchecker">
  1001. <str name="name">jarowinkler</str>
  1002. <str name="field">spell</str>
  1003. <str name="classname">solr.DirectSolrSpellChecker</str>
  1004. <str name="distanceMeasure">
  1005. org.apache.lucene.search.spell.JaroWinklerDistance
  1006. </str>
  1007. </lst>
  1008. -->
  1009. <!-- a spellchecker that use an alternate comparator
  1010. comparatorClass be one of:
  1011. 1. score (default)
  1012. 2. freq (Frequency first, then score)
  1013. 3. A fully qualified class name
  1014. -->
  1015. <!--
  1016. <lst name="spellchecker">
  1017. <str name="name">freq</str>
  1018. <str name="field">lowerfilt</str>
  1019. <str name="classname">solr.DirectSolrSpellChecker</str>
  1020. <str name="comparatorClass">freq</str>
  1021. -->
  1022. <!-- A spellchecker that reads the list of words from a file -->
  1023. <!--
  1024. <lst name="spellchecker">
  1025. <str name="classname">solr.FileBasedSpellChecker</str>
  1026. <str name="name">file</str>
  1027. <str name="sourceLocation">spellings.txt</str>
  1028. <str name="characterEncoding">UTF-8</str>
  1029. <str name="spellcheckIndexDir">spellcheckerFile</str>
  1030. </lst>
  1031. -->
  1032. </searchComponent>
  1033. <!-- A request handler for demonstrating the spellcheck component.
  1034. NOTE: This is purely as an example. The whole purpose of the
  1035. SpellCheckComponent is to hook it into the request handler that
  1036. handles your normal user queries so that a separate request is
  1037. not needed to get suggestions.
  1038. IN OTHER WORDS, THERE IS REALLY GOOD CHANCE THE SETUP BELOW IS
  1039. NOT WHAT YOU WANT FOR YOUR PRODUCTION SYSTEM!
  1040. See http://wiki.apache.org/solr/SpellCheckComponent for details
  1041. on the request parameters.
  1042. -->
  1043. <requestHandler name="/spell" class="solr.SearchHandler" startup="lazy">
  1044. <lst name="defaults">
  1045. <!-- Solr will use suggestions from both the 'default' spellchecker
  1046. and from the 'wordbreak' spellchecker and combine them.
  1047. collations (re-written queries) can include a combination of
  1048. corrections from both spellcheckers -->
  1049. <str name="spellcheck.dictionary">default</str>
  1050. <str name="spellcheck.dictionary">wordbreak</str>
  1051. <str name="spellcheck">on</str>
  1052. <str name="spellcheck.extendedResults">true</str>
  1053. <str name="spellcheck.count">10</str>
  1054. <str name="spellcheck.alternativeTermCount">5</str>
  1055. <str name="spellcheck.maxResultsForSuggest">5</str>
  1056. <str name="spellcheck.collate">true</str>
  1057. <str name="spellcheck.collateExtendedResults">true</str>
  1058. <str name="spellcheck.maxCollationTries">10</str>
  1059. <str name="spellcheck.maxCollations">5</str>
  1060. </lst>
  1061. <arr name="last-components">
  1062. <str>spellcheck</str>
  1063. </arr>
  1064. </requestHandler>
  1065. <!-- The SuggestComponent in Solr provides users with automatic suggestions for query terms.
  1066. You can use this to implement a powerful auto-suggest feature in your search application.
  1067. As with the rest of this solrconfig.xml file, the configuration of this component is purely
  1068. an example that applies specifically to this configset and example documents.
  1069. More information about this component and other configuration options are described in the
  1070. "Suggester" section of the reference guide available at
  1071. http://archive.apache.org/dist/lucene/solr/ref-guide
  1072. -->
  1073. <searchComponent name="suggest" class="solr.SuggestComponent">
  1074. <lst name="suggester">
  1075. <str name="name">mySuggester</str>
  1076. <str name="lookupImpl">FuzzyLookupFactory</str>
  1077. <str name="dictionaryImpl">DocumentDictionaryFactory</str>
  1078. <str name="field">cat</str>
  1079. <str name="weightField">price</str>
  1080. <str name="suggestAnalyzerFieldType">string</str>
  1081. <str name="buildOnStartup">false</str>
  1082. </lst>
  1083. </searchComponent>
  1084. <requestHandler name="/suggest" class="solr.SearchHandler"
  1085. startup="lazy" >
  1086. <lst name="defaults">
  1087. <str name="suggest">true</str>
  1088. <str name="suggest.count">10</str>
  1089. </lst>
  1090. <arr name="components">
  1091. <str>suggest</str>
  1092. </arr>
  1093. </requestHandler>
  1094. <!-- Term Vector Component
  1095. http://wiki.apache.org/solr/TermVectorComponent
  1096. -->
  1097. <searchComponent name="tvComponent" class="solr.TermVectorComponent"/>
  1098. <!-- A request handler for demonstrating the term vector component
  1099. This is purely as an example.
  1100. In reality you will likely want to add the component to your
  1101. already specified request handlers.
  1102. -->
  1103. <requestHandler name="/tvrh" class="solr.SearchHandler" startup="lazy">
  1104. <lst name="defaults">
  1105. <bool name="tv">true</bool>
  1106. </lst>
  1107. <arr name="last-components">
  1108. <str>tvComponent</str>
  1109. </arr>
  1110. </requestHandler>
  1111. <!-- Clustering Component
  1112. You'll need to set the solr.clustering.enabled system property
  1113. when running solr to run with clustering enabled:
  1114. -Dsolr.clustering.enabled=true
  1115. https://cwiki.apache.org/confluence/display/solr/Result+Clustering
  1116. -->
  1117. <searchComponent name="clustering"
  1118. enable="${solr.clustering.enabled:false}"
  1119. class="solr.clustering.ClusteringComponent" >
  1120. <!--
  1121. Declaration of "engines" (clustering algorithms).
  1122. The open source algorithms from Carrot2.org project:
  1123. * org.carrot2.clustering.lingo.LingoClusteringAlgorithm
  1124. * org.carrot2.clustering.stc.STCClusteringAlgorithm
  1125. * org.carrot2.clustering.kmeans.BisectingKMeansClusteringAlgorithm
  1126. See http://project.carrot2.org/algorithms.html for more information.
  1127. Commercial algorithm Lingo3G (needs to be installed separately):
  1128. * com.carrotsearch.lingo3g.Lingo3GClusteringAlgorithm
  1129. -->
  1130. <lst name="engine">
  1131. <str name="name">lingo3g</str>
  1132. <bool name="optional">true</bool>
  1133. <str name="carrot.algorithm">com.carrotsearch.lingo3g.Lingo3GClusteringAlgorithm</str>
  1134. <str name="carrot.resourcesDir">clustering/carrot2</str>
  1135. </lst>
  1136. <lst name="engine">
  1137. <str name="name">lingo</str>
  1138. <str name="carrot.algorithm">org.carrot2.clustering.lingo.LingoClusteringAlgorithm</str>
  1139. <str name="carrot.resourcesDir">clustering/carrot2</str>
  1140. </lst>
  1141. <lst name="engine">
  1142. <str name="name">stc</str>
  1143. <str name="carrot.algorithm">org.carrot2.clustering.stc.STCClusteringAlgorithm</str>
  1144. <str name="carrot.resourcesDir">clustering/carrot2</str>
  1145. </lst>
  1146. <lst name="engine">
  1147. <str name="name">kmeans</str>
  1148. <str name="carrot.algorithm">org.carrot2.clustering.kmeans.BisectingKMeansClusteringAlgorithm</str>
  1149. <str name="carrot.resourcesDir">clustering/carrot2</str>
  1150. </lst>
  1151. </searchComponent>
  1152. <!-- A request handler for demonstrating the clustering component.
  1153. This is meant as an example.
  1154. In reality you will likely want to add the component to your
  1155. already specified request handlers.
  1156. -->
  1157. <requestHandler name="/clustering"
  1158. startup="lazy"
  1159. enable="${solr.clustering.enabled:false}"
  1160. class="solr.SearchHandler">
  1161. <lst name="defaults">
  1162. <bool name="clustering">true</bool>
  1163. <bool name="clustering.results">true</bool>
  1164. <!-- Field name with the logical "title" of a each document (optional) -->
  1165. <str name="carrot.title">name</str>
  1166. <!-- Field name with the logical "URL" of a each document (optional) -->
  1167. <str name="carrot.url">id</str>
  1168. <!-- Field name with the logical "content" of a each document (optional) -->
  1169. <str name="carrot.snippet">features</str>
  1170. <!-- Apply highlighter to the title/ content and use this for clustering. -->
  1171. <bool name="carrot.produceSummary">true</bool>
  1172. <!-- the maximum number of labels per cluster -->
  1173. <!--<int name="carrot.numDescriptions">5</int>-->
  1174. <!-- produce sub clusters -->
  1175. <bool name="carrot.outputSubClusters">false</bool>
  1176. <!-- Configure the remaining request handler parameters. -->
  1177. <str name="defType">edismax</str>
  1178. <str name="qf">
  1179. text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
  1180. </str>
  1181. <str name="q.alt">*:*</str>
  1182. <str name="rows">100</str>
  1183. <str name="fl">*,score</str>
  1184. </lst>
  1185. <arr name="last-components">
  1186. <str>clustering</str>
  1187. </arr>
  1188. </requestHandler>
  1189. <!-- Terms Component
  1190. http://wiki.apache.org/solr/TermsComponent
  1191. A component to return terms and document frequency of those
  1192. terms
  1193. -->
  1194. <searchComponent name="terms" class="solr.TermsComponent"/>
  1195. <!-- A request handler for demonstrating the terms component -->
  1196. <requestHandler name="/terms" class="solr.SearchHandler" startup="lazy">
  1197. <lst name="defaults">
  1198. <bool name="terms">true</bool>
  1199. <bool name="distrib">false</bool>
  1200. </lst>
  1201. <arr name="components">
  1202. <str>terms</str>
  1203. </arr>
  1204. </requestHandler>
  1205. <!-- Query Elevation Component
  1206. http://wiki.apache.org/solr/QueryElevationComponent
  1207. a search component that enables you to configure the top
  1208. results for a given query regardless of the normal lucene
  1209. scoring.
  1210. -->
  1211. <searchComponent name="elevator" class="solr.QueryElevationComponent" >
  1212. <!-- pick a fieldType to analyze queries -->
  1213. <str name="queryFieldType">string</str>
  1214. <str name="config-file">elevate.xml</str>
  1215. </searchComponent>
  1216. <!-- A request handler for demonstrating the elevator component -->
  1217. <requestHandler name="/elevate" class="solr.SearchHandler" startup="lazy">
  1218. <lst name="defaults">
  1219. <str name="echoParams">explicit</str>
  1220. </lst>
  1221. <arr name="last-components">
  1222. <str>elevator</str>
  1223. </arr>
  1224. </requestHandler>
  1225. <!-- Highlighting Component
  1226. http://wiki.apache.org/solr/HighlightingParameters
  1227. -->
  1228. <searchComponent class="solr.HighlightComponent" name="highlight">
  1229. <highlighting>
  1230. <!-- Configure the standard fragmenter -->
  1231. <!-- This could most likely be commented out in the "default" case -->
  1232. <fragmenter name="gap"
  1233. default="true"
  1234. class="solr.highlight.GapFragmenter">
  1235. <lst name="defaults">
  1236. <int name="hl.fragsize">100</int>
  1237. </lst>
  1238. </fragmenter>
  1239. <!-- A regular-expression-based fragmenter
  1240. (for sentence extraction)
  1241. -->
  1242. <fragmenter name="regex"
  1243. class="solr.highlight.RegexFragmenter">
  1244. <lst name="defaults">
  1245. <!-- slightly smaller fragsizes work better because of slop -->
  1246. <int name="hl.fragsize">70</int>
  1247. <!-- allow 50% slop on fragment sizes -->
  1248. <float name="hl.regex.slop">0.5</float>
  1249. <!-- a basic sentence pattern -->
  1250. <str name="hl.regex.pattern">[-\w ,/\n\&quot;&apos;]{20,200}</str>
  1251. </lst>
  1252. </fragmenter>
  1253. <!-- Configure the standard formatter -->
  1254. <formatter name="html"
  1255. default="true"
  1256. class="solr.highlight.HtmlFormatter">
  1257. <lst name="defaults">
  1258. <str name="hl.simple.pre"><![CDATA[<em>]]></str>
  1259. <str name="hl.simple.post"><![CDATA[</em>]]></str>
  1260. </lst>
  1261. </formatter>
  1262. <!-- Configure the standard encoder -->
  1263. <encoder name="html"
  1264. class="solr.highlight.HtmlEncoder" />
  1265. <!-- Configure the standard fragListBuilder -->
  1266. <fragListBuilder name="simple"
  1267. class="solr.highlight.SimpleFragListBuilder"/>
  1268. <!-- Configure the single fragListBuilder -->
  1269. <fragListBuilder name="single"
  1270. class="solr.highlight.SingleFragListBuilder"/>
  1271. <!-- Configure the weighted fragListBuilder -->
  1272. <fragListBuilder name="weighted"
  1273. default="true"
  1274. class="solr.highlight.WeightedFragListBuilder"/>
  1275. <!-- default tag FragmentsBuilder -->
  1276. <fragmentsBuilder name="default"
  1277. default="true"
  1278. class="solr.highlight.ScoreOrderFragmentsBuilder">
  1279. <!--
  1280. <lst name="defaults">
  1281. <str name="hl.multiValuedSeparatorChar">/</str>
  1282. </lst>
  1283. -->
  1284. </fragmentsBuilder>
  1285. <!-- multi-colored tag FragmentsBuilder -->
  1286. <fragmentsBuilder name="colored"
  1287. class="solr.highlight.ScoreOrderFragmentsBuilder">
  1288. <lst name="defaults">
  1289. <str name="hl.tag.pre"><![CDATA[
  1290. <b style="background:yellow">,<b style="background:lawgreen">,
  1291. <b style="background:aquamarine">,<b style="background:magenta">,
  1292. <b style="background:palegreen">,<b style="background:coral">,
  1293. <b style="background:wheat">,<b style="background:khaki">,
  1294. <b style="background:lime">,<b style="background:deepskyblue">]]></str>
  1295. <str name="hl.tag.post"><![CDATA[</b>]]></str>
  1296. </lst>
  1297. </fragmentsBuilder>
  1298. <boundaryScanner name="default"
  1299. default="true"
  1300. class="solr.highlight.SimpleBoundaryScanner">
  1301. <lst name="defaults">
  1302. <str name="hl.bs.maxScan">10</str>
  1303. <str name="hl.bs.chars">.,!? &#9;&#10;&#13;</str>
  1304. </lst>
  1305. </boundaryScanner>
  1306. <boundaryScanner name="breakIterator"
  1307. class="solr.highlight.BreakIteratorBoundaryScanner">
  1308. <lst name="defaults">
  1309. <!-- type should be one of CHARACTER, WORD(default), LINE and SENTENCE -->
  1310. <str name="hl.bs.type">WORD</str>
  1311. <!-- language and country are used when constructing Locale object. -->
  1312. <!-- And the Locale object will be used when getting instance of BreakIterator -->
  1313. <str name="hl.bs.language">en</str>
  1314. <str name="hl.bs.country">US</str>
  1315. </lst>
  1316. </boundaryScanner>
  1317. </highlighting>
  1318. </searchComponent>
  1319. <!-- Update Processors
  1320. Chains of Update Processor Factories for dealing with Update
  1321. Requests can be declared, and then used by name in Update
  1322. Request Processors
  1323. http://wiki.apache.org/solr/UpdateRequestProcessor
  1324. -->
  1325. <!-- Deduplication
  1326. An example dedup update processor that creates the "id" field
  1327. on the fly based on the hash code of some other fields. This
  1328. example has overwriteDupes set to false since we are using the
  1329. id field as the signatureField and Solr will maintain
  1330. uniqueness based on that anyway.
  1331. -->
  1332. <!--
  1333. <updateRequestProcessorChain name="dedupe">
  1334. <processor class="solr.processor.SignatureUpdateProcessorFactory">
  1335. <bool name="enabled">true</bool>
  1336. <str name="signatureField">id</str>
  1337. <bool name="overwriteDupes">false</bool>
  1338. <str name="fields">name,features,cat</str>
  1339. <str name="signatureClass">solr.processor.Lookup3Signature</str>
  1340. </processor>
  1341. <processor class="solr.LogUpdateProcessorFactory" />
  1342. <processor class="solr.RunUpdateProcessorFactory" />
  1343. </updateRequestProcessorChain>
  1344. -->
  1345. <!-- Language identification
  1346. This example update chain identifies the language of the incoming
  1347. documents using the langid contrib. The detected language is
  1348. written to field language_s. No field name mapping is done.
  1349. The fields used for detection are text, title, subject and description,
  1350. making this example suitable for detecting languages form full-text
  1351. rich documents injected via ExtractingRequestHandler.
  1352. See more about langId at http://wiki.apache.org/solr/LanguageDetection
  1353. -->
  1354. <!--
  1355. <updateRequestProcessorChain name="langid">
  1356. <processor class="org.apache.solr.update.processor.TikaLanguageIdentifierUpdateProcessorFactory">
  1357. <str name="langid.fl">text,title,subject,description</str>
  1358. <str name="langid.langField">language_s</str>
  1359. <str name="langid.fallback">en</str>
  1360. </processor>
  1361. <processor class="solr.LogUpdateProcessorFactory" />
  1362. <processor class="solr.RunUpdateProcessorFactory" />
  1363. </updateRequestProcessorChain>
  1364. -->
  1365. <!-- Script update processor
  1366. This example hooks in an update processor implemented using JavaScript.
  1367. See more about the script update processor at http://wiki.apache.org/solr/ScriptUpdateProcessor
  1368. -->
  1369. <!--
  1370. <updateRequestProcessorChain name="script">
  1371. <processor class="solr.StatelessScriptUpdateProcessorFactory">
  1372. <str name="script">update-script.js</str>
  1373. <lst name="params">
  1374. <str name="config_param">example config parameter</str>
  1375. </lst>
  1376. </processor>
  1377. <processor class="solr.RunUpdateProcessorFactory" />
  1378. </updateRequestProcessorChain>
  1379. -->
  1380. <!-- Response Writers
  1381. http://wiki.apache.org/solr/QueryResponseWriter
  1382. Request responses will be written using the writer specified by
  1383. the 'wt' request parameter matching the name of a registered
  1384. writer.
  1385. The "default" writer is the default and will be used if 'wt' is
  1386. not specified in the request.
  1387. -->
  1388. <!-- The following response writers are implicitly configured unless
  1389. overridden...
  1390. -->
  1391. <!--
  1392. <queryResponseWriter name="xml"
  1393. default="true"
  1394. class="solr.XMLResponseWriter" />
  1395. <queryResponseWriter name="json" class="solr.JSONResponseWriter"/>
  1396. <queryResponseWriter name="python" class="solr.PythonResponseWriter"/>
  1397. <queryResponseWriter name="ruby" class="solr.RubyResponseWriter"/>
  1398. <queryResponseWriter name="php" class="solr.PHPResponseWriter"/>
  1399. <queryResponseWriter name="phps" class="solr.PHPSerializedResponseWriter"/>
  1400. <queryResponseWriter name="csv" class="solr.CSVResponseWriter"/>
  1401. <queryResponseWriter name="schema.xml" class="solr.SchemaXmlResponseWriter"/>
  1402. -->
  1403. <queryResponseWriter name="json" class="solr.JSONResponseWriter">
  1404. <!-- For the purposes of the tutorial, JSON responses are written as
  1405. plain text so that they are easy to read in *any* browser.
  1406. If you expect a MIME type of "application/json" just remove this override.
  1407. -->
  1408. <str name="content-type">text/plain; charset=UTF-8</str>
  1409. </queryResponseWriter>
  1410. <!--
  1411. Custom response writers can be declared as needed...
  1412. -->
  1413. <queryResponseWriter name="velocity" class="solr.VelocityResponseWriter" startup="lazy">
  1414. <str name="template.base.dir">${velocity.template.base.dir:}</str>
  1415. </queryResponseWriter>
  1416. <!-- XSLT response writer transforms the XML output by any xslt file found
  1417. in Solr's conf/xslt directory. Changes to xslt files are checked for
  1418. every xsltCacheLifetimeSeconds.
  1419. -->
  1420. <queryResponseWriter name="xslt" class="solr.XSLTResponseWriter">
  1421. <int name="xsltCacheLifetimeSeconds">5</int>
  1422. </queryResponseWriter>
  1423. <!-- Query Parsers
  1424. http://wiki.apache.org/solr/SolrQuerySyntax
  1425. Multiple QParserPlugins can be registered by name, and then
  1426. used in either the "defType" param for the QueryComponent (used
  1427. by SearchHandler) or in LocalParams
  1428. -->
  1429. <!-- example of registering a query parser -->
  1430. <!--
  1431. <queryParser name="myparser" class="com.mycompany.MyQParserPlugin"/>
  1432. -->
  1433. <!-- Function Parsers
  1434. http://wiki.apache.org/solr/FunctionQuery
  1435. Multiple ValueSourceParsers can be registered by name, and then
  1436. used as function names when using the "func" QParser.
  1437. -->
  1438. <!-- example of registering a custom function parser -->
  1439. <!--
  1440. <valueSourceParser name="myfunc"
  1441. class="com.mycompany.MyValueSourceParser" />
  1442. -->
  1443. <!-- Document Transformers
  1444. http://wiki.apache.org/solr/DocTransformers
  1445. -->
  1446. <!--
  1447. Could be something like:
  1448. <transformer name="db" class="com.mycompany.LoadFromDatabaseTransformer" >
  1449. <int name="connection">jdbc://....</int>
  1450. </transformer>
  1451. To add a constant value to all docs, use:
  1452. <transformer name="mytrans2" class="org.apache.solr.response.transform.ValueAugmenterFactory" >
  1453. <int name="value">5</int>
  1454. </transformer>
  1455. If you want the user to still be able to change it with _value:something_ use this:
  1456. <transformer name="mytrans3" class="org.apache.solr.response.transform.ValueAugmenterFactory" >
  1457. <double name="defaultValue">5</double>
  1458. </transformer>
  1459. If you are using the QueryElevationComponent, you may wish to mark documents that get boosted. The
  1460. EditorialMarkerFactory will do exactly that:
  1461. <transformer name="qecBooster" class="org.apache.solr.response.transform.EditorialMarkerFactory" />
  1462. -->
  1463. <!-- Legacy config for the admin interface -->
  1464. <admin>
  1465. <defaultQuery>*:*</defaultQuery>
  1466. </admin>
  1467. </config>