solrconfig.xml 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!--
  3. Licensed to the Apache Software Foundation (ASF) under one or more
  4. contributor license agreements. See the NOTICE file distributed with
  5. this work for additional information regarding copyright ownership.
  6. The ASF licenses this file to You under the Apache License, Version 2.0
  7. (the "License"); you may not use this file except in compliance with
  8. the License. You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing, software
  11. distributed under the License is distributed on an "AS IS" BASIS,
  12. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. See the License for the specific language governing permissions and
  14. limitations under the License.
  15. -->
  16. <!--
  17. For more details about configurations options that may appear in
  18. this file, see http://wiki.apache.org/solr/SolrConfigXml.
  19. -->
  20. <config>
  21. <!-- In all configuration below, a prefix of "solr." for class names
  22. is an alias that causes solr to search appropriate packages,
  23. including org.apache.solr.(search|update|request|core|analysis)
  24. You may also specify a fully qualified Java classname if you
  25. have your own custom plugins.
  26. -->
  27. <!-- Controls what version of Lucene various components of Solr
  28. adhere to. Generally, you want to use the latest version to
  29. get all bug fixes and improvements. It is highly recommended
  30. that you fully re-index after changing this setting as it can
  31. affect both how text is indexed and queried.
  32. -->
  33. <luceneMatchVersion>5.5.2</luceneMatchVersion>
  34. <!-- Data Directory
  35. Used to specify an alternate directory to hold all index data
  36. other than the default ./data under the Solr home. If
  37. replication is in use, this should match the replication
  38. configuration.
  39. -->
  40. <dataDir>${solr.data.dir:}</dataDir>
  41. <!-- The DirectoryFactory to use for indexes.
  42. solr.StandardDirectoryFactory is filesystem
  43. based and tries to pick the best implementation for the current
  44. JVM and platform. solr.NRTCachingDirectoryFactory, the default,
  45. wraps solr.StandardDirectoryFactory and caches small files in memory
  46. for better NRT performance.
  47. One can force a particular implementation via solr.MMapDirectoryFactory,
  48. solr.NIOFSDirectoryFactory, or solr.SimpleFSDirectoryFactory.
  49. solr.RAMDirectoryFactory is memory based, not
  50. persistent, and doesn't work with replication.
  51. -->
  52. <directoryFactory name="DirectoryFactory"
  53. class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}">
  54. </directoryFactory>
  55. <!-- The CodecFactory for defining the format of the inverted index.
  56. The default implementation is SchemaCodecFactory, which is the official Lucene
  57. index format, but hooks into the schema to provide per-field customization of
  58. the postings lists and per-document values in the fieldType element
  59. (postingsFormat/docValuesFormat). Note that most of the alternative implementations
  60. are experimental, so if you choose to customize the index format, it's a good
  61. idea to convert back to the official format e.g. via IndexWriter.addIndexes(IndexReader)
  62. before upgrading to a newer version to avoid unnecessary reindexing.
  63. A "compressionMode" string element can be added to <codecFactory> to choose
  64. between the existing compression modes in the default codec: "BEST_SPEED" (default)
  65. or "BEST_COMPRESSION".
  66. -->
  67. <codecFactory class="solr.SchemaCodecFactory"/>
  68. <!-- To disable dynamic schema REST APIs, use the following for <schemaFactory>:
  69. <schemaFactory class="ClassicIndexSchemaFactory"/>
  70. When ManagedIndexSchemaFactory is specified instead, Solr will load the schema from
  71. the resource named in 'managedSchemaResourceName', rather than from schema.xml.
  72. Note that the managed schema resource CANNOT be named schema.xml. If the managed
  73. schema does not exist, Solr will create it after reading schema.xml, then rename
  74. 'schema.xml' to 'schema.xml.bak'.
  75. Do NOT hand edit the managed schema - external modifications will be ignored and
  76. overwritten as a result of schema modification REST API calls.
  77. When ManagedIndexSchemaFactory is specified with mutable = true, schema
  78. modification REST API calls will be allowed; otherwise, error responses will be
  79. sent back for these requests.
  80. -->
  81. <schemaFactory class="ManagedIndexSchemaFactory">
  82. <bool name="mutable">true</bool>
  83. <str name="managedSchemaResourceName">managed-schema</str>
  84. </schemaFactory>
  85. <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  86. Index Config - These settings control low-level behavior of indexing
  87. Most example settings here show the default value, but are commented
  88. out, to more easily see where customizations have been made.
  89. Note: This replaces <indexDefaults> and <mainIndex> from older versions
  90. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  91. <indexConfig>
  92. <!-- LockFactory
  93. This option specifies which Lucene LockFactory implementation
  94. to use.
  95. single = SingleInstanceLockFactory - suggested for a
  96. read-only index or when there is no possibility of
  97. another process trying to modify the index.
  98. native = NativeFSLockFactory - uses OS native file locking.
  99. Do not use when multiple solr webapps in the same
  100. JVM are attempting to share a single index.
  101. simple = SimpleFSLockFactory - uses a plain file for locking
  102. Defaults: 'native' is default for Solr3.6 and later, otherwise
  103. 'simple' is the default
  104. More details on the nuances of each LockFactory...
  105. http://wiki.apache.org/lucene-java/AvailableLockFactories
  106. -->
  107. <lockType>${solr.lock.type:native}</lockType>
  108. <!-- Lucene Infostream
  109. To aid in advanced debugging, Lucene provides an "InfoStream"
  110. of detailed information when indexing.
  111. Setting the value to true will instruct the underlying Lucene
  112. IndexWriter to write its info stream to solr's log. By default,
  113. this is enabled here, and controlled through log4j.properties.
  114. -->
  115. <infoStream>true</infoStream>
  116. </indexConfig>
  117. <!-- JMX
  118. This example enables JMX if and only if an existing MBeanServer
  119. is found, use this if you want to configure JMX through JVM
  120. parameters. Remove this to disable exposing Solr configuration
  121. and statistics to JMX.
  122. For more details see http://wiki.apache.org/solr/SolrJmx
  123. -->
  124. <jmx />
  125. <!-- If you want to connect to a particular server, specify the
  126. agentId
  127. -->
  128. <!-- <jmx agentId="myAgent" /> -->
  129. <!-- If you want to start a new MBeanServer, specify the serviceUrl -->
  130. <!-- <jmx serviceUrl="service:jmx:rmi:///jndi/rmi://localhost:9999/solr"/>
  131. -->
  132. <!-- The default high-performance update handler -->
  133. <updateHandler class="solr.DirectUpdateHandler2">
  134. <!-- Enables a transaction log, used for real-time get, durability, and
  135. and solr cloud replica recovery. The log can grow as big as
  136. uncommitted changes to the index, so use of a hard autoCommit
  137. is recommended (see below).
  138. "dir" - the target directory for transaction logs, defaults to the
  139. solr data directory.
  140. "numVersionBuckets" - sets the number of buckets used to keep
  141. track of max version values when checking for re-ordered
  142. updates; increase this value to reduce the cost of
  143. synchronizing access to version buckets during high-volume
  144. indexing, this requires 8 bytes (long) * numVersionBuckets
  145. of heap space per Solr core.
  146. -->
  147. <updateLog>
  148. <str name="dir">${solr.ulog.dir:}</str>
  149. <int name="numVersionBuckets">${solr.ulog.numVersionBuckets:65536}</int>
  150. </updateLog>
  151. <!-- AutoCommit
  152. Perform a hard commit automatically under certain conditions.
  153. Instead of enabling autoCommit, consider using "commitWithin"
  154. when adding documents.
  155. http://wiki.apache.org/solr/UpdateXmlMessages
  156. maxDocs - Maximum number of documents to add since the last
  157. commit before automatically triggering a new commit.
  158. maxTime - Maximum amount of time in ms that is allowed to pass
  159. since a document was added before automatically
  160. triggering a new commit.
  161. openSearcher - if false, the commit causes recent index changes
  162. to be flushed to stable storage, but does not cause a new
  163. searcher to be opened to make those changes visible.
  164. If the updateLog is enabled, then it's highly recommended to
  165. have some sort of hard autoCommit to limit the log size.
  166. -->
  167. <autoCommit>
  168. <maxTime>${solr.autoCommit.maxTime:15000}</maxTime>
  169. <openSearcher>false</openSearcher>
  170. </autoCommit>
  171. <!-- softAutoCommit is like autoCommit except it causes a
  172. 'soft' commit which only ensures that changes are visible
  173. but does not ensure that data is synced to disk. This is
  174. faster and more near-realtime friendly than a hard commit.
  175. -->
  176. <autoSoftCommit>
  177. <maxTime>${solr.autoSoftCommit.maxTime:-1}</maxTime>
  178. </autoSoftCommit>
  179. </updateHandler>
  180. <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  181. Query section - these settings control query time things like caches
  182. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  183. <query>
  184. <!-- Max Boolean Clauses
  185. Maximum number of clauses in each BooleanQuery, an exception
  186. is thrown if exceeded.
  187. ** WARNING **
  188. This option actually modifies a global Lucene property that
  189. will affect all SolrCores. If multiple solrconfig.xml files
  190. disagree on this property, the value at any given moment will
  191. be based on the last SolrCore to be initialized.
  192. -->
  193. <maxBooleanClauses>1024</maxBooleanClauses>
  194. <!-- Solr Internal Query Caches
  195. There are two implementations of cache available for Solr,
  196. LRUCache, based on a synchronized LinkedHashMap, and
  197. FastLRUCache, based on a ConcurrentHashMap.
  198. FastLRUCache has faster gets and slower puts in single
  199. threaded operation and thus is generally faster than LRUCache
  200. when the hit ratio of the cache is high (> 75%), and may be
  201. faster under other scenarios on multi-cpu systems.
  202. -->
  203. <!-- Filter Cache
  204. Cache used by SolrIndexSearcher for filters (DocSets),
  205. unordered sets of *all* documents that match a query. When a
  206. new searcher is opened, its caches may be prepopulated or
  207. "autowarmed" using data from caches in the old searcher.
  208. autowarmCount is the number of items to prepopulate. For
  209. LRUCache, the autowarmed items will be the most recently
  210. accessed items.
  211. Parameters:
  212. class - the SolrCache implementation LRUCache or
  213. (LRUCache or FastLRUCache)
  214. size - the maximum number of entries in the cache
  215. initialSize - the initial capacity (number of entries) of
  216. the cache. (see java.util.HashMap)
  217. autowarmCount - the number of entries to prepopulate from
  218. and old cache.
  219. -->
  220. <filterCache class="solr.FastLRUCache"
  221. size="512"
  222. initialSize="512"
  223. autowarmCount="0"/>
  224. <!-- Query Result Cache
  225. Caches results of searches - ordered lists of document ids
  226. (DocList) based on a query, a sort, and the range of documents requested.
  227. Additional supported parameter by LRUCache:
  228. maxRamMB - the maximum amount of RAM (in MB) that this cache is allowed
  229. to occupy
  230. -->
  231. <queryResultCache class="solr.LRUCache"
  232. size="512"
  233. initialSize="512"
  234. autowarmCount="0"/>
  235. <!-- Document Cache
  236. Caches Lucene Document objects (the stored fields for each
  237. document). Since Lucene internal document ids are transient,
  238. this cache will not be autowarmed.
  239. -->
  240. <documentCache class="solr.LRUCache"
  241. size="512"
  242. initialSize="512"
  243. autowarmCount="0"/>
  244. <!-- custom cache currently used by block join -->
  245. <cache name="perSegFilter"
  246. class="solr.search.LRUCache"
  247. size="10"
  248. initialSize="0"
  249. autowarmCount="10"
  250. regenerator="solr.NoOpRegenerator" />
  251. <!-- Lazy Field Loading
  252. If true, stored fields that are not requested will be loaded
  253. lazily. This can result in a significant speed improvement
  254. if the usual case is to not load all stored fields,
  255. especially if the skipped fields are large compressed text
  256. fields.
  257. -->
  258. <enableLazyFieldLoading>true</enableLazyFieldLoading>
  259. <!-- Result Window Size
  260. An optimization for use with the queryResultCache. When a search
  261. is requested, a superset of the requested number of document ids
  262. are collected. For example, if a search for a particular query
  263. requests matching documents 10 through 19, and queryWindowSize is 50,
  264. then documents 0 through 49 will be collected and cached. Any further
  265. requests in that range can be satisfied via the cache.
  266. -->
  267. <queryResultWindowSize>20</queryResultWindowSize>
  268. <!-- Maximum number of documents to cache for any entry in the
  269. queryResultCache.
  270. -->
  271. <queryResultMaxDocsCached>200</queryResultMaxDocsCached>
  272. <!-- Use Cold Searcher
  273. If a search request comes in and there is no current
  274. registered searcher, then immediately register the still
  275. warming searcher and use it. If "false" then all requests
  276. will block until the first searcher is done warming.
  277. -->
  278. <useColdSearcher>false</useColdSearcher>
  279. <!-- Max Warming Searchers
  280. Maximum number of searchers that may be warming in the
  281. background concurrently. An error is returned if this limit
  282. is exceeded.
  283. Recommend values of 1-2 for read-only slaves, higher for
  284. masters w/o cache warming.
  285. -->
  286. <maxWarmingSearchers>2</maxWarmingSearchers>
  287. </query>
  288. <!-- Request Dispatcher
  289. This section contains instructions for how the SolrDispatchFilter
  290. should behave when processing requests for this SolrCore.
  291. handleSelect is a legacy option that affects the behavior of requests
  292. such as /select?qt=XXX
  293. handleSelect="true" will cause the SolrDispatchFilter to process
  294. the request and dispatch the query to a handler specified by the
  295. "qt" param, assuming "/select" isn't already registered.
  296. handleSelect="false" will cause the SolrDispatchFilter to
  297. ignore "/select" requests, resulting in a 404 unless a handler
  298. is explicitly registered with the name "/select"
  299. handleSelect="true" is not recommended for new users, but is the default
  300. for backwards compatibility
  301. -->
  302. <requestDispatcher handleSelect="false" >
  303. <!-- Request Parsing
  304. These settings indicate how Solr Requests may be parsed, and
  305. what restrictions may be placed on the ContentStreams from
  306. those requests
  307. enableRemoteStreaming - enables use of the stream.file
  308. and stream.url parameters for specifying remote streams.
  309. multipartUploadLimitInKB - specifies the max size (in KiB) of
  310. Multipart File Uploads that Solr will allow in a Request.
  311. formdataUploadLimitInKB - specifies the max size (in KiB) of
  312. form data (application/x-www-form-urlencoded) sent via
  313. POST. You can use POST to pass request parameters not
  314. fitting into the URL.
  315. addHttpRequestToContext - if set to true, it will instruct
  316. the requestParsers to include the original HttpServletRequest
  317. object in the context map of the SolrQueryRequest under the
  318. key "httpRequest". It will not be used by any of the existing
  319. Solr components, but may be useful when developing custom
  320. plugins.
  321. *** WARNING ***
  322. The settings below authorize Solr to fetch remote files, You
  323. should make sure your system has some authentication before
  324. using enableRemoteStreaming="true"
  325. -->
  326. <requestParsers enableRemoteStreaming="true"
  327. multipartUploadLimitInKB="2048000"
  328. formdataUploadLimitInKB="2048"
  329. addHttpRequestToContext="false"/>
  330. <!-- HTTP Caching
  331. Set HTTP caching related parameters (for proxy caches and clients).
  332. The options below instruct Solr not to output any HTTP Caching
  333. related headers
  334. -->
  335. <httpCaching never304="true" />
  336. </requestDispatcher>
  337. <!-- Request Handlers
  338. http://wiki.apache.org/solr/SolrRequestHandler
  339. Incoming queries will be dispatched to a specific handler by name
  340. based on the path specified in the request.
  341. Legacy behavior: If the request path uses "/select" but no Request
  342. Handler has that name, and if handleSelect="true" has been specified in
  343. the requestDispatcher, then the Request Handler is dispatched based on
  344. the qt parameter. Handlers without a leading '/' are accessed this way
  345. like so: http://host/app/[core/]select?qt=name If no qt is
  346. given, then the requestHandler that declares default="true" will be
  347. used or the one named "standard".
  348. If a Request Handler is declared with startup="lazy", then it will
  349. not be initialized until the first request that uses it.
  350. -->
  351. <!-- SearchHandler
  352. http://wiki.apache.org/solr/SearchHandler
  353. For processing Search Queries, the primary Request Handler
  354. provided with Solr is "SearchHandler" It delegates to a sequent
  355. of SearchComponents (see below) and supports distributed
  356. queries across multiple shards
  357. -->
  358. <requestHandler name="/select" class="solr.SearchHandler">
  359. <!-- default values for query parameters can be specified, these
  360. will be overridden by parameters in the request
  361. -->
  362. <lst name="defaults">
  363. <str name="echoParams">explicit</str>
  364. <int name="rows">10</int>
  365. </lst>
  366. </requestHandler>
  367. <!-- A request handler that returns indented JSON by default -->
  368. <requestHandler name="/query" class="solr.SearchHandler">
  369. <lst name="defaults">
  370. <str name="echoParams">explicit</str>
  371. <str name="wt">json</str>
  372. <str name="indent">true</str>
  373. <str name="df">text</str>
  374. </lst>
  375. </requestHandler>
  376. <!--
  377. The export request handler is used to export full sorted result sets.
  378. Do not change these defaults.
  379. -->
  380. <requestHandler name="/export" class="solr.SearchHandler">
  381. <lst name="invariants">
  382. <str name="rq">{!xport}</str>
  383. <str name="wt">xsort</str>
  384. <str name="distrib">false</str>
  385. </lst>
  386. <arr name="components">
  387. <str>query</str>
  388. </arr>
  389. </requestHandler>
  390. <initParams path="/update/**,/query,/select,/tvrh,/elevate,/spell">
  391. <lst name="defaults">
  392. <str name="df">text</str>
  393. </lst>
  394. </initParams>
  395. <!-- Field Analysis Request Handler
  396. RequestHandler that provides much the same functionality as
  397. analysis.jsp. Provides the ability to specify multiple field
  398. types and field names in the same request and outputs
  399. index-time and query-time analysis for each of them.
  400. Request parameters are:
  401. analysis.fieldname - field name whose analyzers are to be used
  402. analysis.fieldtype - field type whose analyzers are to be used
  403. analysis.fieldvalue - text for index-time analysis
  404. q (or analysis.q) - text for query time analysis
  405. analysis.showmatch (true|false) - When set to true and when
  406. query analysis is performed, the produced tokens of the
  407. field value analysis will be marked as "matched" for every
  408. token that is produces by the query analysis
  409. -->
  410. <requestHandler name="/analysis/field"
  411. startup="lazy"
  412. class="solr.FieldAnalysisRequestHandler" />
  413. <!-- Document Analysis Handler
  414. http://wiki.apache.org/solr/AnalysisRequestHandler
  415. An analysis handler that provides a breakdown of the analysis
  416. process of provided documents. This handler expects a (single)
  417. content stream with the following format:
  418. <docs>
  419. <doc>
  420. <field name="id">1</field>
  421. <field name="name">The Name</field>
  422. <field name="text">The Text Value</field>
  423. </doc>
  424. <doc>...</doc>
  425. <doc>...</doc>
  426. ...
  427. </docs>
  428. Note: Each document must contain a field which serves as the
  429. unique key. This key is used in the returned response to associate
  430. an analysis breakdown to the analyzed document.
  431. Like the FieldAnalysisRequestHandler, this handler also supports
  432. query analysis by sending either an "analysis.query" or "q"
  433. request parameter that holds the query text to be analyzed. It
  434. also supports the "analysis.showmatch" parameter which when set to
  435. true, all field tokens that match the query tokens will be marked
  436. as a "match".
  437. -->
  438. <requestHandler name="/analysis/document"
  439. class="solr.DocumentAnalysisRequestHandler"
  440. startup="lazy" />
  441. <!-- Echo the request contents back to the client -->
  442. <requestHandler name="/debug/dump" class="solr.DumpRequestHandler" >
  443. <lst name="defaults">
  444. <str name="echoParams">explicit</str>
  445. <str name="echoHandler">true</str>
  446. </lst>
  447. </requestHandler>
  448. <!-- Search Components
  449. Search components are registered to SolrCore and used by
  450. instances of SearchHandler (which can access them by name)
  451. By default, the following components are available:
  452. <searchComponent name="query" class="solr.QueryComponent" />
  453. <searchComponent name="facet" class="solr.FacetComponent" />
  454. <searchComponent name="mlt" class="solr.MoreLikeThisComponent" />
  455. <searchComponent name="highlight" class="solr.HighlightComponent" />
  456. <searchComponent name="stats" class="solr.StatsComponent" />
  457. <searchComponent name="debug" class="solr.DebugComponent" />
  458. -->
  459. <!-- Terms Component
  460. http://wiki.apache.org/solr/TermsComponent
  461. A component to return terms and document frequency of those
  462. terms
  463. -->
  464. <searchComponent name="terms" class="solr.TermsComponent"/>
  465. <!-- A request handler for demonstrating the terms component -->
  466. <requestHandler name="/terms" class="solr.SearchHandler" startup="lazy">
  467. <lst name="defaults">
  468. <bool name="terms">true</bool>
  469. <bool name="distrib">false</bool>
  470. </lst>
  471. <arr name="components">
  472. <str>terms</str>
  473. </arr>
  474. </requestHandler>
  475. <!-- Legacy config for the admin interface -->
  476. <admin>
  477. <defaultQuery>*:*</defaultQuery>
  478. </admin>
  479. </config>