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 | |
---|
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 | <!-- |
---|
22 | Controls what version of Lucene various components of Solr adhere to. Generally, you want |
---|
23 | to use the latest version to get all bug fixes and improvements. It is highly recommended |
---|
24 | that you fully re-index after changing this setting as it can affect both how text is indexed |
---|
25 | and queried. |
---|
26 | --> |
---|
27 | <luceneMatchVersion>LUCENE_40</luceneMatchVersion> |
---|
28 | |
---|
29 | <lib dir="../../../../contrib/dataimporthandler/lib/" regex=".*jar$" /> |
---|
30 | <lib dir="../../../../dist/" regex="apache-solr-dataimporthandler-.*\.jar" /> |
---|
31 | |
---|
32 | <!-- <indexConfig> section could go here, but we want the defaults --> |
---|
33 | |
---|
34 | <!-- Enables JMX if and only if an existing MBeanServer is found, use |
---|
35 | this if you want to configure JMX through JVM parameters. Remove |
---|
36 | this to disable exposing Solr configuration and statistics to JMX. |
---|
37 | |
---|
38 | If you want to connect to a particular server, specify the agentId |
---|
39 | e.g. <jmx agentId="myAgent" /> |
---|
40 | |
---|
41 | If you want to start a new MBeanServer, specify the serviceUrl |
---|
42 | e.g <jmx serviceUrl="service:jmx:rmi:///jndi/rmi://localhost:9999/solr" /> |
---|
43 | |
---|
44 | For more details see http://wiki.apache.org/solr/SolrJmx |
---|
45 | --> |
---|
46 | <jmx /> |
---|
47 | |
---|
48 | <!-- the default high-performance update handler --> |
---|
49 | <updateHandler class="solr.DirectUpdateHandler2"> |
---|
50 | |
---|
51 | <!-- A prefix of "solr." for class names is an alias that |
---|
52 | causes solr to search appropriate packages, including |
---|
53 | org.apache.solr.(search|update|request|core|analysis) |
---|
54 | --> |
---|
55 | |
---|
56 | <!-- Perform a <commit/> automatically under certain conditions: |
---|
57 | maxDocs - number of updates since last commit is greater than this |
---|
58 | maxTime - oldest uncommited update (in ms) is this long ago |
---|
59 | <autoCommit> |
---|
60 | <maxDocs>10000</maxDocs> |
---|
61 | <maxTime>1000</maxTime> |
---|
62 | </autoCommit> |
---|
63 | --> |
---|
64 | |
---|
65 | <!-- The RunExecutableListener executes an external command. |
---|
66 | exe - the name of the executable to run |
---|
67 | dir - dir to use as the current working directory. default="." |
---|
68 | wait - the calling thread waits until the executable returns. default="true" |
---|
69 | args - the arguments to pass to the program. default=nothing |
---|
70 | env - environment variables to set. default=nothing |
---|
71 | --> |
---|
72 | <!-- A postCommit event is fired after every commit or optimize command |
---|
73 | <listener event="postCommit" class="solr.RunExecutableListener"> |
---|
74 | <str name="exe">solr/bin/snapshooter</str> |
---|
75 | <str name="dir">.</str> |
---|
76 | <bool name="wait">true</bool> |
---|
77 | <arr name="args"> <str>arg1</str> <str>arg2</str> </arr> |
---|
78 | <arr name="env"> <str>MYVAR=val1</str> </arr> |
---|
79 | </listener> |
---|
80 | --> |
---|
81 | <!-- A postOptimize event is fired only after every optimize command, useful |
---|
82 | in conjunction with index distribution to only distribute optimized indicies |
---|
83 | <listener event="postOptimize" class="solr.RunExecutableListener"> |
---|
84 | <str name="exe">snapshooter</str> |
---|
85 | <str name="dir">solr/bin</str> |
---|
86 | <bool name="wait">true</bool> |
---|
87 | </listener> |
---|
88 | --> |
---|
89 | |
---|
90 | </updateHandler> |
---|
91 | |
---|
92 | |
---|
93 | <query> |
---|
94 | <!-- Maximum number of clauses in a boolean query... can affect |
---|
95 | range or prefix queries that expand to big boolean |
---|
96 | queries. An exception is thrown if exceeded. --> |
---|
97 | <maxBooleanClauses>1024</maxBooleanClauses> |
---|
98 | |
---|
99 | |
---|
100 | <!-- There are two implementations of cache available for Solr, |
---|
101 | LRUCache, based on a synchronized LinkedHashMap, and |
---|
102 | FastLRUCache, based on a ConcurrentHashMap. FastLRUCache has faster gets |
---|
103 | and slower puts in single threaded operation and thus is generally faster |
---|
104 | than LRUCache when the hit ratio of the cache is high (> 75%), and may be |
---|
105 | faster under other scenarios on multi-cpu systems. --> |
---|
106 | <!-- Cache used by SolrIndexSearcher for filters (DocSets), |
---|
107 | unordered sets of *all* documents that match a query. |
---|
108 | When a new searcher is opened, its caches may be prepopulated |
---|
109 | or "autowarmed" using data from caches in the old searcher. |
---|
110 | autowarmCount is the number of items to prepopulate. For LRUCache, |
---|
111 | the autowarmed items will be the most recently accessed items. |
---|
112 | Parameters: |
---|
113 | class - the SolrCache implementation LRUCache or FastLRUCache |
---|
114 | size - the maximum number of entries in the cache |
---|
115 | initialSize - the initial capacity (number of entries) of |
---|
116 | the cache. (seel java.util.HashMap) |
---|
117 | autowarmCount - the number of entries to prepopulate from |
---|
118 | and old cache. |
---|
119 | --> |
---|
120 | <filterCache |
---|
121 | class="solr.FastLRUCache" |
---|
122 | size="512" |
---|
123 | initialSize="512" |
---|
124 | autowarmCount="128"/> |
---|
125 | |
---|
126 | <!-- Cache used to hold field values that are quickly accessible |
---|
127 | by document id. The fieldValueCache is created by default |
---|
128 | even if not configured here. |
---|
129 | <fieldValueCache |
---|
130 | class="solr.FastLRUCache" |
---|
131 | size="512" |
---|
132 | autowarmCount="128" |
---|
133 | showItems="32" |
---|
134 | /> |
---|
135 | --> |
---|
136 | |
---|
137 | <!-- queryResultCache caches results of searches - ordered lists of |
---|
138 | document ids (DocList) based on a query, a sort, and the range |
---|
139 | of documents requested. --> |
---|
140 | <queryResultCache |
---|
141 | class="solr.LRUCache" |
---|
142 | size="512" |
---|
143 | initialSize="512" |
---|
144 | autowarmCount="32"/> |
---|
145 | |
---|
146 | <!-- documentCache caches Lucene Document objects (the stored fields for each document). |
---|
147 | Since Lucene internal document ids are transient, this cache will not be autowarmed. --> |
---|
148 | <documentCache |
---|
149 | class="solr.LRUCache" |
---|
150 | size="512" |
---|
151 | initialSize="512" |
---|
152 | autowarmCount="0"/> |
---|
153 | |
---|
154 | <!-- If true, stored fields that are not requested will be loaded lazily. |
---|
155 | |
---|
156 | This can result in a significant speed improvement if the usual case is to |
---|
157 | not load all stored fields, especially if the skipped fields are large compressed |
---|
158 | text fields. |
---|
159 | --> |
---|
160 | <enableLazyFieldLoading>true</enableLazyFieldLoading> |
---|
161 | |
---|
162 | <!-- Example of a generic cache. These caches may be accessed by name |
---|
163 | through SolrIndexSearcher.getCache(),cacheLookup(), and cacheInsert(). |
---|
164 | The purpose is to enable easy caching of user/application level data. |
---|
165 | The regenerator argument should be specified as an implementation |
---|
166 | of solr.search.CacheRegenerator if autowarming is desired. --> |
---|
167 | <!-- |
---|
168 | <cache name="myUserCache" |
---|
169 | class="solr.LRUCache" |
---|
170 | size="4096" |
---|
171 | initialSize="1024" |
---|
172 | autowarmCount="1024" |
---|
173 | regenerator="org.mycompany.mypackage.MyRegenerator" |
---|
174 | /> |
---|
175 | --> |
---|
176 | |
---|
177 | <!-- An optimization that attempts to use a filter to satisfy a search. |
---|
178 | If the requested sort does not include score, then the filterCache |
---|
179 | will be checked for a filter matching the query. If found, the filter |
---|
180 | will be used as the source of document ids, and then the sort will be |
---|
181 | applied to that. |
---|
182 | <useFilterForSortedQuery>true</useFilterForSortedQuery> |
---|
183 | --> |
---|
184 | |
---|
185 | <!-- An optimization for use with the queryResultCache. When a search |
---|
186 | is requested, a superset of the requested number of document ids |
---|
187 | are collected. For example, if a search for a particular query |
---|
188 | requests matching documents 10 through 19, and queryWindowSize is 50, |
---|
189 | then documents 0 through 49 will be collected and cached. Any further |
---|
190 | requests in that range can be satisfied via the cache. --> |
---|
191 | <queryResultWindowSize>50</queryResultWindowSize> |
---|
192 | |
---|
193 | <!-- Maximum number of documents to cache for any entry in the |
---|
194 | queryResultCache. --> |
---|
195 | <queryResultMaxDocsCached>200</queryResultMaxDocsCached> |
---|
196 | |
---|
197 | <!-- This entry enables an int hash representation for filters (DocSets) |
---|
198 | when the number of items in the set is less than maxSize. For smaller |
---|
199 | sets, this representation is more memory efficient, more efficient to |
---|
200 | iterate over, and faster to take intersections. --> |
---|
201 | <HashDocSet maxSize="3000" loadFactor="0.75"/> |
---|
202 | |
---|
203 | <!-- a newSearcher event is fired whenever a new searcher is being prepared |
---|
204 | and there is a current searcher handling requests (aka registered). --> |
---|
205 | <!-- QuerySenderListener takes an array of NamedList and executes a |
---|
206 | local query request for each NamedList in sequence. --> |
---|
207 | <listener event="newSearcher" class="solr.QuerySenderListener"> |
---|
208 | <arr name="queries"> |
---|
209 | <lst> <str name="q">solr</str> <str name="start">0</str> <str name="rows">10</str> </lst> |
---|
210 | <lst> <str name="q">rocks</str> <str name="start">0</str> <str name="rows">10</str> </lst> |
---|
211 | <lst><str name="q">static newSearcher warming query from solrconfig.xml</str></lst> |
---|
212 | </arr> |
---|
213 | </listener> |
---|
214 | |
---|
215 | <!-- a firstSearcher event is fired whenever a new searcher is being |
---|
216 | prepared but there is no current registered searcher to handle |
---|
217 | requests or to gain autowarming data from. --> |
---|
218 | <listener event="firstSearcher" class="solr.QuerySenderListener"> |
---|
219 | <arr name="queries"> |
---|
220 | <lst> <str name="q">fast_warm</str> <str name="start">0</str> <str name="rows">10</str> </lst> |
---|
221 | <lst><str name="q">static firstSearcher warming query from solrconfig.xml</str></lst> |
---|
222 | </arr> |
---|
223 | </listener> |
---|
224 | |
---|
225 | <!-- If a search request comes in and there is no current registered searcher, |
---|
226 | then immediately register the still warming searcher and use it. If |
---|
227 | "false" then all requests will block until the first searcher is done |
---|
228 | warming. --> |
---|
229 | <useColdSearcher>false</useColdSearcher> |
---|
230 | |
---|
231 | <!-- Maximum number of searchers that may be warming in the background |
---|
232 | concurrently. An error is returned if this limit is exceeded. Recommend |
---|
233 | 1-2 for read-only slaves, higher for masters w/o cache warming. --> |
---|
234 | <maxWarmingSearchers>2</maxWarmingSearchers> |
---|
235 | |
---|
236 | </query> |
---|
237 | |
---|
238 | <!-- |
---|
239 | Let the dispatch filter handler /select?qt=XXX |
---|
240 | handleSelect=true will use consistent error handling for /select and /update |
---|
241 | handleSelect=false will use solr1.1 style error formatting |
---|
242 | --> |
---|
243 | <requestDispatcher handleSelect="true" > |
---|
244 | <!--Make sure your system has some authentication before enabling remote streaming! --> |
---|
245 | <requestParsers enableRemoteStreaming="true" multipartUploadLimitInKB="2048000" /> |
---|
246 | |
---|
247 | <!-- Set HTTP caching related parameters (for proxy caches and clients). |
---|
248 | |
---|
249 | To get the behaviour of Solr 1.2 (ie: no caching related headers) |
---|
250 | use the never304="true" option and do not specify a value for |
---|
251 | <cacheControl> |
---|
252 | --> |
---|
253 | <!-- <httpCaching never304="true"> --> |
---|
254 | <httpCaching lastModifiedFrom="openTime" |
---|
255 | etagSeed="Solr"> |
---|
256 | <!-- lastModFrom="openTime" is the default, the Last-Modified value |
---|
257 | (and validation against If-Modified-Since requests) will all be |
---|
258 | relative to when the current Searcher was opened. |
---|
259 | You can change it to lastModFrom="dirLastMod" if you want the |
---|
260 | value to exactly corrispond to when the physical index was last |
---|
261 | modified. |
---|
262 | |
---|
263 | etagSeed="..." is an option you can change to force the ETag |
---|
264 | header (and validation against If-None-Match requests) to be |
---|
265 | differnet even if the index has not changed (ie: when making |
---|
266 | significant changes to your config file) |
---|
267 | |
---|
268 | lastModifiedFrom and etagSeed are both ignored if you use the |
---|
269 | never304="true" option. |
---|
270 | --> |
---|
271 | <!-- If you include a <cacheControl> directive, it will be used to |
---|
272 | generate a Cache-Control header, as well as an Expires header |
---|
273 | if the value contains "max-age=" |
---|
274 | |
---|
275 | By default, no Cache-Control header is generated. |
---|
276 | |
---|
277 | You can use the <cacheControl> option even if you have set |
---|
278 | never304="true" |
---|
279 | --> |
---|
280 | <!-- <cacheControl>max-age=30, public</cacheControl> --> |
---|
281 | </httpCaching> |
---|
282 | </requestDispatcher> |
---|
283 | |
---|
284 | |
---|
285 | <!-- requestHandler plugins... incoming queries will be dispatched to the |
---|
286 | correct handler based on the path or the 'qt' param. |
---|
287 | Names starting with a '/' are accessed with the a path equal to the |
---|
288 | registered name. Names without a leading '/' are accessed with: |
---|
289 | http://host/app/select?qt=name |
---|
290 | If no qt is defined, the requestHandler that declares default="true" |
---|
291 | will be used. |
---|
292 | --> |
---|
293 | <requestHandler name="standard" class="solr.SearchHandler" default="true"> |
---|
294 | <!-- default values for query parameters --> |
---|
295 | <lst name="defaults"> |
---|
296 | <str name="echoParams">explicit</str> |
---|
297 | <!-- |
---|
298 | <int name="rows">10</int> |
---|
299 | <str name="fl">*</str> |
---|
300 | <str name="version">2.1</str> |
---|
301 | --> |
---|
302 | </lst> |
---|
303 | </requestHandler> |
---|
304 | |
---|
305 | <!-- Please refer to http://wiki.apache.org/solr/SolrReplication for details on configuring replication --> |
---|
306 | <!--Master config--> |
---|
307 | <!-- |
---|
308 | <requestHandler name="/replication" class="solr.ReplicationHandler" > |
---|
309 | <lst name="master"> |
---|
310 | <str name="replicateAfter">commit</str> |
---|
311 | <str name="confFiles">schema.xml,stopwords.txt</str> |
---|
312 | </lst> |
---|
313 | </requestHandler> |
---|
314 | --> |
---|
315 | <!-- Slave config--> |
---|
316 | <!-- |
---|
317 | <requestHandler name="/replication" class="solr.ReplicationHandler"> |
---|
318 | <lst name="slave"> |
---|
319 | <str name="masterUrl">http://localhost:8983/solr/replication</str> |
---|
320 | <str name="pollInterval">00:00:60</str> |
---|
321 | </lst> |
---|
322 | </requestHandler> |
---|
323 | --> |
---|
324 | |
---|
325 | <!-- DisMaxRequestHandler allows easy searching across multiple fields |
---|
326 | for simple user-entered phrases. It's implementation is now |
---|
327 | just the standard SearchHandler with a default query parser |
---|
328 | of "dismax". |
---|
329 | see http://wiki.apache.org/solr/DisMaxRequestHandler |
---|
330 | --> |
---|
331 | <requestHandler name="dismax" class="solr.SearchHandler" > |
---|
332 | <lst name="defaults"> |
---|
333 | <str name="defType">dismax</str> |
---|
334 | <str name="echoParams">explicit</str> |
---|
335 | <float name="tie">0.01</float> |
---|
336 | <str name="qf"> |
---|
337 | text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4 |
---|
338 | </str> |
---|
339 | <str name="pf"> |
---|
340 | text^0.2 features^1.1 name^1.5 manu^1.4 manu_exact^1.9 |
---|
341 | </str> |
---|
342 | <str name="bf"> |
---|
343 | ord(popularity)^0.5 recip(rord(price),1,1000,1000)^0.3 |
---|
344 | </str> |
---|
345 | <str name="fl"> |
---|
346 | id,name,price,score |
---|
347 | </str> |
---|
348 | <str name="mm"> |
---|
349 | 2<-1 5<-2 6<90% |
---|
350 | </str> |
---|
351 | <int name="ps">100</int> |
---|
352 | <str name="q.alt">*:*</str> |
---|
353 | <!-- example highlighter config, enable per-query with hl=true --> |
---|
354 | <str name="hl.fl">text features name</str> |
---|
355 | <!-- for this field, we want no fragmenting, just highlighting --> |
---|
356 | <str name="f.name.hl.fragsize">0</str> |
---|
357 | <!-- instructs Solr to return the field itself if no query terms are |
---|
358 | found --> |
---|
359 | <str name="f.name.hl.alternateField">name</str> |
---|
360 | <str name="f.text.hl.fragmenter">regex</str> <!-- defined below --> |
---|
361 | </lst> |
---|
362 | </requestHandler> |
---|
363 | |
---|
364 | <!-- Note how you can register the same handler multiple times with |
---|
365 | different names (and different init parameters) |
---|
366 | --> |
---|
367 | <requestHandler name="partitioned" class="solr.SearchHandler" > |
---|
368 | <lst name="defaults"> |
---|
369 | <str name="defType">dismax</str> |
---|
370 | <str name="echoParams">explicit</str> |
---|
371 | <str name="qf">text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0</str> |
---|
372 | <str name="mm">2<-1 5<-2 6<90%</str> |
---|
373 | <!-- This is an example of using Date Math to specify a constantly |
---|
374 | moving date range in a config... |
---|
375 | --> |
---|
376 | <str name="bq">incubationdate_dt:[* TO NOW/DAY-1MONTH]^2.2</str> |
---|
377 | </lst> |
---|
378 | <!-- In addition to defaults, "appends" params can be specified |
---|
379 | to identify values which should be appended to the list of |
---|
380 | multi-val params from the query (or the existing "defaults"). |
---|
381 | |
---|
382 | In this example, the param "fq=instock:true" will be appended to |
---|
383 | any query time fq params the user may specify, as a mechanism for |
---|
384 | partitioning the index, independent of any user selected filtering |
---|
385 | that may also be desired (perhaps as a result of faceted searching). |
---|
386 | |
---|
387 | NOTE: there is *absolutely* nothing a client can do to prevent these |
---|
388 | "appends" values from being used, so don't use this mechanism |
---|
389 | unless you are sure you always want it. |
---|
390 | --> |
---|
391 | <lst name="appends"> |
---|
392 | <str name="fq">inStock:true</str> |
---|
393 | </lst> |
---|
394 | <!-- "invariants" are a way of letting the Solr maintainer lock down |
---|
395 | the options available to Solr clients. Any params values |
---|
396 | specified here are used regardless of what values may be specified |
---|
397 | in either the query, the "defaults", or the "appends" params. |
---|
398 | |
---|
399 | In this example, the facet.field and facet.query params are fixed, |
---|
400 | limiting the facets clients can use. Faceting is not turned on by |
---|
401 | default - but if the client does specify facet=true in the request, |
---|
402 | these are the only facets they will be able to see counts for; |
---|
403 | regardless of what other facet.field or facet.query params they |
---|
404 | may specify. |
---|
405 | |
---|
406 | NOTE: there is *absolutely* nothing a client can do to prevent these |
---|
407 | "invariants" values from being used, so don't use this mechanism |
---|
408 | unless you are sure you always want it. |
---|
409 | --> |
---|
410 | <lst name="invariants"> |
---|
411 | <str name="facet.field">cat</str> |
---|
412 | <str name="facet.field">manu_exact</str> |
---|
413 | <str name="facet.query">price:[* TO 500]</str> |
---|
414 | <str name="facet.query">price:[500 TO *]</str> |
---|
415 | </lst> |
---|
416 | </requestHandler> |
---|
417 | |
---|
418 | |
---|
419 | <!-- |
---|
420 | Search components are registered to SolrCore and used by Search Handlers |
---|
421 | |
---|
422 | By default, the following components are avaliable: |
---|
423 | |
---|
424 | <searchComponent name="query" class="org.apache.solr.handler.component.QueryComponent" /> |
---|
425 | <searchComponent name="facet" class="org.apache.solr.handler.component.FacetComponent" /> |
---|
426 | <searchComponent name="mlt" class="org.apache.solr.handler.component.MoreLikeThisComponent" /> |
---|
427 | <searchComponent name="highlight" class="org.apache.solr.handler.component.HighlightComponent" /> |
---|
428 | <searchComponent name="stats" class="org.apache.solr.handler.component.StatsComponent" /> |
---|
429 | <searchComponent name="debug" class="org.apache.solr.handler.component.DebugComponent" /> |
---|
430 | |
---|
431 | Default configuration in a requestHandler would look like: |
---|
432 | <arr name="components"> |
---|
433 | <str>query</str> |
---|
434 | <str>facet</str> |
---|
435 | <str>mlt</str> |
---|
436 | <str>highlight</str> |
---|
437 | <str>stats</str> |
---|
438 | <str>debug</str> |
---|
439 | </arr> |
---|
440 | |
---|
441 | If you register a searchComponent to one of the standard names, that will be used instead. |
---|
442 | To insert components before or after the 'standard' components, use: |
---|
443 | |
---|
444 | <arr name="first-components"> |
---|
445 | <str>myFirstComponentName</str> |
---|
446 | </arr> |
---|
447 | |
---|
448 | <arr name="last-components"> |
---|
449 | <str>myLastComponentName</str> |
---|
450 | </arr> |
---|
451 | --> |
---|
452 | |
---|
453 | <!-- The spell check component can return a list of alternative spelling |
---|
454 | suggestions. --> |
---|
455 | <searchComponent name="spellcheck" class="solr.SpellCheckComponent"> |
---|
456 | |
---|
457 | <str name="queryAnalyzerFieldType">textSpell</str> |
---|
458 | |
---|
459 | <lst name="spellchecker"> |
---|
460 | <str name="name">default</str> |
---|
461 | <str name="field">spell</str> |
---|
462 | <str name="spellcheckIndexDir">./spellchecker1</str> |
---|
463 | |
---|
464 | </lst> |
---|
465 | <lst name="spellchecker"> |
---|
466 | <str name="name">jarowinkler</str> |
---|
467 | <str name="field">spell</str> |
---|
468 | <!-- Use a different Distance Measure --> |
---|
469 | <str name="distanceMeasure">org.apache.lucene.search.spell.JaroWinklerDistance</str> |
---|
470 | <str name="spellcheckIndexDir">./spellchecker2</str> |
---|
471 | |
---|
472 | </lst> |
---|
473 | |
---|
474 | <lst name="spellchecker"> |
---|
475 | <str name="classname">solr.FileBasedSpellChecker</str> |
---|
476 | <str name="name">file</str> |
---|
477 | <str name="sourceLocation">spellings.txt</str> |
---|
478 | <str name="characterEncoding">UTF-8</str> |
---|
479 | <str name="spellcheckIndexDir">./spellcheckerFile</str> |
---|
480 | </lst> |
---|
481 | </searchComponent> |
---|
482 | |
---|
483 | <!-- A request handler utilizing the spellcheck component. |
---|
484 | ################################################################################################ |
---|
485 | NOTE: This is purely as an example. The whole purpose of the SpellCheckComponent is to hook it into |
---|
486 | the request handler that handles (i.e. the standard or dismax SearchHandler) |
---|
487 | queries such that a separate request is not needed to get suggestions. |
---|
488 | |
---|
489 | IN OTHER WORDS, THERE IS REALLY GOOD CHANCE THE SETUP BELOW IS NOT WHAT YOU WANT FOR YOUR PRODUCTION SYSTEM! |
---|
490 | ################################################################################################ |
---|
491 | --> |
---|
492 | <requestHandler name="/spellCheckCompRH" class="solr.SearchHandler"> |
---|
493 | <lst name="defaults"> |
---|
494 | <!-- omp = Only More Popular --> |
---|
495 | <str name="spellcheck.onlyMorePopular">false</str> |
---|
496 | <!-- exr = Extended Results --> |
---|
497 | <str name="spellcheck.extendedResults">false</str> |
---|
498 | <!-- The number of suggestions to return --> |
---|
499 | <str name="spellcheck.count">1</str> |
---|
500 | </lst> |
---|
501 | <arr name="last-components"> |
---|
502 | <str>spellcheck</str> |
---|
503 | </arr> |
---|
504 | </requestHandler> |
---|
505 | |
---|
506 | <requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler"> |
---|
507 | <lst name="defaults"> |
---|
508 | <str name="config">data-config.xml</str> |
---|
509 | </lst> |
---|
510 | </requestHandler> |
---|
511 | |
---|
512 | <searchComponent name="tvComponent" class="org.apache.solr.handler.component.TermVectorComponent"/> |
---|
513 | <!-- A Req Handler for working with the tvComponent. This is purely as an example. |
---|
514 | You will likely want to add the component to your already specified request handlers. --> |
---|
515 | <requestHandler name="tvrh" class="org.apache.solr.handler.component.SearchHandler"> |
---|
516 | <lst name="defaults"> |
---|
517 | <bool name="tv">true</bool> |
---|
518 | </lst> |
---|
519 | <arr name="last-components"> |
---|
520 | <str>tvComponent</str> |
---|
521 | </arr> |
---|
522 | </requestHandler> |
---|
523 | |
---|
524 | <!-- |
---|
525 | <requestHandler name="/update/extract" class="org.apache.solr.handler.extraction.ExtractingRequestHandler"> |
---|
526 | <lst name="defaults"> |
---|
527 | <str name="ext.map.Last-Modified">last_modified</str> |
---|
528 | <bool name="ext.ignore.und.fl">true</bool> |
---|
529 | </lst> |
---|
530 | </requestHandler> |
---|
531 | --> |
---|
532 | |
---|
533 | |
---|
534 | |
---|
535 | <searchComponent name="termsComp" class="org.apache.solr.handler.component.TermsComponent"/> |
---|
536 | |
---|
537 | <requestHandler name="/autoSuggest" class="org.apache.solr.handler.component.SearchHandler"> |
---|
538 | <arr name="components"> |
---|
539 | <str>termsComp</str> |
---|
540 | </arr> |
---|
541 | </requestHandler> |
---|
542 | |
---|
543 | |
---|
544 | <!-- Update request handler. |
---|
545 | |
---|
546 | Note: Since solr1.1 requestHandlers requires a valid content type header if posted in |
---|
547 | the body. For example, curl now requires: -H 'Content-type:text/xml; charset=utf-8' |
---|
548 | The response format differs from solr1.1 formatting and returns a standard error code. |
---|
549 | |
---|
550 | To enable solr1.1 behavior, remove the /update handler or change its path |
---|
551 | --> |
---|
552 | <requestHandler name="/update" class="solr.UpdateRequestHandler" /> |
---|
553 | |
---|
554 | |
---|
555 | <!-- |
---|
556 | Admin Handlers - This will register all the standard admin RequestHandlers. Adding |
---|
557 | this single handler is equivalent to registering: |
---|
558 | |
---|
559 | <requestHandler name="/admin/luke" class="org.apache.solr.handler.admin.LukeRequestHandler" /> |
---|
560 | <requestHandler name="/admin/system" class="org.apache.solr.handler.admin.SystemInfoHandler" /> |
---|
561 | <requestHandler name="/admin/plugins" class="org.apache.solr.handler.admin.PluginInfoHandler" /> |
---|
562 | <requestHandler name="/admin/threads" class="org.apache.solr.handler.admin.ThreadDumpHandler" /> |
---|
563 | <requestHandler name="/admin/properties" class="org.apache.solr.handler.admin.PropertiesRequestHandler" /> |
---|
564 | <requestHandler name="/admin/file" class="org.apache.solr.handler.admin.ShowFileRequestHandler" > |
---|
565 | |
---|
566 | If you wish to hide files under ${solr.home}/conf, explicitly register the ShowFileRequestHandler using: |
---|
567 | <requestHandler name="/admin/file" class="org.apache.solr.handler.admin.ShowFileRequestHandler" > |
---|
568 | <lst name="invariants"> |
---|
569 | <str name="hidden">synonyms.txt</str> |
---|
570 | <str name="hidden">anotherfile.txt</str> |
---|
571 | </lst> |
---|
572 | </requestHandler> |
---|
573 | --> |
---|
574 | <requestHandler name="/admin/" class="org.apache.solr.handler.admin.AdminHandlers" /> |
---|
575 | |
---|
576 | <!-- Echo the request contents back to the client --> |
---|
577 | <requestHandler name="/debug/dump" class="solr.DumpRequestHandler" > |
---|
578 | <lst name="defaults"> |
---|
579 | <str name="echoParams">explicit</str> <!-- for all params (including the default etc) use: 'all' --> |
---|
580 | <str name="echoHandler">true</str> |
---|
581 | </lst> |
---|
582 | </requestHandler> |
---|
583 | |
---|
584 | <highlighting> |
---|
585 | <!-- Configure the standard fragmenter --> |
---|
586 | <!-- This could most likely be commented out in the "default" case --> |
---|
587 | <fragmenter name="gap" class="org.apache.solr.highlight.GapFragmenter" default="true"> |
---|
588 | <lst name="defaults"> |
---|
589 | <int name="hl.fragsize">100</int> |
---|
590 | </lst> |
---|
591 | </fragmenter> |
---|
592 | |
---|
593 | <!-- A regular-expression-based fragmenter (f.i., for sentence extraction) --> |
---|
594 | <fragmenter name="regex" class="org.apache.solr.highlight.RegexFragmenter"> |
---|
595 | <lst name="defaults"> |
---|
596 | <!-- slightly smaller fragsizes work better because of slop --> |
---|
597 | <int name="hl.fragsize">70</int> |
---|
598 | <!-- allow 50% slop on fragment sizes --> |
---|
599 | <float name="hl.regex.slop">0.5</float> |
---|
600 | <!-- a basic sentence pattern --> |
---|
601 | <str name="hl.regex.pattern">[-\w ,/\n\"']{20,200}</str> |
---|
602 | </lst> |
---|
603 | </fragmenter> |
---|
604 | |
---|
605 | <!-- Configure the standard formatter --> |
---|
606 | <formatter name="html" class="org.apache.solr.highlight.HtmlFormatter" default="true"> |
---|
607 | <lst name="defaults"> |
---|
608 | <str name="hl.simple.pre"><![CDATA[<em>]]></str> |
---|
609 | <str name="hl.simple.post"><![CDATA[</em>]]></str> |
---|
610 | </lst> |
---|
611 | </formatter> |
---|
612 | </highlighting> |
---|
613 | |
---|
614 | <!-- An example dedup update processor that creates the "id" field on the fly |
---|
615 | based on the hash code of some other fields. This example has overwriteDupes |
---|
616 | set to false since we are using the id field as the signatureField and Solr |
---|
617 | will maintain uniqueness based on that anyway. --> |
---|
618 | <!-- |
---|
619 | <updateRequestProcessorChain name="dedupe"> |
---|
620 | <processor class="org.apache.solr.update.processor.SignatureUpdateProcessorFactory"> |
---|
621 | <bool name="enabled">true</bool> |
---|
622 | <str name="signatureField">id</str> |
---|
623 | <bool name="overwriteDupes">false</bool> |
---|
624 | <str name="fields">name,features,cat</str> |
---|
625 | <str name="signatureClass">org.apache.solr.update.processor.Lookup3Signature</str> |
---|
626 | </processor> |
---|
627 | <processor class="solr.LogUpdateProcessorFactory" /> |
---|
628 | <processor class="solr.RunUpdateProcessorFactory" /> |
---|
629 | </updateRequestProcessorChain> |
---|
630 | --> |
---|
631 | |
---|
632 | |
---|
633 | <!-- queryResponseWriter plugins... query responses will be written using the |
---|
634 | writer specified by the 'wt' request parameter matching the name of a registered |
---|
635 | writer. |
---|
636 | The "default" writer is the default and will be used if 'wt' is not specified |
---|
637 | in the request. XMLResponseWriter will be used if nothing is specified here. |
---|
638 | The json, python, and ruby writers are also available by default. |
---|
639 | |
---|
640 | <queryResponseWriter name="xml" class="solr.XMLResponseWriter" default="true"/> |
---|
641 | <queryResponseWriter name="json" class="solr.JSONResponseWriter"/> |
---|
642 | <queryResponseWriter name="python" class="solr.PythonResponseWriter"/> |
---|
643 | <queryResponseWriter name="ruby" class="solr.RubyResponseWriter"/> |
---|
644 | <queryResponseWriter name="php" class="solr.PHPResponseWriter"/> |
---|
645 | <queryResponseWriter name="phps" class="solr.PHPSerializedResponseWriter"/> |
---|
646 | |
---|
647 | <queryResponseWriter name="custom" class="com.example.MyResponseWriter"/> |
---|
648 | --> |
---|
649 | |
---|
650 | <!-- XSLT response writer transforms the XML output by any xslt file found |
---|
651 | in Solr's conf/xslt directory. Changes to xslt files are checked for |
---|
652 | every xsltCacheLifetimeSeconds. |
---|
653 | --> |
---|
654 | <queryResponseWriter name="xslt" class="solr.XSLTResponseWriter"> |
---|
655 | <int name="xsltCacheLifetimeSeconds">5</int> |
---|
656 | </queryResponseWriter> |
---|
657 | |
---|
658 | |
---|
659 | <!-- example of registering a query parser |
---|
660 | <queryParser name="lucene" class="org.apache.solr.search.LuceneQParserPlugin"/> |
---|
661 | --> |
---|
662 | |
---|
663 | <!-- example of registering a custom function parser |
---|
664 | <valueSourceParser name="myfunc" class="com.mycompany.MyValueSourceParser" /> |
---|
665 | --> |
---|
666 | |
---|
667 | <!-- config for the admin interface --> |
---|
668 | <admin> |
---|
669 | <defaultQuery>solr</defaultQuery> |
---|
670 | </admin> |
---|
671 | |
---|
672 | </config> |
---|