Advertisement
Guest User

solr-config.xml

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