Advertisement
Guest User

Untitled

a guest
Mar 8th, 2010
361
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.98 KB | None | 0 0
  1. <?xml version="1.0" ?>
  2. <!--
  3. Licensed to the Apache Software Foundation (ASF) under one or more
  4. contributor license agreements. See the NOTICE file distributed with
  5. this work for additional information regarding copyright ownership.
  6. The ASF licenses this file to You under the Apache License, Version 2.0
  7. (the "License"); you may not use this file except in compliance with
  8. the License. You may obtain a copy of the License at
  9.  
  10. http://www.apache.org/licenses/LICENSE-2.0
  11.  
  12. Unless required by applicable law or agreed to in writing, software
  13. distributed under the License is distributed on an "AS IS" BASIS,
  14. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. See the License for the specific language governing permissions and
  16. limitations under the License.
  17. -->
  18.  
  19. <config>
  20.  
  21. <!-- Used to specify an alternate directory to hold all index data
  22. other than the default ./data under the Solr home.
  23. If replication is in use, this should match the replication configuration. -->
  24. <!--
  25. <dataDir>./solr/data</dataDir>
  26. -->
  27.  
  28. <indexDefaults>
  29. <!-- Values here affect all index writers and act as a default unless overridden. -->
  30. <useCompoundFile>false</useCompoundFile>
  31. <mergeFactor>20</mergeFactor>
  32. <maxBufferedDocs>1000</maxBufferedDocs>
  33. <maxMergeDocs>2147483647</maxMergeDocs>
  34. <maxFieldLength>10000</maxFieldLength>
  35. <writeLockTimeout>1000</writeLockTimeout>
  36. <commitLockTimeout>10000</commitLockTimeout>
  37. <lockType>single</lockType>
  38. </indexDefaults>
  39.  
  40. <mainIndex>
  41. <!-- options specific to the main on-disk lucene index -->
  42. <useCompoundFile>false</useCompoundFile>
  43. <mergeFactor>20</mergeFactor>
  44. <maxBufferedDocs>1000</maxBufferedDocs>
  45. <maxMergeDocs>2147483647</maxMergeDocs>
  46. <maxFieldLength>10000</maxFieldLength>
  47.  
  48. <!-- If true, unlock any held write or commit locks on startup.
  49. This defeats the locking mechanism that allows multiple
  50. processes to safely access a lucene index, and should be
  51. used with care. -->
  52. <unlockOnStartup>true</unlockOnStartup>
  53. </mainIndex>
  54.  
  55. <!-- the default high-performance update handler -->
  56. <updateHandler class="solr.DirectUpdateHandler2">
  57.  
  58. <!-- A prefix of "solr." for class names is an alias that
  59. causes solr to search appropriate packages, including
  60. org.apache.solr.(search|update|request|core|analysis)
  61. -->
  62.  
  63. <!-- Limit number of buffered deletions to help bound memory during indexing -->
  64. <maxPendingDeletes>10000</maxPendingDeletes>
  65.  
  66. <!-- autocommit pending docs if certain criteria are met
  67. maxDocs - number of updates since last commit
  68. maxTime - number of milliseconds since oldest uncommitted update
  69. <autoCommit>
  70. <maxDocs>10000</maxDocs>
  71. <maxTime>600000</maxTime>
  72. </autoCommit>
  73. -->
  74. </updateHandler>
  75.  
  76.  
  77. <query>
  78. <!-- Maximum number of clauses in a boolean query... can affect
  79. range or prefix queries that expand to big boolean
  80. queries. An exception is thrown if exceeded. -->
  81. <maxBooleanClauses>16384</maxBooleanClauses>
  82.  
  83.  
  84. <!-- Cache used by SolrIndexSearcher for filters (DocSets),
  85. unordered sets of *all* documents that match a query.
  86. When a new searcher is opened, its caches may be prepopulated
  87. or "autowarmed" using data from caches in the old searcher.
  88. autowarmCount is the number of items to prepopulate. For LRUCache,
  89. the autowarmed items will be the most recently accessed items.
  90. Parameters:
  91. class - the SolrCache implementation (currently only LRUCache)
  92. size - the maximum number of entries in the cache
  93. initialSize - the initial capacity (number of entries) of
  94. the cache. (seel java.util.HashMap)
  95. autowarmCount - the number of entries to prepopulate from
  96. and old cache.
  97. -->
  98. <filterCache
  99. class="solr.LRUCache"
  100. size="256"
  101. initialSize="256"
  102. autowarmCount="0"/>
  103.  
  104. <!-- queryResultCache caches results of searches - ordered lists of
  105. document ids (DocList) based on a query, a sort, and the range
  106. of documents requested. -->
  107. <queryResultCache
  108. class="solr.LRUCache"
  109. size="256"
  110. initialSize="256"
  111. autowarmCount="0"/>
  112.  
  113. <!-- documentCache caches Lucene Document objects (the stored fields for each document).
  114. Since Lucene internal document ids are transient, this cache will not be autowarmed. -->
  115. <documentCache
  116. class="solr.LRUCache"
  117. size="256"
  118. initialSize="256"
  119. autowarmCount="0"/>
  120.  
  121. <!-- If true, stored fields that are not requested will be loaded lazily.
  122. -->
  123. <enableLazyFieldLoading>true</enableLazyFieldLoading>
  124.  
  125. <!-- Example of a generic cache. These caches may be accessed by name
  126. through SolrIndexSearcher.getCache(),cacheLookup(), and cacheInsert().
  127. The purpose is to enable easy caching of user/application level data.
  128. The regenerator argument should be specified as an implementation
  129. of solr.search.CacheRegenerator if autowarming is desired. -->
  130. <!--
  131. <cache name="myUserCache"
  132. class="solr.LRUCache"
  133. size="4096"
  134. initialSize="1024"
  135. autowarmCount="1024"
  136. regenerator="org.mycompany.mypackage.MyRegenerator"
  137. />
  138. -->
  139.  
  140. <!-- An optimization that attempts to use a filter to satisfy a search.
  141. If the requested sort does not include score, then the filterCache
  142. will be checked for a filter matching the query. If found, the filter
  143. will be used as the source of document ids, and then the sort will be
  144. applied to that.
  145. <useFilterForSortedQuery>true</useFilterForSortedQuery>
  146. -->
  147.  
  148. <!-- An optimization for use with the queryResultCache. When a search
  149. is requested, a superset of the requested number of document ids
  150. are collected. For example, if a search for a particular query
  151. requests matching documents 10 through 19, and queryWindowSize is 50,
  152. then documents 0 through 50 will be collected and cached. Any further
  153. requests in that range can be satisfied via the cache. -->
  154. <queryResultWindowSize>10</queryResultWindowSize>
  155.  
  156. <!-- This entry enables an int hash representation for filters (DocSets)
  157. when the number of items in the set is less than maxSize. For smaller
  158. sets, this representation is more memory efficient, more efficient to
  159. iterate over, and faster to take intersections. -->
  160. <HashDocSet maxSize="3000" loadFactor="0.75"/>
  161.  
  162.  
  163. <!-- boolToFilterOptimizer converts boolean clauses with zero boost
  164. into cached filters if the number of docs selected by the clause exceeds
  165. the threshold (represented as a fraction of the total index) -->
  166. <boolTofilterOptimizer enabled="true" cacheSize="32" threshold=".05"/>
  167.  
  168.  
  169. <!-- a newSearcher event is fired whenever a new searcher is being prepared
  170. and there is a current searcher handling requests (aka registered). -->
  171. <!-- QuerySenderListener takes an array of NamedList and executes a
  172. local query request for each NamedList in sequence. -->
  173. <!--
  174. <listener event="newSearcher" class="solr.QuerySenderListener">
  175. <arr name="queries">
  176. <lst> <str name="q">solr</str> <str name="start">0</str> <str name="rows">10</str> </lst>
  177. <lst> <str name="q">rocks</str> <str name="start">0</str> <str name="rows">10</str> </lst>
  178. </arr>
  179. </listener>
  180. -->
  181.  
  182. <!-- a firstSearcher event is fired whenever a new searcher is being
  183. prepared but there is no current registered searcher to handle
  184. requests or to gain autowarming data from. -->
  185. <!--
  186. <listener event="firstSearcher" class="solr.QuerySenderListener">
  187. <arr name="queries">
  188. <lst> <str name="q">fast_warm</str> <str name="start">0</str> <str name="rows">10</str> </lst>
  189. </arr>
  190. </listener>
  191. -->
  192.  
  193. <!-- If a search request comes in and there is no current registered searcher,
  194. then immediately register the still warming searcher and use it. If
  195. "false" then all requests will block until the first searcher is done
  196. warming. -->
  197. <useColdSearcher>true</useColdSearcher>
  198.  
  199. </query>
  200.  
  201. <!--
  202. Let the dispatch filter handler /select?qt=XXX
  203. handleSelect=true will use consistent error handling for /select and /update
  204. handleSelect=false will use solr1.1 style error formatting
  205. -->
  206. <requestDispatcher handleSelect="false" >
  207. <!--Make sure your system has some authentication before enabling remote streaming! -->
  208. <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="131072" />
  209. </requestDispatcher>
  210.  
  211.  
  212. <!-- requestHandler plugins... incoming queries will be dispatched to the
  213. correct handler based on the qt (query type) param matching the
  214. name of registered handlers.
  215. The "standard" request handler is the default and will be used if qt
  216. is not specified in the request.
  217. -->
  218. <requestHandler name="standard" class="solr.StandardRequestHandler">
  219. <!-- default values for query parameters -->
  220. <lst name="defaults">
  221. <str name="echoParams">explicit</str>
  222. <int name="rows">50</int>
  223. <str name="fl">model_id model_class model_base_class score</str>
  224. <str name="version">2.1</str>
  225. </lst>
  226. </requestHandler>
  227.  
  228. <!-- Update request handler.
  229. Note: Since solr1.1 requestHandlers requires a valid content type header
  230. if posted in the body. For example, curl now requires:
  231. -H 'Content-type:text/xml; charset=utf-8'
  232. The response format differs from solr1.1 formatting and returns a standard
  233. error code. To enable solr1.1 behavior, remove the /update handler or
  234. change its path
  235. -->
  236. <requestHandler name="/update" class="solr.XmlUpdateRequestHandler" />
  237.  
  238. <!-- CSV update handler, loaded on demand -->
  239. <requestHandler name="/update/csv" class="solr.CSVRequestHandler" startup="lazy" />
  240.  
  241. <!-- Admin Handlers. TODO There could be a single handler that loads them all... -->
  242. <requestHandler name="/admin/luke" class="org.apache.solr.handler.admin.LukeRequestHandler" />
  243. <requestHandler name="/admin/system" class="org.apache.solr.handler.admin.SystemInfoHandler" />
  244. <requestHandler name="/admin/plugins" class="org.apache.solr.handler.admin.PluginInfoHandler" />
  245. <requestHandler name="/admin/threads" class="org.apache.solr.handler.admin.ThreadDumpHandler" />
  246. <requestHandler name="/admin/properties" class="org.apache.solr.handler.admin.PropertiesRequestHandler" />
  247.  
  248. <!-- Echo the request contents back to the client -->
  249. <requestHandler name="/debug/dump" class="solr.DumpRequestHandler" >
  250. <lst name="defaults">
  251. <str name="echoParams">explicit</str>
  252. <!-- for all params (including the default etc) use: 'all' -->
  253. <str name="echoHandler">true</str>
  254. </lst>
  255. </requestHandler>
  256.  
  257. <highlighting>
  258. <!-- Configure the standard fragmenter -->
  259. <!-- This could most likely be commented out in the "default" case -->
  260. <fragmenter name="gap" class="org.apache.solr.highlight.GapFragmenter" default="true">
  261. <lst name="defaults">
  262. <int name="hl.fragsize">100</int>
  263. </lst>
  264. </fragmenter>
  265.  
  266. <!-- A regular-expression-based fragmenter (f.i., for sentence extraction) -->
  267. <fragmenter name="regex" class="org.apache.solr.highlight.RegexFragmenter">
  268. <lst name="defaults">
  269. <!-- slightly smaller fragsizes work better because of slop -->
  270. <int name="hl.fragsize">70</int>
  271. <!-- allow 50% slop on fragment sizes -->
  272. <float name="hl.regex.slop">0.5</float>
  273. <!-- a basic sentence pattern -->
  274. <str name="hl.regex.pattern">[-\w ,/\n\"']{20,200}</str>
  275. </lst>
  276. </fragmenter>
  277.  
  278. <!-- Configure the standard formatter -->
  279. <formatter name="html" class="org.apache.solr.highlight.HtmlFormatter" default="true">
  280. <lst name="defaults">
  281. <str name="hl.simple.pre"><![CDATA[<strong class="searchterm">]]></str>
  282. <str name="hl.simple.post"><![CDATA[</strong>]]></str>
  283. </lst>
  284. </formatter>
  285. </highlighting>
  286.  
  287. <!-- queryResponseWriter plugins... query responses will be written using the
  288. writer specified by the 'wt' request parameter matching the name of a registered
  289. writer.
  290. The "standard" writer is the default and will be used if 'wt' is not specified
  291. in the request. XMLResponseWriter will be used if nothing is specified here.
  292. The json, python, and ruby writers are also available by default.
  293.  
  294. <queryResponseWriter name="standard" class="org.apache.solr.request.XMLResponseWriter"/>
  295. <queryResponseWriter name="json" class="org.apache.solr.request.JSONResponseWriter"/>
  296. <queryResponseWriter name="python" class="org.apache.solr.request.PythonResponseWriter"/>
  297. <queryResponseWriter name="ruby" class="org.apache.solr.request.RubyResponseWriter"/>
  298.  
  299. <queryResponseWriter name="custom" class="com.example.MyResponseWriter"/>
  300. -->
  301.  
  302. <!-- XSLT response writer transforms the XML output by any xslt file found
  303. in Solr's conf/xslt directory. Changes to xslt files are checked for
  304. every xsltCacheLifetimeSeconds.
  305. -->
  306. <queryResponseWriter name="xslt" class="org.apache.solr.request.XSLTResponseWriter">
  307. <int name="xsltCacheLifetimeSeconds">5</int>
  308. </queryResponseWriter>
  309.  
  310. <!-- config for the admin interface -->
  311. <admin>
  312. <defaultQuery>solr</defaultQuery>
  313. <gettableFiles>solrconfig.xml schema.xml admin-extra.html</gettableFiles>
  314. <!-- pingQuery should be "URLish" ...
  315. &amp; separated key=val pairs ... but there shouldn't be any
  316. URL escaping of the values -->
  317. <pingQuery>
  318. q=solr
  319. </pingQuery>
  320. <!-- configure a healthcheck file for servers behind a loadbalancer
  321. <healthcheck type="file">server-enabled</healthcheck>
  322. -->
  323. </admin>
  324.  
  325. </config>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement