solrconfig.xml 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE config [
  3. <!ENTITY extra SYSTEM "solrconfig_extra.xml">
  4. <!ENTITY index SYSTEM "solrconfig_index.xml">
  5. <!ENTITY query SYSTEM "solrconfig_query.xml">
  6. <!ENTITY requestdispatcher SYSTEM "solrconfig_requestdispatcher.xml">
  7. ]>
  8. <!--
  9. For more details about configurations options that may appear in
  10. this file, see http://wiki.apache.org/solr/SolrConfigXml.
  11. -->
  12. <config name="drupal-4.2.1-solr-8.x-0" >
  13. <!-- In all configuration below, a prefix of "solr." for class names
  14. is an alias that causes solr to search appropriate packages,
  15. including org.apache.solr.(search|update|request|core|analysis)
  16. You may also specify a fully qualified Java classname if you
  17. have your own custom plugins.
  18. -->
  19. <!-- Set this to 'false' if you want solr to continue working after
  20. it has encountered an severe configuration error. In a
  21. production environment, you may want solr to keep working even
  22. if one handler is mis-configured.
  23. You may also set this to false using by setting the system
  24. property:
  25. -Dsolr.abortOnConfigurationError=false
  26. -->
  27. <abortOnConfigurationError>${solr.abortOnConfigurationError:true}</abortOnConfigurationError>
  28. <!-- Controls what version of Lucene various components of Solr
  29. adhere to. Generally, you want to use the latest version to
  30. get all bug fixes and improvements. It is highly recommended
  31. that you fully re-index after changing this setting as it can
  32. affect both how text is indexed and queried.
  33. -->
  34. <luceneMatchVersion>${solr.luceneMatchVersion:LUCENE_80}</luceneMatchVersion>
  35. <!-- <lib/> directives can be used to instruct Solr to load any Jars
  36. identified and use them to resolve any "plugins" specified in
  37. your solrconfig.xml or schema.xml (ie: Analyzers, Request
  38. Handlers, etc...).
  39. All directories and paths are resolved relative to the
  40. instanceDir.
  41. Please note that <lib/> directives are processed in the order
  42. that they appear in your solrconfig.xml file, and are "stacked"
  43. on top of each other when building a ClassLoader - so if you have
  44. plugin jars with dependencies on other jars, the "lower level"
  45. dependency jars should be loaded first.
  46. If a "./lib" directory exists in your instanceDir, all files
  47. found in it are included as if you had used the following
  48. syntax...
  49. <lib dir="./lib" />
  50. -->
  51. <!-- A 'dir' option by itself adds any files found in the directory
  52. to the classpath, this is useful for including all jars in a
  53. directory.
  54. When a 'regex' is specified in addition to a 'dir', only the
  55. files in that directory which completely match the regex
  56. (anchored on both ends) will be included.
  57. If a 'dir' option (with or without a regex) is used and nothing
  58. is found that matches, a warning will be logged.
  59. The examples below can be used to load some solr-contribs along
  60. with their external dependencies.
  61. -->
  62. <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-dataimporthandler-.*\.jar" />
  63. <lib dir="${solr.install.dir:../../../..}/contrib/extraction/lib" regex=".*\.jar" />
  64. <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-cell-\d.*\.jar" />
  65. <lib dir="${solr.install.dir:../../../..}/contrib/langid/lib/" regex=".*\.jar" />
  66. <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-langid-\d.*\.jar" />
  67. <lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lib" regex=".*\.jar" />
  68. <lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lucene-libs" regex=".*\.jar" />
  69. <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-analysis-extras-\d.*\.jar" />
  70. <!-- an exact 'path' can be used instead of a 'dir' to specify a
  71. specific jar file. This will cause a serious error to be logged
  72. if it can't be loaded.
  73. -->
  74. <!--
  75. <lib path="../a-jar-that-does-not-exist.jar" />
  76. -->
  77. <!-- Data Directory
  78. Used to specify an alternate directory to hold all index data
  79. other than the default ./data under the Solr home. If
  80. replication is in use, this should match the replication
  81. configuration.
  82. -->
  83. <dataDir>${solr.data.dir:}</dataDir>
  84. <!-- The DirectoryFactory to use for indexes.
  85. solr.StandardDirectoryFactory is filesystem
  86. based and tries to pick the best implementation for the current
  87. JVM and platform. solr.NRTCachingDirectoryFactory, the default,
  88. wraps solr.StandardDirectoryFactory and caches small files in memory
  89. for better NRT performance.
  90. One can force a particular implementation via solr.MMapDirectoryFactory,
  91. solr.NIOFSDirectoryFactory, or solr.SimpleFSDirectoryFactory.
  92. solr.RAMDirectoryFactory is memory based and not persistent.
  93. -->
  94. <directoryFactory name="DirectoryFactory"
  95. class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}">
  96. <!-- These will be used if you are using the solr.HdfsDirectoryFactory,
  97. otherwise they will be ignored. If you don't plan on using hdfs,
  98. you can safely remove this section. -->
  99. <!-- The root directory that collection data should be written to. -->
  100. <str name="solr.hdfs.home">${solr.hdfs.home:}</str>
  101. <!-- The hadoop configuration files to use for the hdfs client. -->
  102. <str name="solr.hdfs.confdir">${solr.hdfs.confdir:}</str>
  103. <!-- Enable/Disable the hdfs cache. -->
  104. <str name="solr.hdfs.blockcache.enabled">${solr.hdfs.blockcache.enabled:true}</str>
  105. <!-- Enable/Disable using one global cache for all SolrCores.
  106. The settings used will be from the first HdfsDirectoryFactory created. -->
  107. <str name="solr.hdfs.blockcache.global">${solr.hdfs.blockcache.global:true}</str>
  108. </directoryFactory>
  109. <!-- The CodecFactory for defining the format of the inverted index.
  110. The default implementation is SchemaCodecFactory, which is the official Lucene
  111. index format, but hooks into the schema to provide per-field customization of
  112. the postings lists and per-document values in the fieldType element
  113. (postingsFormat/docValuesFormat). Note that most of the alternative implementations
  114. are experimental, so if you choose to customize the index format, it's a good
  115. idea to convert back to the official format e.g. via IndexWriter.addIndexes(IndexReader)
  116. before upgrading to a newer version to avoid unnecessary reindexing.
  117. -->
  118. <codecFactory class="solr.SchemaCodecFactory"/>
  119. <!-- To enable dynamic schema REST APIs, remove the following <schemaFactory>.
  120. -->
  121. <schemaFactory class="ClassicIndexSchemaFactory"/>
  122. <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  123. Index Config - These settings control low-level behavior of indexing
  124. Most example settings here show the default value, but are commented
  125. out, to more easily see where customizations have been made.
  126. Note: This replaces <indexDefaults> and <mainIndex> from older versions
  127. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  128. <indexConfig>
  129. <!-- maxFieldLength was removed in 4.0. To get similar behavior, include a
  130. LimitTokenCountFilterFactory in your fieldType definition. E.g.
  131. <filter class="solr.LimitTokenCountFilterFactory" maxTokenCount="10000"/>
  132. -->
  133. <!-- Maximum time to wait for a write lock (ms) for an IndexWriter. Default: 1000 -->
  134. <!-- <writeLockTimeout>1000</writeLockTimeout> -->
  135. <!-- Expert: Enabling compound file will use less files for the index,
  136. using fewer file descriptors on the expense of performance decrease.
  137. Default in Lucene is "true". Default in Solr is "false" (since 3.6) -->
  138. <!-- <useCompoundFile>false</useCompoundFile> -->
  139. <!-- ramBufferSizeMB sets the amount of RAM that may be used by Lucene
  140. indexing for buffering added documents and deletions before they are
  141. flushed to the Directory.
  142. maxBufferedDocs sets a limit on the number of documents buffered
  143. before flushing.
  144. If both ramBufferSizeMB and maxBufferedDocs is set, then
  145. Lucene will flush based on whichever limit is hit first.
  146. The default is 100 MB. -->
  147. <!-- <ramBufferSizeMB>100</ramBufferSizeMB> -->
  148. <!-- <maxBufferedDocs>1000</maxBufferedDocs> -->
  149. <!-- Expert: Merge Policy
  150. The Merge Policy in Lucene controls how merging of segments is done.
  151. The default since Solr/Lucene 3.3 is TieredMergePolicy.
  152. The default since Lucene 2.3 was the LogByteSizeMergePolicy,
  153. Even older versions of Lucene used LogDocMergePolicy.
  154. -->
  155. <!--
  156. <mergePolicyFactory class="solr.TieredMergePolicyFactory">
  157. <int name="maxMergeAtOnce">10</int>
  158. <int name="segmentsPerTier">10</int>
  159. </mergePolicyFactory>
  160. -->
  161. <!-- Expert: Merge Scheduler
  162. The Merge Scheduler in Lucene controls how merges are
  163. performed. The ConcurrentMergeScheduler (Lucene 2.3 default)
  164. can perform merges in the background using separate threads.
  165. The SerialMergeScheduler (Lucene 2.2 default) does not.
  166. -->
  167. <!--
  168. <mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"/>
  169. -->
  170. <!-- LockFactory
  171. This option specifies which Lucene LockFactory implementation
  172. to use.
  173. single = SingleInstanceLockFactory - suggested for a
  174. read-only index or when there is no possibility of
  175. another process trying to modify the index.
  176. native = NativeFSLockFactory - uses OS native file locking.
  177. Do not use when multiple solr webapps in the same
  178. JVM are attempting to share a single index.
  179. simple = SimpleFSLockFactory - uses a plain file for locking
  180. Defaults: 'native' is default for Solr3.6 and later, otherwise
  181. 'simple' is the default
  182. More details on the nuances of each LockFactory...
  183. http://wiki.apache.org/lucene-java/AvailableLockFactories
  184. -->
  185. <lockType>${solr.lock.type:native}</lockType>
  186. <!-- Commit Deletion Policy
  187. Custom deletion policies can be specified here. The class must
  188. implement org.apache.lucene.index.IndexDeletionPolicy.
  189. The default Solr IndexDeletionPolicy implementation supports
  190. deleting index commit points on number of commits, age of
  191. commit point and optimized status.
  192. The latest commit point should always be preserved regardless
  193. of the criteria.
  194. -->
  195. <!--
  196. <deletionPolicy class="solr.SolrDeletionPolicy">
  197. -->
  198. <!-- The number of commit points to be kept -->
  199. <!-- <str name="maxCommitsToKeep">1</str> -->
  200. <!-- The number of optimized commit points to be kept -->
  201. <!-- <str name="maxOptimizedCommitsToKeep">0</str> -->
  202. <!--
  203. Delete all commit points once they have reached the given age.
  204. Supports DateMathParser syntax e.g.
  205. -->
  206. <!--
  207. <str name="maxCommitAge">30MINUTES</str>
  208. <str name="maxCommitAge">1DAY</str>
  209. -->
  210. <!--
  211. </deletionPolicy>
  212. -->
  213. <!-- Lucene Infostream
  214. To aid in advanced debugging, Lucene provides an "InfoStream"
  215. of detailed information when indexing.
  216. Setting the value to true will instruct the underlying Lucene
  217. IndexWriter to write its info stream to solr's log. By default,
  218. this is enabled here, and controlled through log4j2.xml
  219. -->
  220. <infoStream>true</infoStream>
  221. <!-- Let the config generator easily inject additional stuff. -->
  222. &index;
  223. </indexConfig>
  224. <!-- The default high-performance update handler -->
  225. <updateHandler class="solr.DirectUpdateHandler2">
  226. <!-- Enables a transaction log, used for real-time get, durability, and
  227. and solr cloud replica recovery. The log can grow as big as
  228. uncommitted changes to the index, so use of a hard autoCommit
  229. is recommended (see below).
  230. "dir" - the target directory for transaction logs, defaults to the
  231. solr data directory. -->
  232. <updateLog>
  233. <str name="dir">${solr.ulog.dir:}</str>
  234. </updateLog>
  235. <!-- AutoCommit
  236. Perform a hard commit automatically under certain conditions.
  237. Instead of enabling autoCommit, consider using "commitWithin"
  238. when adding documents.
  239. http://wiki.apache.org/solr/UpdateXmlMessages
  240. maxDocs - Maximum number of documents to add since the last
  241. commit before automatically triggering a new commit.
  242. maxTime - Maximum amount of time in ms that is allowed to pass
  243. since a document was added before automatically
  244. triggering a new commit.
  245. openSearcher - if false, the commit causes recent index changes
  246. to be flushed to stable storage, but does not cause a new
  247. searcher to be opened to make those changes visible.
  248. If the updateLog is enabled, then it's highly recommended to
  249. have some sort of hard autoCommit to limit the log size.
  250. -->
  251. <autoCommit>
  252. <maxDocs>${solr.autoCommit.MaxDocs:-1}</maxDocs>
  253. <maxTime>${solr.autoCommit.MaxTime:15000}</maxTime>
  254. <openSearcher>false</openSearcher>
  255. </autoCommit>
  256. <!-- softAutoCommit is like autoCommit except it causes a
  257. 'soft' commit which only ensures that changes are visible
  258. but does not ensure that data is synced to disk. This is
  259. faster and more near-realtime friendly than a hard commit.
  260. -->
  261. <autoSoftCommit>
  262. <maxDocs>${solr.autoSoftCommit.MaxDocs:-1}</maxDocs>
  263. <maxTime>${solr.autoSoftCommit.MaxTime:-1}</maxTime>
  264. </autoSoftCommit>
  265. <!-- Update Related Event Listeners
  266. Various IndexWriter related events can trigger Listeners to
  267. take actions.
  268. postCommit - fired after every commit or optimize command
  269. postOptimize - fired after every optimize command
  270. -->
  271. <!-- The RunExecutableListener executes an external command from a
  272. hook such as postCommit or postOptimize.
  273. exe - the name of the executable to run
  274. dir - dir to use as the current working directory. (default=".")
  275. wait - the calling thread waits until the executable returns.
  276. (default="true")
  277. args - the arguments to pass to the program. (default is none)
  278. env - environment variables to set. (default is none)
  279. -->
  280. <!-- This example shows how RunExecutableListener could be used
  281. with the script based replication...
  282. http://wiki.apache.org/solr/CollectionDistribution
  283. -->
  284. <!--
  285. <listener event="postCommit" class="solr.RunExecutableListener">
  286. <str name="exe">solr/bin/snapshooter</str>
  287. <str name="dir">.</str>
  288. <bool name="wait">true</bool>
  289. <arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
  290. <arr name="env"> <str>MYVAR=val1</str> </arr>
  291. </listener>
  292. -->
  293. </updateHandler>
  294. <!-- IndexReaderFactory
  295. Use the following format to specify a custom IndexReaderFactory,
  296. which allows for alternate IndexReader implementations.
  297. ** Experimental Feature **
  298. Please note - Using a custom IndexReaderFactory may prevent
  299. certain other features from working. The API to
  300. IndexReaderFactory may change without warning or may even be
  301. removed from future releases if the problems cannot be
  302. resolved.
  303. ** Features that may not work with custom IndexReaderFactory **
  304. The ReplicationHandler assumes a disk-resident index. Using a
  305. custom IndexReader implementation may cause incompatibility
  306. with ReplicationHandler and may cause replication to not work
  307. correctly. See SOLR-1366 for details.
  308. -->
  309. <!--
  310. <indexReaderFactory name="IndexReaderFactory" class="package.class">
  311. <str name="someArg">Some Value</str>
  312. </indexReaderFactory >
  313. -->
  314. <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  315. Query section - these settings control query time things like caches
  316. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  317. <query>
  318. <!-- Let the config generator easily inject additional stuff. -->
  319. &query;
  320. <!-- Query Related Event Listeners
  321. Various IndexSearcher related events can trigger Listeners to
  322. take actions.
  323. newSearcher - fired whenever a new searcher is being prepared
  324. and there is a current searcher handling requests (aka
  325. registered). It can be used to prime certain caches to
  326. prevent long request times for certain requests.
  327. firstSearcher - fired whenever a new searcher is being
  328. prepared but there is no current registered searcher to handle
  329. requests or to gain autowarming data from.
  330. -->
  331. <!-- QuerySenderListener takes an array of NamedList and executes a
  332. local query request for each NamedList in sequence.
  333. -->
  334. <listener event="newSearcher" class="solr.QuerySenderListener">
  335. <arr name="queries">
  336. <!--
  337. <lst><str name="q">solr</str><str name="sort">price asc</str></lst>
  338. <lst><str name="q">rocks</str><str name="sort">weight asc</str></lst>
  339. -->
  340. </arr>
  341. </listener>
  342. <listener event="firstSearcher" class="solr.QuerySenderListener">
  343. <arr name="queries">
  344. <lst>
  345. <str name="q">static firstSearcher warming in solrconfig.xml</str>
  346. </lst>
  347. </arr>
  348. </listener>
  349. <!-- Use Cold Searcher
  350. If a search request comes in and there is no current
  351. registered searcher, then immediately register the still
  352. warming searcher and use it. If "false" then all requests
  353. will block until the first searcher is done warming.
  354. -->
  355. <useColdSearcher>false</useColdSearcher>
  356. </query>
  357. <!-- Request Dispatcher
  358. This section contains instructions for how the SolrDispatchFilter
  359. should behave when processing requests for this SolrCore.
  360. -->
  361. <requestDispatcher>
  362. <!-- Request Parsing
  363. These settings indicate how Solr Requests may be parsed, and
  364. what restrictions may be placed on the ContentStreams from
  365. those requests
  366. enableRemoteStreaming - enables use of the stream.file
  367. and stream.url parameters for specifying remote streams.
  368. multipartUploadLimitInKB - specifies the max size (in KiB) of
  369. Multipart File Uploads that Solr will allow in a Request.
  370. formdataUploadLimitInKB - specifies the max size (in KiB) of
  371. form data (application/x-www-form-urlencoded) sent via
  372. POST. You can use POST to pass request parameters not
  373. fitting into the URL.
  374. addHttpRequestToContext - if set to true, it will instruct
  375. the requestParsers to include the original HttpServletRequest
  376. object in the context map of the SolrQueryRequest under the
  377. key "httpRequest". It will not be used by any of the existing
  378. Solr components, but may be useful when developing custom
  379. plugins.
  380. *** WARNING ***
  381. Before enabling remote streaming, you should make sure your
  382. system has authentication enabled.
  383. <requestParsers enableRemoteStreaming="false"
  384. multipartUploadLimitInKB="-1"
  385. formdataUploadLimitInKB="-1"
  386. addHttpRequestToContext="false"/>
  387. -->
  388. <!-- Let the config generator easily inject additional stuff. -->
  389. &requestdispatcher;
  390. </requestDispatcher>
  391. <!-- Search Components
  392. Search components are registered to SolrCore and used by
  393. instances of SearchHandler (which can access them by name)
  394. By default, the following components are available:
  395. <searchComponent name="query" class="solr.QueryComponent" />
  396. <searchComponent name="facet" class="solr.FacetComponent" />
  397. <searchComponent name="mlt" class="solr.MoreLikeThisComponent" />
  398. <searchComponent name="highlight" class="solr.HighlightComponent" />
  399. <searchComponent name="stats" class="solr.StatsComponent" />
  400. <searchComponent name="debug" class="solr.DebugComponent" />
  401. Default configuration in a requestHandler would look like:
  402. <arr name="components">
  403. <str>query</str>
  404. <str>facet</str>
  405. <str>mlt</str>
  406. <str>highlight</str>
  407. <str>stats</str>
  408. <str>debug</str>
  409. </arr>
  410. If you register a searchComponent to one of the standard names,
  411. that will be used instead of the default.
  412. To insert components before or after the 'standard' components, use:
  413. <arr name="first-components">
  414. <str>myFirstComponentName</str>
  415. </arr>
  416. <arr name="last-components">
  417. <str>myLastComponentName</str>
  418. </arr>
  419. NOTE: The component registered with the name "debug" will
  420. always be executed after the "last-components"
  421. -->
  422. <!-- Following is a dynamic way to include other components or any customized solrconfig.xml stuff, added by other contrib modules -->
  423. &extra;
  424. <!-- Highlighting Component
  425. http://wiki.apache.org/solr/HighlightingParameters
  426. -->
  427. <searchComponent class="solr.HighlightComponent" name="highlight">
  428. <highlighting>
  429. <!-- Configure the standard fragmenter -->
  430. <!-- This could most likely be commented out in the "default" case -->
  431. <fragmenter name="gap"
  432. default="true"
  433. class="solr.highlight.GapFragmenter">
  434. <lst name="defaults">
  435. <int name="hl.fragsize">100</int>
  436. </lst>
  437. </fragmenter>
  438. <!-- A regular-expression-based fragmenter
  439. (for sentence extraction)
  440. -->
  441. <fragmenter name="regex"
  442. class="solr.highlight.RegexFragmenter">
  443. <lst name="defaults">
  444. <!-- slightly smaller fragsizes work better because of slop -->
  445. <int name="hl.fragsize">70</int>
  446. <!-- allow 50% slop on fragment sizes -->
  447. <float name="hl.regex.slop">0.5</float>
  448. <!-- a basic sentence pattern -->
  449. <str name="hl.regex.pattern">[-\w ,/\n\&quot;&apos;]{20,200}</str>
  450. </lst>
  451. </fragmenter>
  452. <!-- Configure the standard formatter -->
  453. <formatter name="html"
  454. default="true"
  455. class="solr.highlight.HtmlFormatter">
  456. <lst name="defaults">
  457. <str name="hl.simple.pre"><![CDATA[<em>]]></str>
  458. <str name="hl.simple.post"><![CDATA[</em>]]></str>
  459. </lst>
  460. </formatter>
  461. <!-- Configure the standard encoder -->
  462. <encoder name="html"
  463. class="solr.highlight.HtmlEncoder" />
  464. <!-- Configure the standard fragListBuilder -->
  465. <fragListBuilder name="simple"
  466. class="solr.highlight.SimpleFragListBuilder"/>
  467. <!-- Configure the single fragListBuilder -->
  468. <fragListBuilder name="single"
  469. class="solr.highlight.SingleFragListBuilder"/>
  470. <!-- Configure the weighted fragListBuilder -->
  471. <fragListBuilder name="weighted"
  472. default="true"
  473. class="solr.highlight.WeightedFragListBuilder"/>
  474. <!-- default tag FragmentsBuilder -->
  475. <fragmentsBuilder name="default"
  476. default="true"
  477. class="solr.highlight.ScoreOrderFragmentsBuilder">
  478. <!--
  479. <lst name="defaults">
  480. <str name="hl.multiValuedSeparatorChar">/</str>
  481. </lst>
  482. -->
  483. </fragmentsBuilder>
  484. <!-- multi-colored tag FragmentsBuilder -->
  485. <fragmentsBuilder name="colored"
  486. class="solr.highlight.ScoreOrderFragmentsBuilder">
  487. <lst name="defaults">
  488. <str name="hl.tag.pre"><![CDATA[
  489. <b style="background:yellow">,<b style="background:lawgreen">,
  490. <b style="background:aquamarine">,<b style="background:magenta">,
  491. <b style="background:palegreen">,<b style="background:coral">,
  492. <b style="background:wheat">,<b style="background:khaki">,
  493. <b style="background:lime">,<b style="background:deepskyblue">]]></str>
  494. <str name="hl.tag.post"><![CDATA[</b>]]></str>
  495. </lst>
  496. </fragmentsBuilder>
  497. <boundaryScanner name="default"
  498. default="true"
  499. class="solr.highlight.SimpleBoundaryScanner">
  500. <lst name="defaults">
  501. <str name="hl.bs.maxScan">10</str>
  502. <str name="hl.bs.chars">.,!? &#9;&#10;&#13;</str>
  503. </lst>
  504. </boundaryScanner>
  505. <boundaryScanner name="breakIterator"
  506. class="solr.highlight.BreakIteratorBoundaryScanner">
  507. <lst name="defaults">
  508. <!-- type should be one of CHARACTER, WORD(default), LINE and SENTENCE -->
  509. <str name="hl.bs.type">WORD</str>
  510. <!-- language and country are used when constructing Locale object. -->
  511. <!-- And the Locale object will be used when getting instance of BreakIterator -->
  512. <str name="hl.bs.language">en</str>
  513. <str name="hl.bs.country">US</str>
  514. </lst>
  515. </boundaryScanner>
  516. </highlighting>
  517. </searchComponent>
  518. <!-- Update Processors
  519. Chains of Update Processor Factories for dealing with Update
  520. Requests can be declared, and then used by name in Update
  521. Request Processors
  522. http://wiki.apache.org/solr/UpdateRequestProcessor
  523. -->
  524. <!-- Deduplication
  525. An example dedup update processor that creates the "id" field
  526. on the fly based on the hash code of some other fields. This
  527. example has overwriteDupes set to false since we are using the
  528. id field as the signatureField and Solr will maintain
  529. uniqueness based on that anyway.
  530. -->
  531. <!--
  532. <updateRequestProcessorChain name="dedupe">
  533. <processor class="solr.processor.SignatureUpdateProcessorFactory">
  534. <bool name="enabled">true</bool>
  535. <str name="signatureField">id</str>
  536. <bool name="overwriteDupes">false</bool>
  537. <str name="fields">name,features,cat</str>
  538. <str name="signatureClass">solr.processor.Lookup3Signature</str>
  539. </processor>
  540. <processor class="solr.LogUpdateProcessorFactory" />
  541. <processor class="solr.RunUpdateProcessorFactory" />
  542. </updateRequestProcessorChain>
  543. -->
  544. <!-- Language identification
  545. This example update chain identifies the language of the incoming
  546. documents using the langid contrib. The detected language is
  547. written to field language_s. No field name mapping is done.
  548. The fields used for detection are text, title, subject and description,
  549. making this example suitable for detecting languages form full-text
  550. rich documents injected via ExtractingRequestHandler.
  551. See more about langId at http://wiki.apache.org/solr/LanguageDetection
  552. -->
  553. <!--
  554. <updateRequestProcessorChain name="langid">
  555. <processor class="org.apache.solr.update.processor.TikaLanguageIdentifierUpdateProcessorFactory">
  556. <str name="langid.fl">text,title,subject,description</str>
  557. <str name="langid.langField">language_s</str>
  558. <str name="langid.fallback">en</str>
  559. </processor>
  560. <processor class="solr.LogUpdateProcessorFactory" />
  561. <processor class="solr.RunUpdateProcessorFactory" />
  562. </updateRequestProcessorChain>
  563. -->
  564. <!-- Script update processor
  565. This example hooks in an update processor implemented using JavaScript.
  566. See more about the script update processor at http://wiki.apache.org/solr/ScriptUpdateProcessor
  567. -->
  568. <!--
  569. <updateRequestProcessorChain name="script">
  570. <processor class="solr.StatelessScriptUpdateProcessorFactory">
  571. <str name="script">update-script.js</str>
  572. <lst name="params">
  573. <str name="config_param">example config parameter</str>
  574. </lst>
  575. </processor>
  576. <processor class="solr.RunUpdateProcessorFactory" />
  577. </updateRequestProcessorChain>
  578. -->
  579. <!-- Response Writers
  580. http://wiki.apache.org/solr/QueryResponseWriter
  581. Request responses will be written using the writer specified by
  582. the 'wt' request parameter matching the name of a registered
  583. writer.
  584. The "default" writer is the default and will be used if 'wt' is
  585. not specified in the request.
  586. -->
  587. <!-- The following response writers are implicitly configured unless
  588. overridden...
  589. -->
  590. <!--
  591. <queryResponseWriter name="xml"
  592. default="true"
  593. class="solr.XMLResponseWriter" />
  594. <queryResponseWriter name="json" class="solr.JSONResponseWriter"/>
  595. <queryResponseWriter name="python" class="solr.PythonResponseWriter"/>
  596. <queryResponseWriter name="ruby" class="solr.RubyResponseWriter"/>
  597. <queryResponseWriter name="php" class="solr.PHPResponseWriter"/>
  598. <queryResponseWriter name="phps" class="solr.PHPSerializedResponseWriter"/>
  599. <queryResponseWriter name="csv" class="solr.CSVResponseWriter"/>
  600. <queryResponseWriter name="schema.xml" class="solr.SchemaXmlResponseWriter"/>
  601. -->
  602. <queryResponseWriter name="json" class="solr.JSONResponseWriter">
  603. </queryResponseWriter>
  604. <!--
  605. Custom response writers can be declared as needed...
  606. -->
  607. <!-- The solr.velocity.enabled flag is used by Solr's test cases so that this response writer is not
  608. loaded (causing an error if contrib/velocity has not been built fully) -->
  609. <!--
  610. <queryResponseWriter name="velocity" class="solr.VelocityResponseWriter" startup="lazy">
  611. <str name="template.base.dir">${velocity.template.base.dir:}</str>
  612. </queryResponseWriter>
  613. -->
  614. <!-- XSLT response writer transforms the XML output by any xslt file found
  615. in Solr's conf/xslt directory. Changes to xslt files are checked for
  616. every xsltCacheLifetimeSeconds.
  617. -->
  618. <queryResponseWriter name="xslt" class="solr.XSLTResponseWriter">
  619. <int name="xsltCacheLifetimeSeconds">5</int>
  620. </queryResponseWriter>
  621. <!-- Query Parsers
  622. https://lucene.apache.org/solr/guide/query-syntax-and-parsing.html
  623. Multiple QParserPlugins can be registered by name, and then
  624. used in either the "defType" param for the QueryComponent (used
  625. by SearchHandler) or in LocalParams
  626. -->
  627. <!-- example of registering a query parser -->
  628. <!--
  629. <queryParser name="myparser" class="com.mycompany.MyQParserPlugin"/>
  630. -->
  631. <!-- Function Parsers
  632. http://wiki.apache.org/solr/FunctionQuery
  633. Multiple ValueSourceParsers can be registered by name, and then
  634. used as function names when using the "func" QParser.
  635. -->
  636. <!-- example of registering a custom function parser -->
  637. <!--
  638. <valueSourceParser name="myfunc"
  639. class="com.mycompany.MyValueSourceParser" />
  640. -->
  641. <!-- Document Transformers
  642. http://wiki.apache.org/solr/DocTransformers
  643. -->
  644. <!--
  645. Could be something like:
  646. <transformer name="db" class="com.mycompany.LoadFromDatabaseTransformer" >
  647. <int name="connection">jdbc://....</int>
  648. </transformer>
  649. To add a constant value to all docs, use:
  650. <transformer name="mytrans2" class="org.apache.solr.response.transform.ValueAugmenterFactory" >
  651. <int name="value">5</int>
  652. </transformer>
  653. If you want the user to still be able to change it with _value:something_ use this:
  654. <transformer name="mytrans3" class="org.apache.solr.response.transform.ValueAugmenterFactory" >
  655. <double name="defaultValue">5</double>
  656. </transformer>
  657. If you are using the QueryElevationComponent, you may wish to mark documents that get boosted. The
  658. EditorialMarkerFactory will do exactly that:
  659. <transformer name="qecBooster" class="org.apache.solr.response.transform.EditorialMarkerFactory" />
  660. -->
  661. </config>