solrconfig.xml 58 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!--
  3. IBM Confidential
  4. OCO Source Materials
  5. IBM Business Platform: Search
  6. (C) Copyright IBM Corp. 2017, 2022
  7. The source code for this program is not published or otherwise divested of its trade secrets,
  8. irrespective of what has been deposited with the U.S. Copyright Office.
  9. -->
  10. <!--
  11. For more details about configurations options that may appear in
  12. this file, see http://wiki.apache.org/solr/SolrConfigXml.
  13. -->
  14. <config>
  15. <!-- In all configuration below, a prefix of "solr." for class names
  16. is an alias that causes solr to search appropriate packages,
  17. including org.apache.solr.(search|update|request|core|analysis)
  18. You may also specify a fully qualified Java classname if you
  19. have your own custom plugins.
  20. -->
  21. <!-- Controls what version of Lucene various components of Solr
  22. adhere to. Generally, you want to use the latest version to
  23. get all bug fixes and improvements. It is highly recommended
  24. that you fully re-index after changing this setting as it can
  25. affect both how text is indexed and queried.
  26. -->
  27. <luceneMatchVersion>8.11.1</luceneMatchVersion>
  28. <!-- <lib/> directives can be used to instruct Solr to load any Jars
  29. identified and use them to resolve any "plugins" specified in
  30. your solrconfig.xml or schema.xml (ie: Analyzers, Request
  31. Handlers, etc...).
  32. All directories and paths are resolved relative to the
  33. instanceDir.
  34. Please note that <lib/> directives are processed in the order
  35. that they appear in your solrconfig.xml file, and are "stacked"
  36. on top of each other when building a ClassLoader - so if you have
  37. plugin jars with dependencies on other jars, the "lower level"
  38. dependency jars should be loaded first.
  39. If a "./lib" directory exists in your instanceDir, all files
  40. found in it are included as if you had used the following
  41. syntax...
  42. <lib dir="./lib" />
  43. -->
  44. <!-- A 'dir' option by itself adds any files found in the directory
  45. to the classpath, this is useful for including all jars in a
  46. directory.
  47. When a 'regex' is specified in addition to a 'dir', only the
  48. files in that directory which completely match the regex
  49. (anchored on both ends) will be included.
  50. If a 'dir' option (with or without a regex) is used and nothing
  51. is found that matches, a warning will be logged.
  52. The example below can be used to load a solr-contrib along
  53. with their external dependencies.
  54. -->
  55. <lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lucene-libs" regex=".*\.jar" />
  56. <lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lib" regex=".*\.jar" />
  57. <lib dir="${solr.install.dir:../../../..}/contrib/extraction/lib" regex=".*\.jar" />
  58. <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-cell-\d.*\.jar" />
  59. <lib dir="${solr.install.dir:../../../..}/contrib/clustering/lib/" regex=".*\.jar" />
  60. <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-clustering-\d.*\.jar" />
  61. <lib dir="${solr.install.dir:../../../..}/contrib/langid/lib/" regex=".*\.jar" />
  62. <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-langid-\d.*\.jar" />
  63. <lib dir="${solr.install.dir:../../../..}/contrib/ltr/lib/" regex=".*\.jar" />
  64. <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-ltr-\d.*\.jar" />
  65. <lib dir="${solr.install.dir:../../../..}/contrib/velocity/lib" regex=".*\.jar" />
  66. <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-velocity-\d.*\.jar" />
  67. <!-- an exact 'path' can be used instead of a 'dir' to specify a
  68. specific jar file. This will cause a serious error to be logged
  69. if it can't be loaded.
  70. -->
  71. <!--
  72. <lib path="../a-jar-that-does-not-exist.jar" />
  73. -->
  74. <!-- Data Directory
  75. Used to specify an alternate directory to hold all index data
  76. other than the default ./data under the Solr home. If
  77. replication is in use, this should match the replication
  78. configuration.
  79. -->
  80. <dataDir>${solr.data.dir:}</dataDir>
  81. <!-- The DirectoryFactory to use for indexes.
  82. solr.StandardDirectoryFactory is filesystem
  83. based and tries to pick the best implementation for the current
  84. JVM and platform. solr.NRTCachingDirectoryFactory, the default,
  85. wraps solr.StandardDirectoryFactory and caches small files in memory
  86. for better NRT performance.
  87. One can force a particular implementation via solr.MMapDirectoryFactory,
  88. solr.NIOFSDirectoryFactory, or solr.SimpleFSDirectoryFactory.
  89. solr.RAMDirectoryFactory is memory based and not persistent.
  90. -->
  91. <directoryFactory name="DirectoryFactory"
  92. class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}"/>
  93. <!-- The CodecFactory for defining the format of the inverted index.
  94. The default implementation is SchemaCodecFactory, which is the official Lucene
  95. index format, but hooks into the schema to provide per-field customization of
  96. the postings lists and per-document values in the fieldType element
  97. (postingsFormat/docValuesFormat). Note that most of the alternative implementations
  98. are experimental, so if you choose to customize the index format, it's a good
  99. idea to convert back to the official format e.g. via IndexWriter.addIndexes(IndexReader)
  100. before upgrading to a newer version to avoid unnecessary reindexing.
  101. A "compressionMode" string element can be added to <codecFactory> to choose
  102. between the existing compression modes in the default codec: "BEST_SPEED" (default)
  103. or "BEST_COMPRESSION".
  104. -->
  105. <codecFactory class="solr.SchemaCodecFactory"/>
  106. <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  107. Index Config - These settings control low-level behavior of indexing
  108. Most example settings here show the default value, but are commented
  109. out, to more easily see where customizations have been made.
  110. Note: This replaces <indexDefaults> and <mainIndex> from older versions
  111. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  112. <indexConfig>
  113. <!-- maxFieldLength was removed in 4.0. To get similar behavior, include a
  114. LimitTokenCountFilterFactory in your fieldType definition. E.g.
  115. <filter class="solr.LimitTokenCountFilterFactory" maxTokenCount="10000"/>
  116. -->
  117. <!-- Maximum time to wait for a write lock (ms) for an IndexWriter. Default: 1000 -->
  118. <!-- <writeLockTimeout>1000</writeLockTimeout> -->
  119. <!-- Expert: Enabling compound file will use less files for the index,
  120. using fewer file descriptors on the expense of performance decrease.
  121. Default in Lucene is "true". Default in Solr is "false" (since 3.6) -->
  122. <!-- <useCompoundFile>false</useCompoundFile> -->
  123. <!-- ramBufferSizeMB sets the amount of RAM that may be used by Lucene
  124. indexing for buffering added documents and deletions before they are
  125. flushed to the Directory.
  126. maxBufferedDocs sets a limit on the number of documents buffered
  127. before flushing.
  128. If both ramBufferSizeMB and maxBufferedDocs is set, then
  129. Lucene will flush based on whichever limit is hit first. -->
  130. <!-- <ramBufferSizeMB>100</ramBufferSizeMB> -->
  131. <!-- <maxBufferedDocs>1000</maxBufferedDocs> -->
  132. <!-- Expert: ramPerThreadHardLimitMB sets the maximum amount of RAM that can be consumed
  133. per thread before they are flushed. When limit is exceeded, this triggers a forced
  134. flush even if ramBufferSizeMB has not been exceeded.
  135. This is a safety limit to prevent Lucene's DocumentsWriterPerThread from address space
  136. exhaustion due to its internal 32 bit signed integer based memory addressing.
  137. The specified value should be greater than 0 and less than 2048MB. When not specified,
  138. Solr uses Lucene's default value 1945. -->
  139. <!-- <ramPerThreadHardLimitMB>1945</ramPerThreadHardLimitMB> -->
  140. <!-- Expert: Merge Policy
  141. The Merge Policy in Lucene controls how merging of segments is done.
  142. The default since Solr/Lucene 3.3 is TieredMergePolicy.
  143. The default since Lucene 2.3 was the LogByteSizeMergePolicy,
  144. Even older versions of Lucene used LogDocMergePolicy.
  145. -->
  146. <!--
  147. <mergePolicyFactory class="org.apache.solr.index.TieredMergePolicyFactory">
  148. <int name="maxMergeAtOnce">10</int>
  149. <int name="segmentsPerTier">10</int>
  150. <double name="noCFSRatio">0.1</double>
  151. </mergePolicyFactory>
  152. -->
  153. <!-- Expert: Merge Scheduler
  154. The Merge Scheduler in Lucene controls how merges are
  155. performed. The ConcurrentMergeScheduler (Lucene 2.3 default)
  156. can perform merges in the background using separate threads.
  157. The SerialMergeScheduler (Lucene 2.2 default) does not.
  158. -->
  159. <!--
  160. <mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"/>
  161. -->
  162. <!-- LockFactory
  163. This option specifies which Lucene LockFactory implementation
  164. to use.
  165. single = SingleInstanceLockFactory - suggested for a
  166. read-only index or when there is no possibility of
  167. another process trying to modify the index.
  168. native = NativeFSLockFactory - uses OS native file locking.
  169. Do not use when multiple solr webapps in the same
  170. JVM are attempting to share a single index.
  171. simple = SimpleFSLockFactory - uses a plain file for locking
  172. Defaults: 'native' is default for Solr3.6 and later, otherwise
  173. 'simple' is the default
  174. More details on the nuances of each LockFactory...
  175. http://wiki.apache.org/lucene-java/AvailableLockFactories
  176. -->
  177. <lockType>simple</lockType>
  178. <!-- Commit Deletion Policy
  179. Custom deletion policies can be specified here. The class must
  180. implement org.apache.lucene.index.IndexDeletionPolicy.
  181. The default Solr IndexDeletionPolicy implementation supports
  182. deleting index commit points on number of commits, age of
  183. commit point and optimized status.
  184. The latest commit point should always be preserved regardless
  185. of the criteria.
  186. -->
  187. <!--
  188. <deletionPolicy class="solr.SolrDeletionPolicy">
  189. -->
  190. <!-- The number of commit points to be kept -->
  191. <!-- <str name="maxCommitsToKeep">1</str> -->
  192. <!-- The number of optimized commit points to be kept -->
  193. <!-- <str name="maxOptimizedCommitsToKeep">0</str> -->
  194. <!--
  195. Delete all commit points once they have reached the given age.
  196. Supports DateMathParser syntax e.g.
  197. -->
  198. <!--
  199. <str name="maxCommitAge">30MINUTES</str>
  200. <str name="maxCommitAge">1DAY</str>
  201. -->
  202. <!--
  203. </deletionPolicy>
  204. -->
  205. <!-- Lucene Infostream
  206. To aid in advanced debugging, Lucene provides an "InfoStream"
  207. of detailed information when indexing.
  208. Setting The value to true will instruct the underlying Lucene
  209. IndexWriter to write its debugging info the specified file
  210. -->
  211. <infoStream>true</infoStream>
  212. </indexConfig>
  213. <!-- JMX
  214. This example enables JMX if and only if an existing MBeanServer
  215. is found, use this if you want to configure JMX through JVM
  216. parameters. Remove this to disable exposing Solr configuration
  217. and statistics to JMX.
  218. For more details see http://wiki.apache.org/solr/SolrJmx
  219. -->
  220. <jmx />
  221. <!-- If you want to connect to a particular server, specify the
  222. agentId
  223. -->
  224. <!-- <jmx agentId="myAgent" /> -->
  225. <!-- If you want to start a new MBeanServer, specify the serviceUrl -->
  226. <!-- <jmx serviceUrl="service:jmx:rmi:///jndi/rmi://localhost:9999/solr"/>
  227. -->
  228. <!-- The default high-performance update handler -->
  229. <updateHandler class="solr.DirectUpdateHandler2">
  230. <!-- Enables a transaction log, used for real-time get, durability, and
  231. and solr cloud replica recovery. The log can grow as big as
  232. uncommitted changes to the index, so use of a hard autoCommit
  233. is recommended (see below).
  234. "dir" - the target directory for transaction logs, defaults to the
  235. solr data directory.
  236. "numVersionBuckets" - sets the number of buckets used to keep
  237. track of max version values when checking for re-ordered
  238. updates; increase this value to reduce the cost of
  239. synchronizing access to version buckets during high-volume
  240. indexing, this requires 8 bytes (long) * numVersionBuckets
  241. of heap space per Solr core.
  242. -->
  243. <!-- AutoCommit
  244. Perform a hard commit automatically under certain conditions.
  245. Instead of enabling autoCommit, consider using "commitWithin"
  246. when adding documents.
  247. http://wiki.apache.org/solr/UpdateXmlMessages
  248. maxDocs - Maximum number of documents to add since the last
  249. commit before automatically triggering a new commit.
  250. maxTime - Maximum amount of time in ms that is allowed to pass
  251. since a document was added before automatically
  252. triggering a new commit.
  253. openSearcher - if false, the commit causes recent index changes
  254. to be flushed to stable storage, but does not cause a new
  255. searcher to be opened to make those changes visible.
  256. If the updateLog is enabled, then it's highly recommended to
  257. have some sort of hard autoCommit to limit the log size.
  258. -->
  259. <autoCommit>
  260. <maxTime>${solr.autoCommit.maxTime:15000}</maxTime>
  261. <openSearcher>false</openSearcher>
  262. </autoCommit>
  263. <!-- softAutoCommit is like autoCommit except it causes a
  264. 'soft' commit which only ensures that changes are visible
  265. but does not ensure that data is synced to disk. This is
  266. faster and more near-realtime friendly than a hard commit.
  267. -->
  268. <autoSoftCommit>
  269. <maxTime>${solr.autoSoftCommit.maxTime:-1}</maxTime>
  270. </autoSoftCommit>
  271. <!-- Update Related Event Listeners
  272. Various IndexWriter related events can trigger Listeners to
  273. take actions.
  274. postCommit - fired after every commit or optimize command
  275. postOptimize - fired after every optimize command
  276. -->
  277. </updateHandler>
  278. <!-- IndexReaderFactory
  279. Use the following format to specify a custom IndexReaderFactory,
  280. which allows for alternate IndexReader implementations.
  281. ** Experimental Feature **
  282. Please note - Using a custom IndexReaderFactory may prevent
  283. certain other features from working. The API to
  284. IndexReaderFactory may change without warning or may even be
  285. removed from future releases if the problems cannot be
  286. resolved.
  287. ** Features that may not work with custom IndexReaderFactory **
  288. The ReplicationHandler assumes a disk-resident index. Using a
  289. custom IndexReader implementation may cause incompatibility
  290. with ReplicationHandler and may cause replication to not work
  291. correctly. See SOLR-1366 for details.
  292. -->
  293. <!--
  294. <indexReaderFactory name="IndexReaderFactory" class="package.class">
  295. <str name="someArg">Some Value</str>
  296. </indexReaderFactory >
  297. -->
  298. <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  299. Query section - these settings control query time things like caches
  300. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  301. <query>
  302. <!-- Maximum number of clauses allowed when parsing a boolean query string.
  303. This limit only impacts boolean queries specified by a user as part of a query string,
  304. and provides per-collection controls on how complex user specified boolean queries can
  305. be. Query strings that specify more clauses then this will result in an error.
  306. If this per-collection limit is greater then the global `maxBooleanClauses` limit
  307. specified in `solr.xml`, it will have no effect, as that setting also limits the size
  308. of user specified boolean queries.
  309. This parameter is now globally defined in the solr.xml.
  310. <maxBooleanClauses>60000</maxBooleanClauses>
  311. -->
  312. <!-- Slow Query Threshold (in millis)
  313. At high request rates, logging all requests can become a bottleneck
  314. and therefore INFO logging is often turned off. However, it is still
  315. useful to be able to set a latency threshold above which a request
  316. is considered "slow" and log that request at WARN level so we can
  317. easily identify slow queries.
  318. -->
  319. <slowQueryThresholdMillis>-1</slowQueryThresholdMillis>
  320. <!-- Solr Internal Query Caches
  321. There are four implementations of cache available for Solr:
  322. LRUCache, based on a synchronized LinkedHashMap,
  323. LFUCache and FastLRUCache, based on a ConcurrentHashMap, and CaffeineCache -
  324. a modern and robust cache implementation. Note that in Solr 9.0
  325. only CaffeineCache will be available, other implementations are now
  326. deprecated.
  327. FastLRUCache has faster gets and slower puts in single
  328. threaded operation and thus is generally faster than LRUCache
  329. when the hit ratio of the cache is high (> 75%), and may be
  330. faster under other scenarios on multi-cpu systems.
  331. -->
  332. <!-- Filter Cache
  333. Cache used by SolrIndexSearcher for filters (DocSets),
  334. unordered sets of *all* documents that match a query. When a
  335. new searcher is opened, its caches may be prepopulated or
  336. "autowarmed" using data from caches in the old searcher.
  337. autowarmCount is the number of items to prepopulate. For
  338. LRUCache, the autowarmed items will be the most recently
  339. accessed items.
  340. Parameters:
  341. class - the SolrCache implementation LRUCache or
  342. (LRUCache or FastLRUCache)
  343. size - the maximum number of entries in the cache
  344. initialSize - the initial capacity (number of entries) of
  345. the cache. (see java.util.HashMap)
  346. autowarmCount - the number of entries to prepopulate from
  347. and old cache.
  348. maxRamMB - the maximum amount of RAM (in MB) that this cache is allowed
  349. to occupy. Note that when this option is specified, the size
  350. and initialSize parameters are ignored.
  351. -->
  352. <filterCache size="2000"
  353. initialSize="100"
  354. maxIdleTime="120"
  355. autowarmCount="0"/>
  356. <!-- Query Result Cache
  357. Caches results of searches - ordered lists of document ids
  358. (DocList) based on a query, a sort, and the range of documents requested.
  359. Additional supported parameter by LRUCache:
  360. maxRamMB - the maximum amount of RAM (in MB) that this cache is allowed
  361. to occupy
  362. -->
  363. <queryResultCache size="2000"
  364. initialSize="100"
  365. maxIdleTime="120"
  366. autowarmCount="0"/>
  367. <!-- Document Cache
  368. Caches Lucene Document objects (the stored fields for each
  369. document). Since Lucene internal document ids are transient,
  370. this cache will not be autowarmed.
  371. -->
  372. <documentCache size="2000"
  373. initialSize="100"
  374. maxIdleTime="120"
  375. autowarmCount="0"/>
  376. <!-- custom cache currently used by block join -->
  377. <cache name="perSegFilter"
  378. size="1000"
  379. initialSize="100"
  380. maxIdleTime="120"
  381. autowarmCount="0"
  382. regenerator="solr.NoOpRegenerator" />
  383. <!-- Field Value Cache
  384. Cache used to hold field values that are quickly accessible
  385. by document id. The fieldValueCache is created by default
  386. even if not configured here.
  387. -->
  388. <!--
  389. <fieldValueCache class="solr.FastLRUCache"
  390. size="512"
  391. autowarmCount="128"
  392. showItems="32" />
  393. -->
  394. <!-- Feature Values Cache
  395. Cache used by the Learning To Rank (LTR) contrib module.
  396. You will need to set the solr.ltr.enabled system property
  397. when running solr to run with ltr enabled:
  398. -Dsolr.ltr.enabled=true
  399. https://lucene.apache.org/solr/guide/learning-to-rank.html
  400. -->
  401. <cache enable="${solr.ltr.enabled:false}" name="QUERY_DOC_FV"
  402. size="400"
  403. initialSize="200"
  404. autowarmCount="400"
  405. regenerator="solr.search.NoOpRegenerator" />
  406. <!-- Custom Cache
  407. Example of a generic cache. These caches may be accessed by
  408. name through SolrIndexSearcher.getCache(),cacheLookup(), and
  409. cacheInsert(). The purpose is to enable easy caching of
  410. user/application level data. The regenerator argument should
  411. be specified as an implementation of solr.CacheRegenerator
  412. if autowarming is desired.
  413. -->
  414. <!--
  415. <cache name="myUserCache"
  416. class="solr.LRUCache"
  417. size="4096"
  418. initialSize="1024"
  419. autowarmCount="1024"
  420. regenerator="com.mycompany.MyRegenerator"
  421. />
  422. -->
  423. <!-- Lazy Field Loading
  424. If true, stored fields that are not requested will be loaded
  425. lazily. This can result in a significant speed improvement
  426. if the usual case is to not load all stored fields,
  427. especially if the skipped fields are large compressed text
  428. fields.
  429. -->
  430. <enableLazyFieldLoading>true</enableLazyFieldLoading>
  431. <!-- Use Filter For Sorted Query
  432. A possible optimization that attempts to use a filter to
  433. satisfy a search. If the requested sort does not include
  434. score, then the filterCache will be checked for a filter
  435. matching the query. If found, the filter will be used as the
  436. source of document ids, and then the sort will be applied to
  437. that.
  438. For most situations, this will not be useful unless you
  439. frequently get the same search repeatedly with different sort
  440. options, and none of them ever use "score"
  441. -->
  442. <!--
  443. <useFilterForSortedQuery>true</useFilterForSortedQuery>
  444. -->
  445. <!-- Result Window Size
  446. An optimization for use with the queryResultCache. When a search
  447. is requested, a superset of the requested number of document ids
  448. are collected. For example, if a search for a particular query
  449. requests matching documents 10 through 19, and queryWindowSize is 50,
  450. then documents 0 through 49 will be collected and cached. Any further
  451. requests in that range can be satisfied via the cache.
  452. -->
  453. <queryResultWindowSize>20</queryResultWindowSize>
  454. <!-- Maximum number of documents to cache for any entry in the
  455. queryResultCache.
  456. -->
  457. <queryResultMaxDocsCached>20</queryResultMaxDocsCached>
  458. <!-- Query Related Event Listeners
  459. Various IndexSearcher related events can trigger Listeners to
  460. take actions.
  461. newSearcher - fired whenever a new searcher is being prepared
  462. and there is a current searcher handling requests (aka
  463. registered). It can be used to prime certain caches to
  464. prevent long request times for certain requests.
  465. firstSearcher - fired whenever a new searcher is being
  466. prepared but there is no current registered searcher to handle
  467. requests or to gain autowarming data from.
  468. -->
  469. <!-- QuerySenderListener takes an array of NamedList and executes a
  470. local query request for each NamedList in sequence.
  471. -->
  472. <listener event="newSearcher" class="solr.QuerySenderListener">
  473. <arr name="queries">
  474. <!--
  475. <lst><str name="q">solr</str><str name="sort">price asc</str></lst>
  476. <lst><str name="q">rocks</str><str name="sort">weight asc</str></lst>
  477. -->
  478. </arr>
  479. </listener>
  480. <listener event="firstSearcher" class="solr.QuerySenderListener">
  481. <arr name="queries">
  482. <lst>
  483. <str name="q">static firstSearcher warming in solrconfig.xml</str>
  484. </lst>
  485. </arr>
  486. </listener>
  487. <!-- Use Cold Searcher
  488. If a search request comes in and there is no current
  489. registered searcher, then immediately register the still
  490. warming searcher and use it. If "false" then all requests
  491. will block until the first searcher is done warming.
  492. -->
  493. <useColdSearcher>false</useColdSearcher>
  494. </query>
  495. <!-- Request Dispatcher
  496. This section contains instructions for how the SolrDispatchFilter
  497. should behave when processing requests for this SolrCore.
  498. -->
  499. <requestDispatcher>
  500. <!-- Request Parsing
  501. These settings indicate how Solr Requests may be parsed, and
  502. what restrictions may be placed on the ContentStreams from
  503. those requests
  504. enableRemoteStreaming - enables use of the stream.file
  505. and stream.url parameters for specifying remote streams.
  506. multipartUploadLimitInKB - specifies the max size (in KiB) of
  507. Multipart File Uploads that Solr will allow in a Request.
  508. formdataUploadLimitInKB - specifies the max size (in KiB) of
  509. form data (application/x-www-form-urlencoded) sent via
  510. POST. You can use POST to pass request parameters not
  511. fitting into the URL.
  512. addHttpRequestToContext - if set to true, it will instruct
  513. the requestParsers to include the original HttpServletRequest
  514. object in the context map of the SolrQueryRequest under the
  515. key "httpRequest". It will not be used by any of the existing
  516. Solr components, but may be useful when developing custom
  517. plugins.
  518. *** WARNING ***
  519. Before enabling remote streaming, you should make sure your
  520. system has authentication enabled.
  521. <requestParsers enableRemoteStreaming="false"
  522. multipartUploadLimitInKB="-1"
  523. formdataUploadLimitInKB="-1"
  524. addHttpRequestToContext="false"/>
  525. -->
  526. <!-- HTTP Caching
  527. Set HTTP caching related parameters (for proxy caches and clients).
  528. The options below instruct Solr not to output any HTTP Caching
  529. related headers
  530. -->
  531. <httpCaching never304="true" />
  532. <!-- If you include a <cacheControl> directive, it will be used to
  533. generate a Cache-Control header (as well as an Expires header
  534. if the value contains "max-age=")
  535. By default, no Cache-Control header is generated.
  536. You can use the <cacheControl> option even if you have set
  537. never304="true"
  538. -->
  539. <!--
  540. <httpCaching never304="true" >
  541. <cacheControl>max-age=30, public</cacheControl>
  542. </httpCaching>
  543. -->
  544. <!-- To enable Solr to respond with automatically generated HTTP
  545. Caching headers, and to response to Cache Validation requests
  546. correctly, set the value of never304="false"
  547. This will cause Solr to generate Last-Modified and ETag
  548. headers based on the properties of the Index.
  549. The following options can also be specified to affect the
  550. values of these headers...
  551. lastModFrom - the default value is "openTime" which means the
  552. Last-Modified value (and validation against If-Modified-Since
  553. requests) will all be relative to when the current Searcher
  554. was opened. You can change it to lastModFrom="dirLastMod" if
  555. you want the value to exactly correspond to when the physical
  556. index was last modified.
  557. etagSeed="..." is an option you can change to force the ETag
  558. header (and validation against If-None-Match requests) to be
  559. different even if the index has not changed (ie: when making
  560. significant changes to your config file)
  561. (lastModifiedFrom and etagSeed are both ignored if you use
  562. the never304="true" option)
  563. -->
  564. <!--
  565. <httpCaching lastModifiedFrom="openTime"
  566. etagSeed="Solr">
  567. <cacheControl>max-age=30, public</cacheControl>
  568. </httpCaching>
  569. -->
  570. </requestDispatcher>
  571. <!-- Request Handlers
  572. http://wiki.apache.org/solr/SolrRequestHandler
  573. Incoming queries will be dispatched to a specific handler by name
  574. based on the path specified in the request.
  575. If a Request Handler is declared with startup="lazy", then it will
  576. not be initialized until the first request that uses it.
  577. -->
  578. <!-- SearchHandler
  579. http://wiki.apache.org/solr/SearchHandler
  580. For processing Search Queries, the primary Request Handler
  581. provided with Solr is "SearchHandler" It delegates to a sequent
  582. of SearchComponents (see below) and supports distributed
  583. queries across multiple shards
  584. -->
  585. <requestHandler name="/select" class="solr.SearchHandler">
  586. <!-- default values for query parameters can be specified, these
  587. will be overridden by parameters in the request
  588. -->
  589. <lst name="defaults">
  590. <str name="echoParams">explicit</str>
  591. <int name="rows">10</int>
  592. <!-- Default search field
  593. <str name="df">text</str>
  594. -->
  595. <!-- Change from JSON to XML format (the default prior to Solr 7.0)
  596. <str name="wt">xml</str>
  597. -->
  598. <!-- Controls the distribution of a query to shards other than itself.
  599. Consider making 'preferLocalShards' true when:
  600. 1) maxShardsPerNode > 1
  601. 2) Number of shards > 1
  602. 3) CloudSolrClient or LbHttpSolrServer is used by clients.
  603. Without this option, every core broadcasts the distributed query to
  604. a replica of each shard where the replicas are chosen randomly.
  605. This option directs the cores to prefer cores hosted locally, thus
  606. preventing network delays between machines.
  607. This behavior also immunizes a bad/slow machine from slowing down all
  608. the good machines (if those good machines were querying this bad one).
  609. Specify this option=false for clients connecting through HttpSolrServer
  610. -->
  611. <bool name="preferLocalShards">false</bool>
  612. </lst>
  613. <!-- In addition to defaults, "appends" params can be specified
  614. to identify values which should be appended to the list of
  615. multi-val params from the query (or the existing "defaults").
  616. -->
  617. <!-- In this example, the param "fq=instock:true" would be appended to
  618. any query time fq params the user may specify, as a mechanism for
  619. partitioning the index, independent of any user selected filtering
  620. that may also be desired (perhaps as a result of faceted searching).
  621. NOTE: there is *absolutely* nothing a client can do to prevent these
  622. "appends" values from being used, so don't use this mechanism
  623. unless you are sure you always want it.
  624. -->
  625. <!--
  626. <lst name="appends">
  627. <str name="fq">inStock:true</str>
  628. </lst>
  629. -->
  630. <!-- "invariants" are a way of letting the Solr maintainer lock down
  631. the options available to Solr clients. Any params values
  632. specified here are used regardless of what values may be specified
  633. in either the query, the "defaults", or the "appends" params.
  634. In this example, the facet.field and facet.query params would
  635. be fixed, limiting the facets clients can use. Faceting is
  636. not turned on by default - but if the client does specify
  637. facet=true in the request, these are the only facets they
  638. will be able to see counts for; regardless of what other
  639. facet.field or facet.query params they may specify.
  640. NOTE: there is *absolutely* nothing a client can do to prevent these
  641. "invariants" values from being used, so don't use this mechanism
  642. unless you are sure you always want it.
  643. -->
  644. <!--
  645. <lst name="invariants">
  646. <str name="facet.field">cat</str>
  647. <str name="facet.field">manu_exact</str>
  648. <str name="facet.query">price:[* TO 500]</str>
  649. <str name="facet.query">price:[500 TO *]</str>
  650. </lst>
  651. -->
  652. <!-- If the default list of SearchComponents is not desired, that
  653. list can either be overridden completely, or components can be
  654. prepended or appended to the default list. (see below)
  655. -->
  656. <!--
  657. <arr name="components">
  658. <str>nameOfCustomComponent1</str>
  659. <str>nameOfCustomComponent2</str>
  660. </arr>
  661. -->
  662. </requestHandler>
  663. <!-- A request handler that returns indented JSON by default -->
  664. <requestHandler name="/query" class="solr.SearchHandler">
  665. <lst name="defaults">
  666. <str name="echoParams">explicit</str>
  667. <str name="wt">json</str>
  668. <str name="indent">true</str>
  669. <str name="df">_text_</str>
  670. </lst>
  671. </requestHandler>
  672. <!-- A Robust Example
  673. This example SearchHandler declaration shows off usage of the
  674. SearchHandler with many defaults declared
  675. Note that multiple instances of the same Request Handler
  676. (SearchHandler) can be registered multiple times with different
  677. names (and different init parameters)
  678. -->
  679. <requestHandler name="/browse" class="solr.SearchHandler">
  680. <lst name="defaults">
  681. <str name="echoParams">explicit</str>
  682. <!-- VelocityResponseWriter settings -->
  683. <str name="wt">velocity</str>
  684. <str name="v.template">browse</str>
  685. <str name="v.layout">layout</str>
  686. <str name="title">Solritas</str>
  687. <!-- Query settings -->
  688. <str name="defType">edismax</str>
  689. <str name="qf">
  690. text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
  691. title^10.0 description^5.0 keywords^5.0 author^2.0 resourcename^1.0
  692. </str>
  693. <str name="mm">100%</str>
  694. <str name="q.alt">*:*</str>
  695. <str name="rows">10</str>
  696. <str name="fl">*,score</str>
  697. <str name="mlt.qf">
  698. text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
  699. title^10.0 description^5.0 keywords^5.0 author^2.0 resourcename^1.0
  700. </str>
  701. <str name="mlt.fl">text,features,name,sku,id,manu,cat,title,description,keywords,author,resourcename</str>
  702. <int name="mlt.count">3</int>
  703. <!-- Faceting defaults -->
  704. <str name="facet">on</str>
  705. <str name="facet.missing">true</str>
  706. <str name="facet.field">cat</str>
  707. <str name="facet.field">manu_exact</str>
  708. <str name="facet.field">content_type</str>
  709. <str name="facet.field">author_s</str>
  710. <str name="facet.query">ipod</str>
  711. <str name="facet.query">GB</str>
  712. <str name="facet.mincount">1</str>
  713. <str name="facet.pivot">cat,inStock</str>
  714. <str name="facet.range.other">after</str>
  715. <str name="facet.range">price</str>
  716. <int name="f.price.facet.range.start">0</int>
  717. <int name="f.price.facet.range.end">600</int>
  718. <int name="f.price.facet.range.gap">50</int>
  719. <str name="facet.range">popularity</str>
  720. <int name="f.popularity.facet.range.start">0</int>
  721. <int name="f.popularity.facet.range.end">10</int>
  722. <int name="f.popularity.facet.range.gap">3</int>
  723. <str name="facet.range">manufacturedate_dt</str>
  724. <str name="f.manufacturedate_dt.facet.range.start">NOW/YEAR-10YEARS</str>
  725. <str name="f.manufacturedate_dt.facet.range.end">NOW</str>
  726. <str name="f.manufacturedate_dt.facet.range.gap">+1YEAR</str>
  727. <str name="f.manufacturedate_dt.facet.range.other">before</str>
  728. <str name="f.manufacturedate_dt.facet.range.other">after</str>
  729. <!-- Highlighting defaults -->
  730. <str name="hl">on</str>
  731. <str name="hl.fl">content features title name</str>
  732. <str name="hl.preserveMulti">true</str>
  733. <str name="hl.encoder">html</str>
  734. <str name="hl.simple.pre">&lt;b&gt;</str>
  735. <str name="hl.simple.post">&lt;/b&gt;</str>
  736. <str name="f.title.hl.fragsize">0</str>
  737. <str name="f.title.hl.alternateField">title</str>
  738. <str name="f.name.hl.fragsize">0</str>
  739. <str name="f.name.hl.alternateField">name</str>
  740. <str name="f.content.hl.snippets">3</str>
  741. <str name="f.content.hl.fragsize">200</str>
  742. <str name="f.content.hl.alternateField">content</str>
  743. <str name="f.content.hl.maxAlternateFieldLength">750</str>
  744. <!-- Spell checking defaults -->
  745. <str name="spellcheck">on</str>
  746. <str name="spellcheck.extendedResults">false</str>
  747. <str name="spellcheck.count">5</str>
  748. <str name="spellcheck.alternativeTermCount">2</str>
  749. <str name="spellcheck.maxResultsForSuggest">5</str>
  750. <str name="spellcheck.collate">true</str>
  751. <str name="spellcheck.collateExtendedResults">true</str>
  752. <str name="spellcheck.maxCollationTries">5</str>
  753. <str name="spellcheck.maxCollations">3</str>
  754. </lst>
  755. <!-- append spellchecking to our list of components -->
  756. <arr name="last-components">
  757. <str>spellcheck</str>
  758. </arr>
  759. </requestHandler>
  760. <initParams path="/update/**,/query,/select,/tvrh,/elevate,/spell,/browse,update">
  761. <lst name="defaults">
  762. <str name="df">_text_</str>
  763. </lst>
  764. </initParams>
  765. <!-- The following are implicitly added
  766. <requestHandler name="/update/json" class="solr.UpdateRequestHandler">
  767. <lst name="invariants">
  768. <str name="stream.contentType">application/json</str>
  769. </lst>
  770. </requestHandler>
  771. <requestHandler name="/update/csv" class="solr.UpdateRequestHandler">
  772. <lst name="invariants">
  773. <str name="stream.contentType">application/csv</str>
  774. </lst>
  775. </requestHandler>
  776. -->
  777. <!-- Solr Cell Update Request Handler
  778. http://wiki.apache.org/solr/ExtractingRequestHandler
  779. -->
  780. <requestHandler name="/update/extract"
  781. startup="lazy"
  782. class="solr.extraction.ExtractingRequestHandler" >
  783. <lst name="defaults">
  784. <str name="lowernames">true</str>
  785. <str name="uprefix">ignored_</str>
  786. <!-- capture link hrefs but ignore div attributes -->
  787. <str name="captureAttr">true</str>
  788. <str name="fmap.a">links</str>
  789. <str name="fmap.div">ignored_</str>
  790. </lst>
  791. </requestHandler>
  792. <!-- Search Components
  793. Search components are registered to SolrCore and used by
  794. instances of SearchHandler (which can access them by name)
  795. By default, the following components are available:
  796. <searchComponent name="query" class="solr.QueryComponent" />
  797. <searchComponent name="facet" class="solr.FacetComponent" />
  798. <searchComponent name="mlt" class="solr.MoreLikeThisComponent" />
  799. <searchComponent name="highlight" class="solr.HighlightComponent" />
  800. <searchComponent name="stats" class="solr.StatsComponent" />
  801. <searchComponent name="debug" class="solr.DebugComponent" />
  802. Default configuration in a requestHandler would look like:
  803. <arr name="components">
  804. <str>query</str>
  805. <str>facet</str>
  806. <str>mlt</str>
  807. <str>highlight</str>
  808. <str>stats</str>
  809. <str>debug</str>
  810. </arr>
  811. If you register a searchComponent to one of the standard names,
  812. that will be used instead of the default.
  813. To insert components before or after the 'standard' components, use:
  814. <arr name="first-components">
  815. <str>myFirstComponentName</str>
  816. </arr>
  817. <arr name="last-components">
  818. <str>myLastComponentName</str>
  819. </arr>
  820. NOTE: The component registered with the name "debug" will
  821. always be executed after the "last-components"
  822. -->
  823. <!-- Spell Check
  824. The spell check component can return a list of alternative spelling
  825. suggestions.
  826. http://wiki.apache.org/solr/SpellCheckComponent
  827. -->
  828. <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
  829. <str name="queryAnalyzerFieldType">text_general</str>
  830. <!-- Multiple "Spell Checkers" can be declared and used by this
  831. component
  832. -->
  833. <!-- a spellchecker built from a field of the main index -->
  834. <lst name="spellchecker">
  835. <str name="name">default</str>
  836. <str name="field">text</str>
  837. <str name="classname">solr.DirectSolrSpellChecker</str>
  838. <!-- the spellcheck distance measure used, the default is the internal levenshtein -->
  839. <str name="distanceMeasure">internal</str>
  840. <!-- minimum accuracy needed to be considered a valid spellcheck suggestion -->
  841. <float name="accuracy">0.5</float>
  842. <!-- the maximum #edits we consider when enumerating terms: can be 1 or 2 -->
  843. <int name="maxEdits">2</int>
  844. <!-- the minimum shared prefix when enumerating terms -->
  845. <int name="minPrefix">1</int>
  846. <!-- maximum number of inspections per result. -->
  847. <int name="maxInspections">5</int>
  848. <!-- minimum length of a query term to be considered for correction -->
  849. <int name="minQueryLength">4</int>
  850. <!-- maximum threshold of documents a query term can appear to be considered for correction -->
  851. <float name="maxQueryFrequency">0.01</float>
  852. <!-- uncomment this to require suggestions to occur in 1% of the documents
  853. <float name="thresholdTokenFrequency">.01</float>
  854. -->
  855. </lst>
  856. <!-- a spellchecker that can break or combine words. See "/spell" handler below for usage -->
  857. <lst name="spellchecker">
  858. <str name="name">wordbreak</str>
  859. <str name="classname">solr.WordBreakSolrSpellChecker</str>
  860. <str name="field">name</str>
  861. <str name="combineWords">true</str>
  862. <str name="breakWords">true</str>
  863. <int name="maxChanges">10</int>
  864. </lst>
  865. </searchComponent>
  866. <!-- A request handler for demonstrating the spellcheck component.
  867. NOTE: This is purely as an example. The whole purpose of the
  868. SpellCheckComponent is to hook it into the request handler that
  869. handles your normal user queries so that a separate request is
  870. not needed to get suggestions.
  871. IN OTHER WORDS, THERE IS REALLY GOOD CHANCE THE SETUP BELOW IS
  872. NOT WHAT YOU WANT FOR YOUR PRODUCTION SYSTEM!
  873. See http://wiki.apache.org/solr/SpellCheckComponent for details
  874. on the request parameters.
  875. -->
  876. <requestHandler name="/spell" class="solr.SearchHandler" startup="lazy">
  877. <lst name="defaults">
  878. <!-- Solr will use suggestions from both the 'default' spellchecker
  879. and from the 'wordbreak' spellchecker and combine them.
  880. collations (re-written queries) can include a combination of
  881. corrections from both spellcheckers -->
  882. <str name="spellcheck.dictionary">default</str>
  883. <str name="spellcheck.dictionary">wordbreak</str>
  884. <str name="spellcheck">on</str>
  885. <str name="spellcheck.extendedResults">true</str>
  886. <str name="spellcheck.count">10</str>
  887. <str name="spellcheck.alternativeTermCount">5</str>
  888. <str name="spellcheck.maxResultsForSuggest">5</str>
  889. <str name="spellcheck.collate">true</str>
  890. <str name="spellcheck.collateExtendedResults">true</str>
  891. <str name="spellcheck.maxCollationTries">10</str>
  892. <str name="spellcheck.maxCollations">5</str>
  893. </lst>
  894. <arr name="last-components">
  895. <str>spellcheck</str>
  896. </arr>
  897. </requestHandler>
  898. <!-- Clustering Component
  899. You'll need to set the solr.clustering.enabled system property
  900. when running solr to run with clustering enabled:
  901. -Dsolr.clustering.enabled=true
  902. https://lucene.apache.org/solr/guide/result-clustering.html
  903. -->
  904. <searchComponent name="clustering"
  905. enable="${solr.clustering.enabled:false}"
  906. class="solr.clustering.ClusteringComponent" >
  907. <!--
  908. Declaration of "engines" (clustering algorithms).
  909. The open source algorithms from Carrot2.org project:
  910. * org.carrot2.clustering.lingo.LingoClusteringAlgorithm
  911. * org.carrot2.clustering.stc.STCClusteringAlgorithm
  912. * org.carrot2.clustering.kmeans.BisectingKMeansClusteringAlgorithm
  913. See http://project.carrot2.org/algorithms.html for more information.
  914. Commercial algorithm Lingo3G (needs to be installed separately):
  915. * com.carrotsearch.lingo3g.Lingo3GClusteringAlgorithm
  916. -->
  917. <lst name="engine">
  918. <str name="name">lingo3g</str>
  919. <bool name="optional">true</bool>
  920. <str name="carrot.algorithm">com.carrotsearch.lingo3g.Lingo3GClusteringAlgorithm</str>
  921. <str name="carrot.resourcesDir">clustering/carrot2</str>
  922. </lst>
  923. <lst name="engine">
  924. <str name="name">lingo</str>
  925. <str name="carrot.algorithm">org.carrot2.clustering.lingo.LingoClusteringAlgorithm</str>
  926. <str name="carrot.resourcesDir">clustering/carrot2</str>
  927. </lst>
  928. <lst name="engine">
  929. <str name="name">stc</str>
  930. <str name="carrot.algorithm">org.carrot2.clustering.stc.STCClusteringAlgorithm</str>
  931. <str name="carrot.resourcesDir">clustering/carrot2</str>
  932. </lst>
  933. <lst name="engine">
  934. <str name="name">kmeans</str>
  935. <str name="carrot.algorithm">org.carrot2.clustering.kmeans.BisectingKMeansClusteringAlgorithm</str>
  936. <str name="carrot.resourcesDir">clustering/carrot2</str>
  937. </lst>
  938. </searchComponent>
  939. <!-- A request handler for demonstrating the clustering component.
  940. This is meant as an example.
  941. In reality you will likely want to add the component to your
  942. already specified request handlers.
  943. -->
  944. <requestHandler name="/clustering"
  945. startup="lazy"
  946. enable="${solr.clustering.enabled:false}"
  947. class="solr.SearchHandler">
  948. <lst name="defaults">
  949. <bool name="clustering">true</bool>
  950. <bool name="clustering.results">true</bool>
  951. <!-- Field name with the logical "title" of a each document (optional) -->
  952. <str name="carrot.title">name</str>
  953. <!-- Field name with the logical "URL" of a each document (optional) -->
  954. <str name="carrot.url">id</str>
  955. <!-- Field name with the logical "content" of a each document (optional) -->
  956. <str name="carrot.snippet">features</str>
  957. <!-- Apply highlighter to the title/ content and use this for clustering. -->
  958. <bool name="carrot.produceSummary">true</bool>
  959. <!-- the maximum number of labels per cluster -->
  960. <!--<int name="carrot.numDescriptions">5</int>-->
  961. <!-- produce sub clusters -->
  962. <bool name="carrot.outputSubClusters">false</bool>
  963. <!-- Configure the remaining request handler parameters. -->
  964. <str name="defType">edismax</str>
  965. <str name="qf">
  966. text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
  967. </str>
  968. <str name="q.alt">*:*</str>
  969. <str name="rows">100</str>
  970. <str name="fl">*,score</str>
  971. </lst>
  972. <arr name="last-components">
  973. <str>clustering</str>
  974. </arr>
  975. </requestHandler>
  976. <!-- Terms Component
  977. http://wiki.apache.org/solr/TermsComponent
  978. A component to return terms and document frequency of those
  979. terms
  980. -->
  981. <searchComponent name="terms" class="solr.TermsComponent"/>
  982. <!-- A request handler for demonstrating the terms component -->
  983. <requestHandler name="/terms" class="solr.SearchHandler" startup="lazy">
  984. <lst name="defaults">
  985. <bool name="terms">true</bool>
  986. <bool name="distrib">false</bool>
  987. </lst>
  988. <arr name="components">
  989. <str>terms</str>
  990. </arr>
  991. </requestHandler>
  992. <!-- Highlighting Component
  993. http://wiki.apache.org/solr/HighlightingParameters
  994. -->
  995. <searchComponent class="solr.HighlightComponent" name="highlight">
  996. <highlighting>
  997. <!-- Configure the standard fragmenter -->
  998. <!-- This could most likely be commented out in the "default" case -->
  999. <fragmenter name="gap"
  1000. default="true"
  1001. class="solr.highlight.GapFragmenter">
  1002. <lst name="defaults">
  1003. <int name="hl.fragsize">100</int>
  1004. </lst>
  1005. </fragmenter>
  1006. <!-- A regular-expression-based fragmenter
  1007. (for sentence extraction)
  1008. -->
  1009. <fragmenter name="regex"
  1010. class="solr.highlight.RegexFragmenter">
  1011. <lst name="defaults">
  1012. <!-- slightly smaller fragsizes work better because of slop -->
  1013. <int name="hl.fragsize">70</int>
  1014. <!-- allow 50% slop on fragment sizes -->
  1015. <float name="hl.regex.slop">0.5</float>
  1016. <!-- a basic sentence pattern -->
  1017. <str name="hl.regex.pattern">[-\w ,/\n\&quot;&apos;]{20,200}</str>
  1018. </lst>
  1019. </fragmenter>
  1020. <!-- Configure the standard formatter -->
  1021. <formatter name="html"
  1022. default="true"
  1023. class="solr.highlight.HtmlFormatter">
  1024. <lst name="defaults">
  1025. <str name="hl.simple.pre"><![CDATA[<em>]]></str>
  1026. <str name="hl.simple.post"><![CDATA[</em>]]></str>
  1027. </lst>
  1028. </formatter>
  1029. <!-- Configure the standard encoder -->
  1030. <encoder name="html"
  1031. class="solr.highlight.HtmlEncoder" />
  1032. <!-- Configure the standard fragListBuilder -->
  1033. <fragListBuilder name="simple"
  1034. class="solr.highlight.SimpleFragListBuilder"/>
  1035. <!-- Configure the single fragListBuilder -->
  1036. <fragListBuilder name="single"
  1037. class="solr.highlight.SingleFragListBuilder"/>
  1038. <!-- Configure the weighted fragListBuilder -->
  1039. <fragListBuilder name="weighted"
  1040. default="true"
  1041. class="solr.highlight.WeightedFragListBuilder"/>
  1042. <!-- default tag FragmentsBuilder -->
  1043. <fragmentsBuilder name="default"
  1044. default="true"
  1045. class="solr.highlight.ScoreOrderFragmentsBuilder">
  1046. <!--
  1047. <lst name="defaults">
  1048. <str name="hl.multiValuedSeparatorChar">/</str>
  1049. </lst>
  1050. -->
  1051. </fragmentsBuilder>
  1052. <!-- multi-colored tag FragmentsBuilder -->
  1053. <fragmentsBuilder name="colored"
  1054. class="solr.highlight.ScoreOrderFragmentsBuilder">
  1055. <lst name="defaults">
  1056. <str name="hl.tag.pre"><![CDATA[
  1057. <b style="background:yellow">,<b style="background:lawgreen">,
  1058. <b style="background:aquamarine">,<b style="background:magenta">,
  1059. <b style="background:palegreen">,<b style="background:coral">,
  1060. <b style="background:wheat">,<b style="background:khaki">,
  1061. <b style="background:lime">,<b style="background:deepskyblue">]]></str>
  1062. <str name="hl.tag.post"><![CDATA[</b>]]></str>
  1063. </lst>
  1064. </fragmentsBuilder>
  1065. <boundaryScanner name="default"
  1066. default="true"
  1067. class="solr.highlight.SimpleBoundaryScanner">
  1068. <lst name="defaults">
  1069. <str name="hl.bs.maxScan">10</str>
  1070. <str name="hl.bs.chars">.,!? &#9;&#10;&#13;</str>
  1071. </lst>
  1072. </boundaryScanner>
  1073. <boundaryScanner name="breakIterator"
  1074. class="solr.highlight.BreakIteratorBoundaryScanner">
  1075. <lst name="defaults">
  1076. <!-- type should be one of CHARACTER, WORD(default), LINE and SENTENCE -->
  1077. <str name="hl.bs.type">WORD</str>
  1078. <!-- language and country are used when constructing Locale object. -->
  1079. <!-- And the Locale object will be used when getting instance of BreakIterator -->
  1080. <str name="hl.bs.language">en</str>
  1081. <str name="hl.bs.country">US</str>
  1082. </lst>
  1083. </boundaryScanner>
  1084. </highlighting>
  1085. </searchComponent>
  1086. <!-- Update Processors
  1087. Chains of Update Processor Factories for dealing with Update
  1088. Requests can be declared, and then used by name in Update
  1089. Request Processors
  1090. http://wiki.apache.org/solr/UpdateRequestProcessor
  1091. -->
  1092. <!-- Deduplication
  1093. An example dedup update processor that creates the "id" field
  1094. on the fly based on the hash code of some other fields. This
  1095. example has overwriteDupes set to false since we are using the
  1096. id field as the signatureField and Solr will maintain
  1097. uniqueness based on that anyway.
  1098. -->
  1099. <!--
  1100. <updateRequestProcessorChain name="dedupe">
  1101. <processor class="solr.processor.SignatureUpdateProcessorFactory">
  1102. <bool name="enabled">true</bool>
  1103. <str name="signatureField">id</str>
  1104. <bool name="overwriteDupes">false</bool>
  1105. <str name="fields">name,features,cat</str>
  1106. <str name="signatureClass">solr.processor.Lookup3Signature</str>
  1107. </processor>
  1108. <processor class="solr.LogUpdateProcessorFactory" />
  1109. <processor class="solr.RunUpdateProcessorFactory" />
  1110. </updateRequestProcessorChain>
  1111. -->
  1112. <!-- Response Writers
  1113. http://wiki.apache.org/solr/QueryResponseWriter
  1114. Request responses will be written using the writer specified by
  1115. the 'wt' request parameter matching the name of a registered
  1116. writer.
  1117. The "default" writer is the default and will be used if 'wt' is
  1118. not specified in the request.
  1119. -->
  1120. <!-- The following response writers are implicitly configured unless
  1121. overridden...
  1122. -->
  1123. <!--
  1124. <queryResponseWriter name="xml"
  1125. default="true"
  1126. class="solr.XMLResponseWriter" />
  1127. <queryResponseWriter name="json" class="solr.JSONResponseWriter"/>
  1128. <queryResponseWriter name="python" class="solr.PythonResponseWriter"/>
  1129. <queryResponseWriter name="ruby" class="solr.RubyResponseWriter"/>
  1130. <queryResponseWriter name="php" class="solr.PHPResponseWriter"/>
  1131. <queryResponseWriter name="phps" class="solr.PHPSerializedResponseWriter"/>
  1132. <queryResponseWriter name="csv" class="solr.CSVResponseWriter"/>
  1133. <queryResponseWriter name="schema.xml" class="solr.SchemaXmlResponseWriter"/>
  1134. -->
  1135. <queryResponseWriter name="json" class="solr.JSONResponseWriter">
  1136. <!-- For the purposes of the tutorial, JSON responses are written as
  1137. plain text so that they are easy to read in *any* browser.
  1138. If you expect a MIME type of "application/json" just remove this override.
  1139. -->
  1140. <str name="content-type">text/plain; charset=UTF-8</str>
  1141. </queryResponseWriter>
  1142. <!-- Query Parsers
  1143. https://lucene.apache.org/solr/guide/query-syntax-and-parsing.html
  1144. Multiple QParserPlugins can be registered by name, and then
  1145. used in either the "defType" param for the QueryComponent (used
  1146. by SearchHandler) or in LocalParams
  1147. -->
  1148. <!-- example of registering a query parser -->
  1149. <!--
  1150. <queryParser name="myparser" class="com.mycompany.MyQParserPlugin"/>
  1151. -->
  1152. <queryParser name="elasticDismax" class="com.ibm.bi.search.solr.queryparser.ElasticSearchDismaxQParserPlugin" runtimeLib="true" version="1" />
  1153. <queryParser name="securedBy" class="com.ibm.bi.search.solr.queryparser.SecurityFilterQParserPlugin" runtimeLib="true" version="1" />
  1154. <queryParser name="cmDocSecurityFilter" class="com.ibm.bi.search.solr.queryparser.CmDocumentVisibilityQParserPlugin" runtimeLib="true" version="1" />
  1155. <!-- Function Parsers
  1156. http://wiki.apache.org/solr/FunctionQuery
  1157. Multiple ValueSourceParsers can be registered by name, and then
  1158. used as function names when using the "func" QParser.
  1159. -->
  1160. <!-- example of registering a custom function parser -->
  1161. <!--
  1162. <valueSourceParser name="myfunc"
  1163. class="com.mycompany.MyValueSourceParser" />
  1164. -->
  1165. <!-- LTR query parser
  1166. You will need to set the solr.ltr.enabled system property
  1167. when running solr to run with ltr enabled:
  1168. -Dsolr.ltr.enabled=true
  1169. https://lucene.apache.org/solr/guide/learning-to-rank.html
  1170. Query parser is used to rerank top docs with a provided model
  1171. -->
  1172. <queryParser enable="${solr.ltr.enabled:false}" name="ltr" class="org.apache.solr.ltr.search.LTRQParserPlugin"/>
  1173. <!-- Document Transformers
  1174. http://wiki.apache.org/solr/DocTransformers
  1175. -->
  1176. <!--
  1177. Could be something like:
  1178. <transformer name="db" class="com.mycompany.LoadFromDatabaseTransformer" >
  1179. <int name="connection">jdbc://....</int>
  1180. </transformer>
  1181. To add a constant value to all docs, use:
  1182. <transformer name="mytrans2" class="org.apache.solr.response.transform.ValueAugmenterFactory" >
  1183. <int name="value">5</int>
  1184. </transformer>
  1185. If you want the user to still be able to change it with _value:something_ use this:
  1186. <transformer name="mytrans3" class="org.apache.solr.response.transform.ValueAugmenterFactory" >
  1187. <double name="defaultValue">5</double>
  1188. </transformer>
  1189. If you are using the QueryElevationComponent, you may wish to mark documents that get boosted. The
  1190. EditorialMarkerFactory will do exactly that:
  1191. <transformer name="qecBooster" class="org.apache.solr.response.transform.EditorialMarkerFactory" />
  1192. -->
  1193. <!--
  1194. LTR Transformer will encode the document features in the response. For each document the transformer
  1195. will add the features as an extra field in the response. The name of the field will be the
  1196. name of the transformer enclosed between brackets (in this case [features]).
  1197. In order to get the feature vector you will have to specify that you
  1198. want the field (e.g., fl="*,[features])
  1199. You will need to set the solr.ltr.enabled system property
  1200. when running solr to run with ltr enabled:
  1201. -Dsolr.ltr.enabled=true
  1202. https://lucene.apache.org/solr/guide/learning-to-rank.html
  1203. -->
  1204. <transformer enable="${solr.ltr.enabled:false}" name="features" class="org.apache.solr.ltr.response.transform.LTRFeatureLoggerTransformerFactory">
  1205. <str name="fvCacheName">QUERY_DOC_FV</str>
  1206. </transformer>
  1207. </config>