Advertisement
Guest User

SolrConfig.xml

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