solrconfig.xml 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736
  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. <config name="drupal-3.0-0-solr1.4">
  17. <!-- Set this to 'false' if you want solr to continue working after it has
  18. encountered an severe configuration error. In a production environment,
  19. you may want solr to keep working even if one handler is mis-configured.
  20. You may also set this to false using by setting the system property:
  21. -Dsolr.abortOnConfigurationError=false
  22. -->
  23. <abortOnConfigurationError>${solr.abortOnConfigurationError:true}</abortOnConfigurationError>
  24. <!-- Used to specify an alternate directory to hold all index data
  25. other than the default ./data under the Solr home.
  26. If replication is in use, this should match the replication configuration. -->
  27. <!--
  28. <dataDir>${solr.data.dir:./solr/data}</dataDir>
  29. -->
  30. <indexDefaults>
  31. <!-- Values here affect all index writers and act as a default unless overridden. -->
  32. <useCompoundFile>false</useCompoundFile>
  33. <mergeFactor>10</mergeFactor>
  34. <!--
  35. If both ramBufferSizeMB and maxBufferedDocs is set, then Lucene will flush based on whichever limit is hit first.
  36. -->
  37. <!--<maxBufferedDocs>1000</maxBufferedDocs>-->
  38. <!-- Tell Lucene when to flush documents to disk.
  39. Giving Lucene more memory for indexing means faster indexing at the cost of more RAM
  40. If both ramBufferSizeMB and maxBufferedDocs is set, then Lucene will flush based on whichever limit is hit first.
  41. -->
  42. <ramBufferSizeMB>32</ramBufferSizeMB>
  43. <maxMergeDocs>2147483647</maxMergeDocs>
  44. <maxFieldLength>20000</maxFieldLength>
  45. <writeLockTimeout>1000</writeLockTimeout>
  46. <commitLockTimeout>10000</commitLockTimeout>
  47. <!--
  48. Expert: Turn on Lucene's auto commit capability.
  49. This causes intermediate segment flushes to write a new lucene
  50. index descriptor, enabling it to be opened by an external
  51. IndexReader.
  52. NOTE: Despite the name, this value does not have any relation to Solr's autoCommit functionality
  53. -->
  54. <!--<luceneAutoCommit>false</luceneAutoCommit>-->
  55. <!--
  56. Expert:
  57. The Merge Policy in Lucene controls how merging is handled by Lucene. The default in 2.3 is the LogByteSizeMergePolicy, previous
  58. versions used LogDocMergePolicy.
  59. LogByteSizeMergePolicy chooses segments to merge based on their size. The Lucene 2.2 default, LogDocMergePolicy chose when
  60. to merge based on number of documents
  61. Other implementations of MergePolicy must have a no-argument constructor
  62. -->
  63. <mergePolicy class="org.apache.lucene.index.LogByteSizeMergePolicy" />
  64. <!--
  65. Expert:
  66. The Merge Scheduler in Lucene controls how merges are performed. The ConcurrentMergeScheduler (Lucene 2.3 default)
  67. can perform merges in the background using separate threads. The SerialMergeScheduler (Lucene 2.2 default) does not.
  68. -->
  69. <!--<mergeScheduler>org.apache.lucene.index.ConcurrentMergeScheduler</mergeScheduler>-->
  70. <!--
  71. This option specifies which Lucene LockFactory implementation to use.
  72. single = SingleInstanceLockFactory - suggested for a read-only index
  73. or when there is no possibility of another process trying
  74. to modify the index.
  75. native = NativeFSLockFactory
  76. simple = SimpleFSLockFactory
  77. (For backwards compatibility with Solr 1.2, 'simple' is the default
  78. if not specified.)
  79. -->
  80. <lockType>single</lockType>
  81. </indexDefaults>
  82. <mainIndex>
  83. <!-- options specific to the main on-disk lucene index -->
  84. <useCompoundFile>false</useCompoundFile>
  85. <ramBufferSizeMB>32</ramBufferSizeMB>
  86. <mergeFactor>4</mergeFactor>
  87. <maxMergeDocs>2147483647</maxMergeDocs>
  88. <maxFieldLength>20000</maxFieldLength>
  89. <!-- If true, unlock any held write or commit locks on startup.
  90. This defeats the locking mechanism that allows multiple
  91. processes to safely access a lucene index, and should be
  92. used with care.
  93. This is not needed if lock type is 'none' or 'single'
  94. -->
  95. <unlockOnStartup>false</unlockOnStartup>
  96. <!--
  97. Custom deletion policies can specified here. The class must
  98. implement org.apache.lucene.index.IndexDeletionPolicy.
  99. http://lucene.apache.org/java/2_3_2/api/org/apache/lucene/index/IndexDeletionPolicy.html
  100. The standard Solr IndexDeletionPolicy implementation supports deleting
  101. index commit points on number of commits, age of commit point and
  102. optimized status.
  103. The latest commit point should always be preserved regardless
  104. of the criteria.
  105. -->
  106. <deletionPolicy class="solr.SolrDeletionPolicy">
  107. <!-- Keep only optimized commit points -->
  108. <str name="keepOptimizedOnly">false</str>
  109. <!-- The maximum number of commit points to be kept -->
  110. <str name="maxCommitsToKeep">1</str>
  111. <!--
  112. Delete all commit points once they have reached the given age.
  113. Supports DateMathParser syntax e.g.
  114. <str name="maxCommitAge">30MINUTES</str>
  115. <str name="maxCommitAge">1DAY</str>
  116. -->
  117. </deletionPolicy>
  118. </mainIndex>
  119. <!-- Enables JMX if and only if an existing MBeanServer is found, use
  120. this if you want to configure JMX through JVM parameters. Remove
  121. this to disable exposing Solr configuration and statistics to JMX.
  122. If you want to connect to a particular server, specify the agentId
  123. e.g. <jmx agentId="myAgent" />
  124. If you want to start a new MBeanServer, specify the serviceUrl
  125. e.g <jmx serviceUrl="service:jmx:rmi:///jndi/rmi://localhost:9999/solr" />
  126. For more details see http://wiki.apache.org/solr/SolrJmx
  127. -->
  128. <jmx />
  129. <!-- the default high-performance update handler -->
  130. <updateHandler class="solr.DirectUpdateHandler2">
  131. <!-- A prefix of "solr." for class names is an alias that
  132. causes solr to search appropriate packages, including
  133. org.apache.solr.(search|update|request|core|analysis)
  134. -->
  135. <!-- Perform a <commit/> automatically under certain conditions:
  136. maxDocs - number of updates since last commit is greater than this
  137. maxTime - oldest uncommited update (in ms) is this long ago
  138. -->
  139. <autoCommit>
  140. <maxDocs>2000</maxDocs>
  141. <maxTime>120000</maxTime>
  142. </autoCommit>
  143. <!-- The RunExecutableListener executes an external command.
  144. exe - the name of the executable to run
  145. dir - dir to use as the current working directory. default="."
  146. wait - the calling thread waits until the executable returns. default="true"
  147. args - the arguments to pass to the program. default=nothing
  148. env - environment variables to set. default=nothing
  149. -->
  150. <!-- A postCommit event is fired after every commit or optimize command
  151. <listener event="postCommit" class="solr.RunExecutableListener">
  152. <str name="exe">solr/bin/snapshooter</str>
  153. <str name="dir">.</str>
  154. <bool name="wait">true</bool>
  155. <arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
  156. <arr name="env"> <str>MYVAR=val1</str> </arr>
  157. </listener>
  158. -->
  159. <!-- A postOptimize event is fired only after every optimize command, useful
  160. in conjunction with index distribution to only distribute optimized indicies
  161. <listener event="postOptimize" class="solr.RunExecutableListener">
  162. <str name="exe">snapshooter</str>
  163. <str name="dir">solr/bin</str>
  164. <bool name="wait">true</bool>
  165. </listener>
  166. -->
  167. </updateHandler>
  168. <query>
  169. <!-- Maximum number of clauses in a boolean query... can affect
  170. range or prefix queries that expand to big boolean
  171. queries. An exception is thrown if exceeded. -->
  172. <maxBooleanClauses>1024</maxBooleanClauses>
  173. <!-- There are two implementations of cache available for Solr,
  174. LRUCache, based on a synchronized LinkedHashMap, and
  175. FastLRUCache, based on a ConcurrentHashMap. FastLRUCache has faster gets
  176. and slower puts in single threaded operation and thus is generally faster
  177. than LRUCache when the hit ratio of the cache is high (> 75%), and may be
  178. faster under other scenarios on multi-cpu systems. -->
  179. <!-- Cache used by SolrIndexSearcher for filters (DocSets),
  180. unordered sets of *all* documents that match a query.
  181. When a new searcher is opened, its caches may be prepopulated
  182. or "autowarmed" using data from caches in the old searcher.
  183. autowarmCount is the number of items to prepopulate. For LRUCache,
  184. the autowarmed items will be the most recently accessed items.
  185. Parameters:
  186. class - the SolrCache implementation LRUCache or FastLRUCache
  187. size - the maximum number of entries in the cache
  188. initialSize - the initial capacity (number of entries) of
  189. the cache. (seel java.util.HashMap)
  190. autowarmCount - the number of entries to prepopulate from
  191. and old cache.
  192. -->
  193. <filterCache
  194. class="solr.FastLRUCache"
  195. size="512"
  196. initialSize="512"
  197. autowarmCount="128"/>
  198. <!-- Cache used to hold field values that are quickly accessible
  199. by document id. The fieldValueCache is created by default
  200. even if not configured here.
  201. <fieldValueCache
  202. class="solr.FastLRUCache"
  203. size="512"
  204. autowarmCount="128"
  205. showItems="32"
  206. />
  207. -->
  208. <!-- queryResultCache caches results of searches - ordered lists of
  209. document ids (DocList) based on a query, a sort, and the range
  210. of documents requested. -->
  211. <queryResultCache
  212. class="solr.LRUCache"
  213. size="512"
  214. initialSize="512"
  215. autowarmCount="32"/>
  216. <!-- documentCache caches Lucene Document objects (the stored fields for each document).
  217. Since Lucene internal document ids are transient, this cache will not be autowarmed. -->
  218. <documentCache
  219. class="solr.LRUCache"
  220. size="512"
  221. initialSize="512"
  222. autowarmCount="0"/>
  223. <!-- If true, stored fields that are not requested will be loaded lazily.
  224. This can result in a significant speed improvement if the usual case is to
  225. not load all stored fields, especially if the skipped fields are large compressed
  226. text fields.
  227. -->
  228. <enableLazyFieldLoading>true</enableLazyFieldLoading>
  229. <!-- Example of a generic cache. These caches may be accessed by name
  230. through SolrIndexSearcher.getCache(),cacheLookup(), and cacheInsert().
  231. The purpose is to enable easy caching of user/application level data.
  232. The regenerator argument should be specified as an implementation
  233. of solr.search.CacheRegenerator if autowarming is desired. -->
  234. <!--
  235. <cache name="myUserCache"
  236. class="solr.LRUCache"
  237. size="4096"
  238. initialSize="1024"
  239. autowarmCount="1024"
  240. regenerator="org.mycompany.mypackage.MyRegenerator"
  241. />
  242. -->
  243. <!-- An optimization that attempts to use a filter to satisfy a search.
  244. If the requested sort does not include score, then the filterCache
  245. will be checked for a filter matching the query. If found, the filter
  246. will be used as the source of document ids, and then the sort will be
  247. applied to that.
  248. <useFilterForSortedQuery>true</useFilterForSortedQuery>
  249. -->
  250. <!-- An optimization for use with the queryResultCache. When a search
  251. is requested, a superset of the requested number of document ids
  252. are collected. For example, if a search for a particular query
  253. requests matching documents 10 through 19, and queryWindowSize is 50,
  254. then documents 0 through 49 will be collected and cached. Any further
  255. requests in that range can be satisfied via the cache. -->
  256. <queryResultWindowSize>50</queryResultWindowSize>
  257. <!-- Maximum number of documents to cache for any entry in the
  258. queryResultCache. -->
  259. <queryResultMaxDocsCached>200</queryResultMaxDocsCached>
  260. <!-- This entry enables an int hash representation for filters (DocSets)
  261. when the number of items in the set is less than maxSize. For smaller
  262. sets, this representation is more memory efficient, more efficient to
  263. iterate over, and faster to take intersections. -->
  264. <HashDocSet maxSize="3000" loadFactor="0.75"/>
  265. <!-- a newSearcher event is fired whenever a new searcher is being prepared
  266. and there is a current searcher handling requests (aka registered). -->
  267. <!-- QuerySenderListener takes an array of NamedList and executes a
  268. local query request for each NamedList in sequence. -->
  269. <listener event="newSearcher" class="solr.QuerySenderListener">
  270. <arr name="queries">
  271. <lst> <str name="q">solr</str> <str name="start">0</str> <str name="rows">10</str> </lst>
  272. <lst> <str name="q">rocks</str> <str name="start">0</str> <str name="rows">10</str> </lst>
  273. <lst><str name="q">static newSearcher warming query from solrconfig.xml</str></lst>
  274. </arr>
  275. </listener>
  276. <!-- a firstSearcher event is fired whenever a new searcher is being
  277. prepared but there is no current registered searcher to handle
  278. requests or to gain autowarming data from. -->
  279. <listener event="firstSearcher" class="solr.QuerySenderListener">
  280. <arr name="queries">
  281. <lst> <str name="q">fast_warm</str> <str name="start">0</str> <str name="rows">10</str> </lst>
  282. <lst><str name="q">static firstSearcher warming query from solrconfig.xml</str></lst>
  283. </arr>
  284. </listener>
  285. <!-- If a search request comes in and there is no current registered searcher,
  286. then immediately register the still warming searcher and use it. If
  287. "false" then all requests will block until the first searcher is done
  288. warming. -->
  289. <useColdSearcher>false</useColdSearcher>
  290. <!-- Maximum number of searchers that may be warming in the background
  291. concurrently. An error is returned if this limit is exceeded. Recommend
  292. 1-2 for read-only slaves, higher for masters w/o cache warming. -->
  293. <maxWarmingSearchers>2</maxWarmingSearchers>
  294. </query>
  295. <!--
  296. Let the dispatch filter handler /select?qt=XXX
  297. handleSelect=true will use consistent error handling for /select and /update
  298. handleSelect=false will use solr1.1 style error formatting
  299. -->
  300. <requestDispatcher handleSelect="true" >
  301. <!--Make sure your system has some authentication before enabling remote streaming! -->
  302. <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="2048" />
  303. <!-- Set HTTP caching related parameters (for proxy caches and clients).
  304. To get the behaviour of Solr 1.2 (ie: no caching related headers)
  305. use the never304="true" option and do not specify a value for
  306. <cacheControl>
  307. -->
  308. <!-- <httpCaching never304="true"> -->
  309. <httpCaching lastModifiedFrom="openTime"
  310. etagSeed="Solr">
  311. <!-- lastModFrom="openTime" is the default, the Last-Modified value
  312. (and validation against If-Modified-Since requests) will all be
  313. relative to when the current Searcher was opened.
  314. You can change it to lastModFrom="dirLastMod" if you want the
  315. value to exactly corrispond to when the physical index was last
  316. modified.
  317. etagSeed="..." is an option you can change to force the ETag
  318. header (and validation against If-None-Match requests) to be
  319. differnet even if the index has not changed (ie: when making
  320. significant changes to your config file)
  321. lastModifiedFrom and etagSeed are both ignored if you use the
  322. never304="true" option.
  323. -->
  324. <!-- If you include a <cacheControl> directive, it will be used to
  325. generate a Cache-Control header, as well as an Expires header
  326. if the value contains "max-age="
  327. By default, no Cache-Control header is generated.
  328. You can use the <cacheControl> option even if you have set
  329. never304="true"
  330. -->
  331. <!-- <cacheControl>max-age=30, public</cacheControl> -->
  332. </httpCaching>
  333. </requestDispatcher>
  334. <!-- requestHandler plugins... incoming queries will be dispatched to the
  335. correct handler based on the path or the qt (query type) param.
  336. Names starting with a '/' are accessed with the a path equal to the
  337. registered name. Names without a leading '/' are accessed with:
  338. http://host/app/select?qt=name
  339. If no qt is defined, the requestHandler that declares default="true"
  340. will be used.
  341. -->
  342. <requestHandler name="standard" class="solr.SearchHandler">
  343. <!-- default values for query parameters -->
  344. <lst name="defaults">
  345. <str name="echoParams">explicit</str>
  346. <bool name="omitHeader">true</bool>
  347. <!--
  348. <int name="rows">10</int>
  349. <str name="fl">*</str>
  350. <str name="version">2.1</str>
  351. -->
  352. </lst>
  353. </requestHandler>
  354. <!-- Please refer to http://wiki.apache.org/solr/SolrReplication for details on configuring replication -->
  355. <!-- MASTER_REPLICATION_START
  356. <requestHandler name="/replication" class="solr.ReplicationHandler" >
  357. <lst name="master">
  358. <str name="replicateAfter">commit</str>
  359. <str name="replicateAfter">startup</str>
  360. <str name="confFiles">schema.xml,mapping-ISOLatin1Accent.txt,protwords.txt,stopwords.txt,synonyms.txt,elevate.xml</str>
  361. </lst>
  362. </requestHandler>
  363. MASTER_REPLICATION_END -->
  364. <!-- SLAVE_REPLICATION_START
  365. <requestHandler name="/replication" class="solr.ReplicationHandler" >
  366. <lst name="slave">
  367. <str name="masterUrl">$MASTER_CORE_URL/replication</str>
  368. <str name="pollInterval">$POLL_TIME</str>
  369. </lst>
  370. </requestHandler>
  371. SLAVE_REPLICATION_END -->
  372. <!-- DisMaxRequestHandler allows easy searching across multiple fields
  373. for simple user-entered phrases. It's implementation is now
  374. just the standard SearchHandler with a default query type
  375. of "dismax".
  376. see http://wiki.apache.org/solr/DisMaxRequestHandler
  377. -->
  378. <requestHandler name="dismax" class="solr.SearchHandler">
  379. <lst name="defaults">
  380. <str name="defType">dismax</str>
  381. <str name="echoParams">explicit</str>
  382. <bool name="omitHeader">true</bool>
  383. </lst>
  384. </requestHandler>
  385. <!-- Note how you can register the same handler multiple times with
  386. different names (and different init parameters)
  387. -->
  388. <requestHandler name="drupal" class="solr.SearchHandler" default="true">
  389. <lst name="defaults">
  390. <str name="defType">dismax</str>
  391. <str name="echoParams">explicit</str>
  392. <bool name="omitHeader">true</bool>
  393. <float name="tie">0.01</float>
  394. <str name="pf">
  395. content^2.0
  396. </str>
  397. <int name="ps">15</int>
  398. <!-- Abort any searches longer than 4 seconds -->
  399. <!-- <int name="timeAllowed">4000</int> -->
  400. <str name="mm">1</str>
  401. <str name="q.alt">*:*</str>
  402. <!-- example highlighter config, enable per-query with hl=true -->
  403. <str name="hl">true</str>
  404. <str name="hl.fl">content</str>
  405. <int name="hl.snippets">3</int>
  406. <str name="hl.mergeContiguous">true</str>
  407. <!-- instructs Solr to return the field itself if no query terms are
  408. found -->
  409. <str name="f.content.hl.alternateField">teaser</str>
  410. <str name="f.content.hl.maxAlternateFieldLength">256</str>
  411. <!-- JS: I wasn't getting good results here... I'm turning off for now
  412. because I was getting periods (.) by themselves at the beginning of
  413. snippets and don't feel like debugging anymore. Without the regex is
  414. faster too -->
  415. <!--<str name="f.content.hl.fragmenter">regex</str>--> <!-- defined below -->
  416. <!-- By default, don't spell check -->
  417. <str name="spellcheck">false</str>
  418. <!-- Defaults for the spell checker when used -->
  419. <str name="spellcheck.onlyMorePopular">true</str>
  420. <str name="spellcheck.extendedResults">false</str>
  421. <!-- The number of suggestions to return -->
  422. <str name="spellcheck.count">1</str>
  423. </lst>
  424. <arr name="last-components">
  425. <str>spellcheck</str>
  426. </arr>
  427. </requestHandler>
  428. <!-- The more like this handler offers many advantages over the standard handler,
  429. when performing moreLikeThis requests.-->
  430. <requestHandler name="mlt" class="solr.MoreLikeThisHandler">
  431. <lst name="defaults">
  432. <str name="mlt.mintf">1</str>
  433. <str name="mlt.mindf">1</str>
  434. <str name="mlt.minwl">3</str>
  435. <str name="mlt.maxwl">15</str>
  436. <str name="mlt.maxqt">20</str>
  437. <str name="mlt.match.include">false</str>
  438. <!-- Abort any searches longer than 1.5 seconds -->
  439. <!-- <int name="timeAllowed">1500</int> -->
  440. </lst>
  441. </requestHandler>
  442. <!--
  443. Search components are registered to SolrCore and used by Search Handlers
  444. By default, the following components are avaliable:
  445. <searchComponent name="query" class="org.apache.solr.handler.component.QueryComponent" />
  446. <searchComponent name="facet" class="org.apache.solr.handler.component.FacetComponent" />
  447. <searchComponent name="mlt" class="org.apache.solr.handler.component.MoreLikeThisComponent" />
  448. <searchComponent name="highlight" class="org.apache.solr.handler.component.HighlightComponent" />
  449. <searchComponent name="stats" class="org.apache.solr.handler.component.StatsComponent" />
  450. <searchComponent name="debug" class="org.apache.solr.handler.component.DebugComponent" />
  451. Default configuration in a requestHandler would look like:
  452. <arr name="components">
  453. <str>query</str>
  454. <str>facet</str>
  455. <str>mlt</str>
  456. <str>highlight</str>
  457. <str>stats</str>
  458. <str>debug</str>
  459. </arr>
  460. If you register a searchComponent to one of the standard names, that will be used instead.
  461. To insert components before or after the 'standard' components, use:
  462. <arr name="first-components">
  463. <str>myFirstComponentName</str>
  464. </arr>
  465. <arr name="last-components">
  466. <str>myLastComponentName</str>
  467. </arr>
  468. -->
  469. <!-- The spell check component can return a list of alternative spelling
  470. suggestions. -->
  471. <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
  472. <str name="queryAnalyzerFieldType">textSpell</str>
  473. <lst name="spellchecker">
  474. <str name="name">default</str>
  475. <str name="field">spell</str>
  476. <str name="spellcheckIndexDir">./spellchecker1</str>
  477. <str name="buildOnOptimize">true</str>
  478. </lst>
  479. <lst name="spellchecker">
  480. <str name="name">jarowinkler</str>
  481. <str name="field">spell</str>
  482. <!-- Use a different Distance Measure -->
  483. <str name="distanceMeasure">org.apache.lucene.search.spell.JaroWinklerDistance</str>
  484. <str name="spellcheckIndexDir">./spellchecker2</str>
  485. <str name="buildOnOptimize">true</str>
  486. </lst>
  487. </searchComponent>
  488. <queryConverter name="queryConverter" class="solr.SpellingQueryConverter"/>
  489. <!-- a search component that enables you to configure the top results for
  490. a given query regardless of the normal lucene scoring.-->
  491. <searchComponent name="elevator" class="solr.QueryElevationComponent" >
  492. <!-- pick a fieldType to analyze queries -->
  493. <str name="queryFieldType">string</str>
  494. <str name="config-file">elevate.xml</str>
  495. </searchComponent>
  496. <!-- a request handler utilizing the elevator component -->
  497. <requestHandler name="/elevate" class="solr.SearchHandler" startup="lazy">
  498. <lst name="defaults">
  499. <str name="echoParams">explicit</str>
  500. </lst>
  501. <arr name="last-components">
  502. <str>elevator</str>
  503. </arr>
  504. </requestHandler>
  505. <!-- Update request handler.
  506. Note: Since solr1.1 requestHandlers requires a valid content type header if posted in
  507. the body. For example, curl now requires: -H 'Content-type:text/xml; charset=utf-8'
  508. The response format differs from solr1.1 formatting and returns a standard error code.
  509. To enable solr1.1 behavior, remove the /update handler or change its path
  510. -->
  511. <requestHandler name="/update" class="solr.XmlUpdateRequestHandler" />
  512. <!--
  513. Analysis request handler. Since Solr 1.3. Use to returnhow a document is analyzed. Useful
  514. for debugging and as a token server for other types of applications
  515. -->
  516. <requestHandler name="/analysis" class="solr.AnalysisRequestHandler" />
  517. <!-- CSV update handler, loaded on demand -->
  518. <requestHandler name="/update/csv" class="solr.CSVRequestHandler" startup="lazy" />
  519. <!--
  520. Admin Handlers - This will register all the standard admin RequestHandlers. Adding
  521. this single handler is equivalent to registering:
  522. <requestHandler name="/admin/luke" class="org.apache.solr.handler.admin.LukeRequestHandler" />
  523. <requestHandler name="/admin/system" class="org.apache.solr.handler.admin.SystemInfoHandler" />
  524. <requestHandler name="/admin/plugins" class="org.apache.solr.handler.admin.PluginInfoHandler" />
  525. <requestHandler name="/admin/threads" class="org.apache.solr.handler.admin.ThreadDumpHandler" />
  526. <requestHandler name="/admin/properties" class="org.apache.solr.handler.admin.PropertiesRequestHandler" />
  527. <requestHandler name="/admin/file" class="org.apache.solr.handler.admin.ShowFileRequestHandler" >
  528. If you wish to hide files under ${solr.home}/conf, explicitly register the ShowFileRequestHandler using:
  529. <requestHandler name="/admin/file" class="org.apache.solr.handler.admin.ShowFileRequestHandler" >
  530. <lst name="invariants">
  531. <str name="hidden">synonyms.txt</str>
  532. <str name="hidden">anotherfile.txt</str>
  533. </lst>
  534. </requestHandler>
  535. -->
  536. <requestHandler name="/admin/" class="org.apache.solr.handler.admin.AdminHandlers" />
  537. <!-- ping/healthcheck -->
  538. <requestHandler name="/admin/ping" class="PingRequestHandler">
  539. <lst name="defaults">
  540. <str name="qt">standard</str>
  541. <str name="q">solrpingquery</str>
  542. <str name="echoParams">all</str>
  543. </lst>
  544. </requestHandler>
  545. <!-- Files that are needed to start the service -->
  546. <requestHandler name="/admin/file" class="org.apache.solr.handler.admin.ShowFileRequestHandler" >
  547. <lst name="invariants">
  548. <str name="hidden">admin-extra.html</str>
  549. <str name="hidden">scripts.conf</str>
  550. <str name="hidden">xslt/example.xsl</str>
  551. <str name="hidden">xslt/example_atom.xsl</str>
  552. <str name="hidden">xslt/example_rss.xsl</str>
  553. <str name="hidden">xslt/luke.xsl</str>
  554. </lst>
  555. </requestHandler>
  556. <!-- Echo the request contents back to the client -->
  557. <requestHandler name="/debug/dump" class="solr.DumpRequestHandler" >
  558. <lst name="defaults">
  559. <str name="echoParams">explicit</str> <!-- for all params (including the default etc) use: 'all' -->
  560. <str name="echoHandler">true</str>
  561. </lst>
  562. </requestHandler>
  563. <highlighting>
  564. <!-- Configure the standard fragmenter -->
  565. <!-- This could most likely be commented out in the "default" case -->
  566. <fragmenter name="gap" class="org.apache.solr.highlight.GapFragmenter" default="true">
  567. <lst name="defaults">
  568. <int name="hl.fragsize">100</int>
  569. </lst>
  570. </fragmenter>
  571. <!-- A regular-expression-based fragmenter (f.i., for sentence extraction) -->
  572. <fragmenter name="regex" class="org.apache.solr.highlight.RegexFragmenter">
  573. <lst name="defaults">
  574. <!-- slightly smaller fragsizes work better because of slop -->
  575. <int name="hl.fragsize">70</int>
  576. <!-- allow 50% slop on fragment sizes -->
  577. <float name="hl.regex.slop">0.5</float>
  578. <!-- a basic sentence pattern -->
  579. <str name="hl.regex.pattern">[-\w ,/\n\"']{20,200}</str>
  580. </lst>
  581. </fragmenter>
  582. <!-- Configure the standard formatter -->
  583. <formatter name="html" class="org.apache.solr.highlight.HtmlFormatter" default="true">
  584. <lst name="defaults">
  585. <str name="hl.simple.pre"><![CDATA[<strong>]]></str>
  586. <str name="hl.simple.post"><![CDATA[</strong>]]></str>
  587. </lst>
  588. </formatter>
  589. </highlighting>
  590. <!-- queryResponseWriter plugins... query responses will be written using the
  591. writer specified by the 'wt' request parameter matching the name of a registered
  592. writer.
  593. The "default" writer is the default and will be used if 'wt' is not specified
  594. in the request. XMLResponseWriter will be used if nothing is specified here.
  595. The json, python, and ruby writers are also available by default.
  596. <queryResponseWriter name="xml" class="org.apache.solr.request.XMLResponseWriter" default="true"/>
  597. <queryResponseWriter name="json" class="org.apache.solr.request.JSONResponseWriter"/>
  598. <queryResponseWriter name="python" class="org.apache.solr.request.PythonResponseWriter"/>
  599. <queryResponseWriter name="ruby" class="org.apache.solr.request.RubyResponseWriter"/>
  600. <queryResponseWriter name="php" class="org.apache.solr.request.PHPResponseWriter"/>
  601. <queryResponseWriter name="phps" class="org.apache.solr.request.PHPSerializedResponseWriter"/>
  602. <queryResponseWriter name="custom" class="com.example.MyResponseWriter"/>
  603. -->
  604. <!-- XSLT response writer transforms the XML output by any xslt file found
  605. in Solr's conf/xslt directory. Changes to xslt files are checked for
  606. every xsltCacheLifetimeSeconds.
  607. -->
  608. <queryResponseWriter name="xslt" class="org.apache.solr.request.XSLTResponseWriter">
  609. <int name="xsltCacheLifetimeSeconds">5</int>
  610. </queryResponseWriter>
  611. <!-- example of registering a query parser
  612. <queryParser name="lucene" class="org.apache.solr.search.LuceneQParserPlugin"/>
  613. -->
  614. <!-- example of registering a custom function parser
  615. <valueSourceParser name="myfunc" class="com.mycompany.MyValueSourceParser" />
  616. -->
  617. <!-- config for the admin interface -->
  618. <admin>
  619. <defaultQuery>solr</defaultQuery>
  620. <!-- configure a healthcheck file for servers behind a loadbalancer
  621. <healthcheck type="file">server-enabled</healthcheck>
  622. -->
  623. </admin>
  624. </config>