solrconfig.xml 62 KB

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