source: vlo/branches/vlo-3.3/vlo-solr/src/main/solr_conf/solr/collection1/conf/solrconfig.xml @ 6658

Last change on this file since 6658 was 6658, checked in by Twan Goosen, 9 years ago

Added an additional 'fast' solr request handler for use during import

File size: 41.9 KB
Line 
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     For more details about configurations options that may appear in this
20     file, see http://wiki.apache.org/solr/SolrConfigXml.
21
22     Specifically, the Solr Config can support XInclude, which may make it easier to manage
23     the configuration.  See https://issues.apache.org/jira/browse/SOLR-1167
24-->
25<config>
26    <luceneMatchVersion>4.8</luceneMatchVersion>
27   
28  <!-- Set this to 'false' if you want solr to continue working after it has
29       encountered an severe configuration error.  In a production environment,
30       you may want solr to keep working even if one handler is mis-configured.
31
32       You may also set this to false using by setting the system property:
33         -Dsolr.abortOnConfigurationError=false
34     -->
35  <abortOnConfigurationError>${solr.abortOnConfigurationError:true}</abortOnConfigurationError>
36
37  <!-- lib directives can be used to instruct Solr to load an Jars identified
38       and use them to resolve any "plugins" specified in your solrconfig.xml or
39       schema.xml (ie: Analyzers, Request Handlers, etc...).
40
41       All directories and paths are resolved relative the instanceDir.
42
43       If a "./lib" directory exists in your instanceDir, all files found in it
44       are included as if you had used the following syntax...
45       
46              <lib dir="./lib" />
47    -->
48  <!-- A dir option by itself adds any files found in the directory to the
49       classpath, this is useful for including all jars in a directory.
50    -->
51  <!--<lib dir="../../contrib/extraction/lib" />-->
52  <!-- When a regex is specified in addition to a directory, only the files in that
53       directory which completely match the regex (anchored on both ends)
54       will be included.
55    -->
56  <!--<lib dir="../../dist/" regex="apache-solr-cell-\d.*\.jar" />
57  <lib dir="../../dist/" regex="apache-solr-clustering-\d.*\.jar" />-->
58  <!-- If a dir option (with or without a regex) is used and nothing is found
59       that matches, it will be ignored
60    -->
61  <!--<lib dir="../../contrib/clustering/lib/downloads/" />
62  <lib dir="../../contrib/clustering/lib/" />
63  <lib dir="/total/crap/dir/ignored" /> -->
64  <!-- an exact path can be used to specify a specific file.  This will cause
65       a serious error to be logged if it can't be loaded.
66  <lib path="../a-jar-that-does-not-exist.jar" />
67  -->
68
69 
70  <!-- Used to specify an alternate directory to hold all index data
71       other than the default ./data under the Solr home.
72       If replication is in use, this should match the replication configuration.
73       
74       Property must be set as a java system property. In the case of
75       Tomcat, add a line to ${catalin.home}/bin/setenv.sh, e.g.:
76         export JAVA_OPTS="$JAVA_OPTS -Dsolr.data.dir=/var/vlo/solr/data"
77  -->
78   <dataDir>${solr.data.dir}</dataDir>
79
80  <!--  Enables JMX if and only if an existing MBeanServer is found, use this
81    if you want to configure JMX through JVM parameters. Remove this to disable
82    exposing Solr configuration and statistics to JMX.
83
84                If you want to connect to a particular server, specify the agentId
85                e.g. <jmx agentId="myAgent" />
86
87                If you want to start a new MBeanServer, specify the serviceUrl
88                e.g <jmx serviceUrl="service:jmx:rmi:///jndi/rmi://localhost:9999/solr"/>
89
90                For more details see http://wiki.apache.org/solr/SolrJmx
91  -->
92  <jmx />
93
94  <!-- the default high-performance update handler -->
95  <updateHandler class="solr.DirectUpdateHandler2">
96    <!-- A prefix of "solr." for class names is an alias that
97         causes solr to search appropriate packages, including
98         org.apache.solr.(search|update|request|core|analysis)
99     -->
100
101    <!-- Perform a <commit/> automatically under certain conditions:
102         maxDocs - number of updates since last commit is greater than this
103         maxTime - oldest uncommited update (in ms) is this long ago
104         Instead of enabling autoCommit, consider using "commitWithin"
105         when adding documents. http://wiki.apache.org/solr/UpdateXmlMessages
106    <autoCommit>
107      <maxDocs>10000</maxDocs>
108      <maxTime>1000</maxTime>
109    </autoCommit>
110    -->
111
112
113    <!-- The RunExecutableListener executes an external command from a
114      hook such as postCommit or postOptimize.
115         exe - the name of the executable to run
116         dir - dir to use as the current working directory. default="."
117         wait - the calling thread waits until the executable returns. default="true"
118         args - the arguments to pass to the program.  default=nothing
119         env - environment variables to set.  default=nothing
120      -->
121    <!-- A postCommit event is fired after every commit or optimize command
122    <listener event="postCommit" class="solr.RunExecutableListener">
123      <str name="exe">solr/bin/snapshooter</str>
124      <str name="dir">.</str>
125      <bool name="wait">true</bool>
126      <arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
127      <arr name="env"> <str>MYVAR=val1</str> </arr>
128    </listener>
129    -->
130    <!-- A postOptimize event is fired only after every optimize command
131    <listener event="postOptimize" class="solr.RunExecutableListener">
132      <str name="exe">snapshooter</str>
133      <str name="dir">solr/bin</str>
134      <bool name="wait">true</bool>
135    </listener>
136    -->
137  </updateHandler>
138 
139  <!-- Use the following format to specify a custom IndexReaderFactory - allows for alternate
140       IndexReader implementations.
141
142       ** Experimental Feature **
143       Please note - Using a custom IndexReaderFactory may prevent certain other features
144       from working. The API to IndexReaderFactory may change without warning or may even
145       be removed from future releases if the problems cannot be resolved.
146
147       ** Features that may not work with custom IndexReaderFactory **
148       The ReplicationHandler assumes a disk-resident index. Using a custom
149       IndexReader implementation may cause incompatibility with ReplicationHandler and
150       may cause replication to not work correctly. See SOLR-1366 for details.
151
152  <indexReaderFactory name="IndexReaderFactory" class="package.class">
153    Parameters as required by the implementation
154  </indexReaderFactory >
155  -->
156  <!-- To set the termInfosIndexDivisor, do this: -->
157  <!--<indexReaderFactory name="IndexReaderFactory" class="org.apache.solr.core.StandardIndexReaderFactory">
158    <int name="termInfosIndexDivisor">12</int>
159  </indexReaderFactory >-->
160
161
162  <query>
163    <!-- Maximum number of clauses in a boolean query... in the past, this affected
164        range or prefix queries that expanded to big boolean queries - built in Solr
165        query parsers no longer create queries with this limitation.
166        An exception is thrown if exceeded.  -->
167    <maxBooleanClauses>1024</maxBooleanClauses>
168
169
170    <!-- There are two implementations of cache available for Solr,
171         LRUCache, based on a synchronized LinkedHashMap, and
172         FastLRUCache, based on a ConcurrentHashMap.  FastLRUCache has faster gets
173         and slower puts in single threaded operation and thus is generally faster
174         than LRUCache when the hit ratio of the cache is high (> 75%), and may be
175         faster under other scenarios on multi-cpu systems. -->
176    <!-- Cache used by SolrIndexSearcher for filters (DocSets),
177         unordered sets of *all* documents that match a query.
178         When a new searcher is opened, its caches may be prepopulated
179         or "autowarmed" using data from caches in the old searcher.
180         autowarmCount is the number of items to prepopulate.  For LRUCache,
181         the autowarmed items will be the most recently accessed items.
182       Parameters:
183         class - the SolrCache implementation LRUCache or FastLRUCache
184         size - the maximum number of entries in the cache
185         initialSize - the initial capacity (number of entries) of
186           the cache.  (seel java.util.HashMap)
187         autowarmCount - the number of entries to prepopulate from
188           and old cache.
189         -->
190    <filterCache
191      class="solr.FastLRUCache"
192      size="512"
193      initialSize="512"
194      autowarmCount="0"/>
195
196    <!-- Cache used to hold field values that are quickly accessible
197         by document id.  The fieldValueCache is created by default
198         even if not configured here.
199      <fieldValueCache
200        class="solr.FastLRUCache"
201        size="512"
202        autowarmCount="128"
203        showItems="32"
204      />
205    -->
206
207   <!-- queryResultCache caches results of searches - ordered lists of
208         document ids (DocList) based on a query, a sort, and the range
209         of documents requested.  -->
210    <queryResultCache
211      class="solr.LRUCache"
212      size="512"
213      initialSize="512"
214      autowarmCount="0"/>
215
216  <!-- documentCache caches Lucene Document objects (the stored fields for each document).
217       Since Lucene internal document ids are transient, this cache will not be autowarmed.  -->
218    <documentCache
219      class="solr.LRUCache"
220      size="512"
221      initialSize="512"
222      autowarmCount="0"/>
223
224    <!-- If true, stored fields that are not requested will be loaded lazily.
225      This can result in a significant speed improvement if the usual case is to
226      not load all stored fields, especially if the skipped fields are large
227      compressed text fields.
228    -->
229    <enableLazyFieldLoading>true</enableLazyFieldLoading>
230
231    <!-- Example of a generic cache.  These caches may be accessed by name
232         through SolrIndexSearcher.getCache(),cacheLookup(), and cacheInsert().
233         The purpose is to enable easy caching of user/application level data.
234         The regenerator argument should be specified as an implementation
235         of solr.search.CacheRegenerator if autowarming is desired.  -->
236    <!--
237    <cache name="myUserCache"
238      class="solr.LRUCache"
239      size="4096"
240      initialSize="1024"
241      autowarmCount="1024"
242      regenerator="org.mycompany.mypackage.MyRegenerator"
243      />
244    -->
245
246   <!-- An optimization that attempts to use a filter to satisfy a search.
247         If the requested sort does not include score, then the filterCache
248         will be checked for a filter matching the query. If found, the filter
249         will be used as the source of document ids, and then the sort will be
250         applied to that.
251    <useFilterForSortedQuery>true</useFilterForSortedQuery>
252   -->
253
254   <!-- An optimization for use with the queryResultCache.  When a search
255         is requested, a superset of the requested number of document ids
256         are collected.  For example, if a search for a particular query
257         requests matching documents 10 through 19, and queryWindowSize is 50,
258         then documents 0 through 49 will be collected and cached.  Any further
259         requests in that range can be satisfied via the cache.  -->
260    <queryResultWindowSize>20</queryResultWindowSize>
261
262    <!-- Maximum number of documents to cache for any entry in the
263         queryResultCache. -->
264    <queryResultMaxDocsCached>200</queryResultMaxDocsCached>
265
266    <!-- a newSearcher event is fired whenever a new searcher is being prepared
267      and there is a current searcher handling requests (aka registered).
268      It can be used to prime certain caches to prevent long request times for
269      certain requests.
270    -->
271    <!-- QuerySenderListener takes an array of NamedList and executes a
272         local query request for each NamedList in sequence. -->
273    <listener event="newSearcher" class="solr.QuerySenderListener">
274      <arr name="queries">
275        <!--
276        <lst> <str name="q">solr</str> <str name="start">0</str> <str name="rows">10</str> </lst>
277        <lst> <str name="q">rocks</str> <str name="start">0</str> <str name="rows">10</str> </lst>
278        <lst><str name="q">static newSearcher warming query from solrconfig.xml</str></lst>
279        -->
280      </arr>
281    </listener>
282
283    <!-- a firstSearcher event is fired whenever a new searcher is being
284         prepared but there is no current registered searcher to handle
285         requests or to gain autowarming data from. -->
286    <listener event="firstSearcher" class="solr.QuerySenderListener">
287      <arr name="queries">
288        <lst> <str name="q">solr rocks</str><str name="start">0</str><str name="rows">10</str></lst>
289        <lst><str name="q">static firstSearcher warming query from solrconfig.xml</str></lst>
290      </arr>
291    </listener>
292
293    <!-- If a search request comes in and there is no current registered searcher,
294         then immediately register the still warming searcher and use it.  If
295         "false" then all requests will block until the first searcher is done
296         warming. -->
297    <useColdSearcher>false</useColdSearcher>
298
299    <!-- Maximum number of searchers that may be warming in the background
300      concurrently.  An error is returned if this limit is exceeded. Recommend
301      1-2 for read-only slaves, higher for masters w/o cache warming. -->
302    <maxWarmingSearchers>2</maxWarmingSearchers>
303
304  </query>
305
306  <!--
307    Let the dispatch filter handler /select?qt=XXX
308    handleSelect=true will use consistent error handling for /select and /update
309    handleSelect=false will use solr1.1 style error formatting
310    -->
311  <requestDispatcher handleSelect="true" >
312    <!--Make sure your system has some authentication before enabling remote streaming!  -->
313    <requestParsers enableRemoteStreaming="true" multipartUploadLimitInKB="2048000" />
314
315    <!-- Set HTTP caching related parameters (for proxy caches and clients).
316         
317         To get the behaviour of Solr 1.2 (ie: no caching related headers)
318         use the never304="true" option and do not specify a value for
319         <cacheControl>
320    -->
321    <!-- <httpCaching never304="true"> -->
322    <httpCaching lastModifiedFrom="openTime"
323                 etagSeed="Solr">
324       <!-- lastModFrom="openTime" is the default, the Last-Modified value
325            (and validation against If-Modified-Since requests) will all be
326            relative to when the current Searcher was opened.
327            You can change it to lastModFrom="dirLastMod" if you want the
328            value to exactly corrispond to when the physical index was last
329            modified.
330
331            etagSeed="..." is an option you can change to force the ETag
332            header (and validation against If-None-Match requests) to be
333            differnet even if the index has not changed (ie: when making
334            significant changes to your config file)
335
336            lastModifiedFrom and etagSeed are both ignored if you use the
337            never304="true" option.
338       -->
339       <!-- If you include a <cacheControl> directive, it will be used to
340            generate a Cache-Control header, as well as an Expires header
341            if the value contains "max-age="
342
343            By default, no Cache-Control header is generated.
344
345            You can use the <cacheControl> option even if you have set
346            never304="true"
347       -->
348       <!-- <cacheControl>max-age=30, public</cacheControl> -->
349    </httpCaching>
350  </requestDispatcher>
351
352
353  <!-- requestHandler plugins... incoming queries will be dispatched to the
354     correct handler based on the path or the qt (query type) param.
355     Names starting with a '/' are accessed with the a path equal to the
356     registered name.  Names without a leading '/' are accessed with:
357      http://host/app/select?qt=name
358     If no qt is defined, the requestHandler that declares default="true"
359     will be used.
360  -->
361  <requestHandler name="standard" class="solr.SearchHandler" default="true">
362    <!-- default values for query parameters -->
363     <lst name="defaults">
364        <str name="echoParams">explicit</str>
365       
366        <!-- See https://wiki.apache.org/solr/DisMaxQParserPlugin -->
367        <str name="defType">edismax</str>
368       
369        <!-- 'Fetch all documents' query -->
370        <str name="q.alt">*:*</str>
371       
372        <!-- Query fields -->
373        <str name="qf">
374           text name^8 description^4 keywords^2 language^2 country^2 organisation^2 subject^2 collection^1 modality^1 genre^1 continent^.5 id^.1
375        </str>
376       
377        <!-- alias: language = _languageName -->
378        <str name="f.language.qf">
379            _languageName
380        </str>
381       
382        <!-- alias: language = _languageName -->
383        <str name="f.resourcetype.qf">
384            resourceClass
385        </str>
386       
387        <!-- alias: language = _languageName -->
388        <str name="f.resources.qf">
389            _resourceRefCount
390        </str>
391       
392        <!-- Phrase fields (boost if phrase is matched) -->
393        <str name="pf">
394            name^2 description
395        </str>
396       
397        <!-- Boost fields (boost based on field value regardless of query) -->
398        <str name="bf">
399            <!--
400                boost by hierarchy weight (reverse order because lower numbers
401                indicate a higher level), then by number of parts (differentiate
402                up till 50) -->
403            rord(_hierarchyWeight) log(add(1,min(50,_hasPartCount)))^.1
404            <!-- TODO: prefer CLARIN records over non-CLARIN? -->
405            <!-- TODO: boost records with one or more resources (_resourceRefCount) -->
406        </str>
407       
408        <!-- boost fields with a name -->
409        <str name="bq">
410            name:[* TO *]^2
411        </str>
412
413        <!-- boost fields with a description -->
414        <str name="bq">
415            description:[* TO *]
416        </str>
417       
418        <!-- boost fields with a resource or part -->
419        <str name="bq">
420            _hasPart:[* TO *] OR _resourceRef:[* TO *]
421        </str>
422       
423          <!--
424          <int name="rows">10</int>
425          <str name="fl">*</str>
426          <str name="version">2.1</str>
427           -->
428     </lst>
429  </requestHandler>
430 
431  <requestHandler name="fast" class="solr.SearchHandler" default="false">
432    <!-- default values for query parameters -->
433     <lst name="defaults">
434       <str name="echoParams">explicit</str>
435       <!--
436       <int name="rows">10</int>
437       <str name="fl">*</str>
438       <str name="version">2.1</str>
439        -->
440     </lst>
441  </requestHandler>
442
443
444 <!-- <requestHandler name="/dataimport"
445        class="org.apache.solr.handler.dataimport.DataImportHandler">
446        <lst name="defaults">
447                <str name="config">data-config.xml</str>
448        </lst>
449   </requestHandler> -->
450
451<!-- Please refer to http://wiki.apache.org/solr/SolrReplication for details on configuring replication -->
452<!-- remove the <lst name="master"> section if this is just a slave -->
453<!-- remove  the <lst name="slave"> section if this is just a master -->
454<!--
455<requestHandler name="/replication" class="solr.ReplicationHandler" >
456    <lst name="master">
457      <str name="replicateAfter">commit</str>
458      <str name="replicateAfter">startup</str>
459      <str name="confFiles">schema.xml,stopwords.txt</str>
460    </lst>
461    <lst name="slave">
462      <str name="masterUrl">http://localhost:8983/solr/replication</str>
463      <str name="pollInterval">00:00:60</str>
464    </lst>
465</requestHandler>-->
466
467  <!-- DisMaxRequestHandler allows easy searching across multiple fields
468       for simple user-entered phrases.  It's implementation is now
469       just the standard SearchHandler with a default query type
470       of "dismax".
471       see http://wiki.apache.org/solr/DisMaxRequestHandler
472   -->
473  <requestHandler name="dismax" class="solr.SearchHandler" >
474    <lst name="defaults">
475     <str name="defType">dismax</str>
476     <str name="echoParams">explicit</str>
477     <float name="tie">0.01</float>
478     <str name="qf">
479        text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
480     </str>
481     <str name="pf">
482        text^0.2 features^1.1 name^1.5 manu^1.4 manu_exact^1.9
483     </str>
484     <str name="bf">
485        popularity^0.5 recip(price,1,1000,1000)^0.3
486     </str>
487     <str name="fl">
488        id,name,price,score
489     </str>
490     <str name="mm">
491        2&lt;-1 5&lt;-2 6&lt;90%
492     </str>
493     <int name="ps">100</int>
494     <str name="q.alt">*:*</str>
495     <!-- example highlighter config, enable per-query with hl=true -->
496     <str name="hl.fl">text features name</str>
497     <!-- for this field, we want no fragmenting, just highlighting -->
498     <str name="f.name.hl.fragsize">0</str>
499     <!-- instructs Solr to return the field itself if no query terms are
500          found -->
501     <str name="f.name.hl.alternateField">name</str>
502     <str name="f.text.hl.fragmenter">regex</str> <!-- defined below -->
503    </lst>
504  </requestHandler>
505
506  <!-- Note how you can register the same handler multiple times with
507       different names (and different init parameters)
508    -->
509  <requestHandler name="partitioned" class="solr.SearchHandler" >
510    <lst name="defaults">
511     <str name="defType">dismax</str>
512     <str name="echoParams">explicit</str>
513     <str name="qf">text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0</str>
514     <str name="mm">2&lt;-1 5&lt;-2 6&lt;90%</str>
515     <!-- This is an example of using Date Math to specify a constantly
516          moving date range in a config...
517       -->
518     <str name="bq">incubationdate_dt:[* TO NOW/DAY-1MONTH]^2.2</str>
519    </lst>
520    <!-- In addition to defaults, "appends" params can be specified
521         to identify values which should be appended to the list of
522         multi-val params from the query (or the existing "defaults").
523
524         In this example, the param "fq=instock:true" will be appended to
525         any query time fq params the user may specify, as a mechanism for
526         partitioning the index, independent of any user selected filtering
527         that may also be desired (perhaps as a result of faceted searching).
528
529         NOTE: there is *absolutely* nothing a client can do to prevent these
530         "appends" values from being used, so don't use this mechanism
531         unless you are sure you always want it.
532      -->
533    <lst name="appends">
534      <str name="fq">inStock:true</str>
535    </lst>
536    <!-- "invariants" are a way of letting the Solr maintainer lock down
537         the options available to Solr clients.  Any params values
538         specified here are used regardless of what values may be specified
539         in either the query, the "defaults", or the "appends" params.
540
541         In this example, the facet.field and facet.query params are fixed,
542         limiting the facets clients can use.  Faceting is not turned on by
543         default - but if the client does specify facet=true in the request,
544         these are the only facets they will be able to see counts for;
545         regardless of what other facet.field or facet.query params they
546         may specify.
547
548         NOTE: there is *absolutely* nothing a client can do to prevent these
549         "invariants" values from being used, so don't use this mechanism
550         unless you are sure you always want it.
551      -->
552    <lst name="invariants">
553      <str name="facet.field">cat</str>
554      <str name="facet.field">manu_exact</str>
555      <str name="facet.query">price:[* TO 500]</str>
556      <str name="facet.query">price:[500 TO *]</str>
557    </lst>
558  </requestHandler>
559
560
561  <!--
562   Search components are registered to SolrCore and used by Search Handlers
563   
564   By default, the following components are avaliable:
565   
566   <searchComponent name="query"     class="org.apache.solr.handler.component.QueryComponent" />
567   <searchComponent name="facet"     class="org.apache.solr.handler.component.FacetComponent" />
568   <searchComponent name="mlt"       class="org.apache.solr.handler.component.MoreLikeThisComponent" />
569   <searchComponent name="highlight" class="org.apache.solr.handler.component.HighlightComponent" />
570   <searchComponent name="stats"     class="org.apache.solr.handler.component.StatsComponent" />
571   <searchComponent name="debug"     class="org.apache.solr.handler.component.DebugComponent" />
572   
573   Default configuration in a requestHandler would look like:
574    <arr name="components">
575      <str>query</str>
576      <str>facet</str>
577      <str>mlt</str>
578      <str>highlight</str>
579      <str>stats</str>
580      <str>debug</str>
581    </arr>
582
583    If you register a searchComponent to one of the standard names, that will be used instead.
584    To insert components before or after the 'standard' components, use:
585   
586    <arr name="first-components">
587      <str>myFirstComponentName</str>
588    </arr>
589   
590    <arr name="last-components">
591      <str>myLastComponentName</str>
592    </arr>
593  -->
594
595   <!-- The spell check component can return a list of alternative spelling
596  suggestions.  -->
597  <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
598
599    <str name="queryAnalyzerFieldType">textSpell</str>
600
601    <lst name="spellchecker">
602      <str name="name">default</str>
603      <str name="field">name</str>
604      <str name="spellcheckIndexDir">./spellchecker</str>
605    </lst>
606
607    <!-- a spellchecker that uses a different distance measure
608    <lst name="spellchecker">
609      <str name="name">jarowinkler</str>
610      <str name="field">spell</str>
611      <str name="distanceMeasure">org.apache.lucene.search.spell.JaroWinklerDistance</str>
612      <str name="spellcheckIndexDir">./spellchecker2</str>
613    </lst>
614     -->
615
616    <!-- a file based spell checker
617    <lst name="spellchecker">
618      <str name="classname">solr.FileBasedSpellChecker</str>
619      <str name="name">file</str>
620      <str name="sourceLocation">spellings.txt</str>
621      <str name="characterEncoding">UTF-8</str>
622      <str name="spellcheckIndexDir">./spellcheckerFile</str>
623    </lst>
624    -->
625  </searchComponent>
626
627  <!-- A request handler utilizing the spellcheck component. 
628  #############################################################################
629  NOTE: This is purely as an example.  The whole purpose of the
630  SpellCheckComponent is to hook it into the request handler that handles (i.e.
631  the standard or dismax SearchHandler) queries such that a separate request is
632  not needed to get suggestions.
633
634  IN OTHER WORDS, THERE IS REALLY GOOD CHANCE THE SETUP BELOW IS NOT WHAT YOU
635  WANT FOR YOUR PRODUCTION SYSTEM!
636  #############################################################################
637  -->
638  <requestHandler name="/spell" class="solr.SearchHandler" lazy="true">
639    <lst name="defaults">
640      <!-- omp = Only More Popular -->
641      <str name="spellcheck.onlyMorePopular">false</str>
642      <!-- exr = Extended Results -->
643      <str name="spellcheck.extendedResults">false</str>
644      <!--  The number of suggestions to return -->
645      <str name="spellcheck.count">1</str>
646    </lst>
647    <arr name="last-components">
648      <str>spellcheck</str>
649    </arr>
650  </requestHandler>
651
652  <searchComponent name="tvComponent" class="org.apache.solr.handler.component.TermVectorComponent"/>
653  <!-- A Req Handler for working with the tvComponent.  This is purely as an example.
654  You will likely want to add the component to your already specified request handlers. -->
655  <requestHandler name="tvrh" class="org.apache.solr.handler.component.SearchHandler">
656    <lst name="defaults">
657      <bool name="tv">true</bool>
658    </lst>
659    <arr name="last-components">
660      <str>tvComponent</str>
661    </arr>
662  </requestHandler>
663 
664 
665  <!-- a suggester component for autocomplete -->
666  <searchComponent class="solr.SpellCheckComponent" name="suggest">
667    <lst name="spellchecker">
668        <str name="name">suggest</str>
669        <str name="classname">org.apache.solr.spelling.suggest.Suggester</str>
670        <str name="lookupImpl">org.apache.solr.spelling.suggest.tst.TSTLookup</str>
671        <str name="field">_suggester</str>
672    </lst>
673  </searchComponent>
674  <!-- Req Handler for suggest searchComponent -->
675  <requestHandler class="org.apache.solr.handler.component.SearchHandler" name="/suggest">
676    <lst name="defaults">
677      <str name="spellcheck">true</str>
678      <str name="spellcheck.dictionary">suggest</str>
679      <str name="spellcheck.onlyMorePopular">true</str>
680      <str name="spellcheck.count">5</str>
681    </lst>
682    <arr name="components">
683      <str>suggest</str>
684    </arr>
685  </requestHandler>
686 
687
688  <!-- Clustering Component
689       http://wiki.apache.org/solr/ClusteringComponent
690       This relies on third party jars which are not included in the release.
691       To use this component (and the "/clustering" handler)
692       Those jars will need to be downloaded, and you'll need to set the
693       solr.cluster.enabled system property when running solr...
694          java -Dsolr.clustering.enabled=true -jar start.jar
695    -->
696  <searchComponent
697    name="clusteringComponent"
698    enable="${solr.clustering.enabled:false}"
699    class="org.apache.solr.handler.clustering.ClusteringComponent" >
700    <!-- Declare an engine -->
701    <lst name="engine">
702      <!-- The name, only one can be named "default" -->
703      <str name="name">default</str>
704      <!--
705           Class name of Carrot2 clustering algorithm. Currently available algorithms are:
706           
707           * org.carrot2.clustering.lingo.LingoClusteringAlgorithm
708           * org.carrot2.clustering.stc.STCClusteringAlgorithm
709           
710           See http://project.carrot2.org/algorithms.html for the algorithm's characteristics.
711        -->
712      <str name="carrot.algorithm">org.carrot2.clustering.lingo.LingoClusteringAlgorithm</str>
713      <!--
714           Overriding values for Carrot2 default algorithm attributes. For a description
715           of all available attributes, see: http://download.carrot2.org/stable/manual/#chapter.components.
716           Use attribute key as name attribute of str elements below. These can be further
717           overridden for individual requests by specifying attribute key as request
718           parameter name and attribute value as parameter value.
719        -->
720      <str name="LingoClusteringAlgorithm.desiredClusterCountBase">20</str>
721    </lst>
722    <lst name="engine">
723      <str name="name">stc</str>
724      <str name="carrot.algorithm">org.carrot2.clustering.stc.STCClusteringAlgorithm</str>
725    </lst>
726  </searchComponent>
727  <requestHandler name="/clustering"
728                  enable="${solr.clustering.enabled:false}"
729                  class="solr.SearchHandler">
730     <lst name="defaults">
731       <bool name="clustering">true</bool>
732       <str name="clustering.engine">default</str>
733       <bool name="clustering.results">true</bool>
734       <!-- The title field -->
735       <str name="carrot.title">name</str>
736       <str name="carrot.url">id</str>
737       <!-- The field to cluster on -->
738       <str name="carrot.snippet">features</str>
739       <!-- produce summaries -->
740       <bool name="carrot.produceSummary">true</bool>
741       <!-- the maximum number of labels per cluster -->
742       <!--<int name="carrot.numDescriptions">5</int>-->
743       <!-- produce sub clusters -->
744       <bool name="carrot.outputSubClusters">false</bool>
745    </lst>     
746    <arr name="last-components">
747      <str>clusteringComponent</str>
748    </arr>
749  </requestHandler>
750 
751  <!-- Solr Cell: http://wiki.apache.org/solr/ExtractingRequestHandler -->
752  <requestHandler name="/update/extract" class="org.apache.solr.handler.extraction.ExtractingRequestHandler" startup="lazy">
753    <lst name="defaults">
754      <!-- All the main content goes into "text"... if you need to return
755           the extracted text or do highlighting, use a stored field. -->
756      <str name="fmap.content">text</str>
757      <str name="lowernames">true</str>
758      <str name="uprefix">ignored_</str>
759
760      <!-- capture link hrefs but ignore div attributes -->
761      <str name="captureAttr">true</str>
762      <str name="fmap.a">links</str>
763      <str name="fmap.div">ignored_</str>
764    </lst>
765  </requestHandler>
766
767
768  <!-- A component to return terms and document frequency of those terms.
769       This component does not yet support distributed search. -->
770  <searchComponent name="termsComponent" class="org.apache.solr.handler.component.TermsComponent"/>
771
772  <requestHandler name="/terms" class="org.apache.solr.handler.component.SearchHandler">
773     <lst name="defaults">
774      <bool name="terms">true</bool>
775    </lst>     
776    <arr name="components">
777      <str>termsComponent</str>
778    </arr>
779  </requestHandler>
780
781
782  <!-- a search component that enables you to configure the top results for
783       a given query regardless of the normal lucene scoring.-->
784  <searchComponent name="elevator" class="solr.QueryElevationComponent" >
785    <!-- pick a fieldType to analyze queries -->
786    <str name="queryFieldType">string</str>
787    <str name="config-file">elevate.xml</str>
788  </searchComponent>
789
790  <!-- a request handler utilizing the elevator component -->
791  <requestHandler name="/elevate" class="solr.SearchHandler" startup="lazy">
792    <lst name="defaults">
793      <str name="echoParams">explicit</str>
794    </lst>
795    <arr name="last-components">
796      <str>elevator</str>
797    </arr>
798  </requestHandler>
799
800
801  <!-- Update request handler. 
802
803       Note: Since solr1.1 requestHandlers requires a valid content type header if posted in
804       the body. For example, curl now requires: -H 'Content-type:text/xml; charset=utf-8'
805       The response format differs from solr1.1 formatting and returns a standard error code.
806       To enable solr1.1 behavior, remove the /update handler or change its path
807    -->
808  <requestHandler name="/update" class="solr.UpdateRequestHandler" />
809
810
811  <requestHandler name="/update/javabin" class="solr.UpdateRequestHandler" />
812
813  <!--
814   Analysis request handler.  Since Solr 1.3.  Use to return how a document is analyzed.  Useful
815   for debugging and as a token server for other types of applications.
816
817   This is deprecated in favor of the improved DocumentAnalysisRequestHandler and FieldAnalysisRequestHandler
818
819   <requestHandler name="/analysis" class="solr.AnalysisRequestHandler" />
820   -->
821
822  <!--
823    An analysis handler that provides a breakdown of the analysis process of provided docuemnts. This handler expects a
824    (single) content stream with the following format:
825
826    <docs>
827      <doc>
828        <field name="id">1</field>
829        <field name="name">The Name</field>
830        <field name="text">The Text Value</field>
831      <doc>
832      <doc>...</doc>
833      <doc>...</doc>
834      ...
835    </docs>
836
837    Note: Each document must contain a field which serves as the unique key. This key is used in the returned
838    response to assoicate an analysis breakdown to the analyzed document.
839
840    Like the FieldAnalysisRequestHandler, this handler also supports query analysis by
841    sending either an "analysis.query" or "q" request paraemter that holds the query text to be analyized. It also
842    supports the "analysis.showmatch" parameter which when set to true, all field tokens that match the query
843    tokens will be marked as a "match".
844  -->
845  <requestHandler name="/analysis/document" class="solr.DocumentAnalysisRequestHandler" />
846
847  <!--
848    RequestHandler that provides much the same functionality as analysis.jsp. Provides the ability
849    to specify multiple field types and field names in the same request and outputs index-time and
850    query-time analysis for each of them.
851
852    Request parameters are:
853    analysis.fieldname - The field name whose analyzers are to be used
854    analysis.fieldtype - The field type whose analyzers are to be used
855    analysis.fieldvalue - The text for index-time analysis
856    q (or analysis.q) - The text for query time analysis
857    analysis.showmatch (true|false) - When set to true and when query analysis is performed, the produced
858                                      tokens of the field value analysis will be marked as "matched" for every
859                                      token that is produces by the query analysis
860   -->
861  <requestHandler name="/analysis/field" class="solr.FieldAnalysisRequestHandler" />
862
863
864  <!-- CSV update handler, loaded on demand -->
865  <requestHandler name="/update/csv" class="solr.CSVRequestHandler" startup="lazy" />
866
867
868  <!--
869   Admin Handlers - This will register all the standard admin RequestHandlers.  Adding
870   this single handler is equivalent to registering:
871   
872  <requestHandler name="/admin/luke"       class="org.apache.solr.handler.admin.LukeRequestHandler" />
873  <requestHandler name="/admin/system"     class="org.apache.solr.handler.admin.SystemInfoHandler" />
874  <requestHandler name="/admin/plugins"    class="org.apache.solr.handler.admin.PluginInfoHandler" />
875  <requestHandler name="/admin/threads"    class="org.apache.solr.handler.admin.ThreadDumpHandler" />
876  <requestHandler name="/admin/properties" class="org.apache.solr.handler.admin.PropertiesRequestHandler" />
877  <requestHandler name="/admin/file"       class="org.apache.solr.handler.admin.ShowFileRequestHandler" >
878 
879  If you wish to hide files under ${solr.home}/conf, explicitly register the ShowFileRequestHandler using:
880  <requestHandler name="/admin/file" class="org.apache.solr.handler.admin.ShowFileRequestHandler" >
881    <lst name="invariants">
882     <str name="hidden">synonyms.txt</str>
883     <str name="hidden">anotherfile.txt</str>
884    </lst>
885  </requestHandler>
886  -->
887  <requestHandler name="/admin/" class="org.apache.solr.handler.admin.AdminHandlers" />
888
889  <!-- ping/healthcheck -->
890  <requestHandler name="/admin/ping" class="PingRequestHandler">
891    <lst name="defaults">
892      <str name="qt">standard</str>
893      <str name="q">solrpingquery</str>
894      <str name="echoParams">all</str>
895    </lst>
896  </requestHandler>
897
898  <!-- Echo the request contents back to the client -->
899  <requestHandler name="/debug/dump" class="solr.DumpRequestHandler" >
900    <lst name="defaults">
901     <str name="echoParams">explicit</str> <!-- for all params (including the default etc) use: 'all' -->
902     <str name="echoHandler">true</str>
903    </lst>
904  </requestHandler>
905
906  <highlighting>
907   <!-- Configure the standard fragmenter -->
908   <!-- This could most likely be commented out in the "default" case -->
909   <fragmenter name="gap" class="org.apache.solr.highlight.GapFragmenter" default="true">
910    <lst name="defaults">
911     <int name="hl.fragsize">100</int>
912    </lst>
913   </fragmenter>
914
915   <!-- A regular-expression-based fragmenter (f.i., for sentence extraction) -->
916   <fragmenter name="regex" class="org.apache.solr.highlight.RegexFragmenter">
917    <lst name="defaults">
918      <!-- slightly smaller fragsizes work better because of slop -->
919      <int name="hl.fragsize">70</int>
920      <!-- allow 50% slop on fragment sizes -->
921      <float name="hl.regex.slop">0.5</float>
922      <!-- a basic sentence pattern -->
923      <str name="hl.regex.pattern">[-\w ,/\n\"']{20,200}</str>
924    </lst>
925   </fragmenter>
926
927   <!-- Configure the standard formatter -->
928   <formatter name="html" class="org.apache.solr.highlight.HtmlFormatter" default="true">
929    <lst name="defaults">
930     <str name="hl.simple.pre"><![CDATA[<em>]]></str>
931     <str name="hl.simple.post"><![CDATA[</em>]]></str>
932    </lst>
933   </formatter>
934  </highlighting>
935
936  <!-- An example dedup update processor that creates the "id" field on the fly
937       based on the hash code of some other fields.  This example has overwriteDupes
938       set to false since we are using the id field as the signatureField and Solr
939       will maintain uniqueness based on that anyway.
940       
941       You have to link the chain to an update handler above to use it ie:
942         <requestHandler name="/update "class="solr.XmlUpdateRequestHandler">
943           <lst name="defaults">
944             <str name="update.processor">dedupe</str>
945           </lst>
946         </requestHandler> 
947  -->
948  <!--
949  <updateRequestProcessorChain name="dedupe">
950    <processor class="org.apache.solr.update.processor.SignatureUpdateProcessorFactory">
951      <bool name="enabled">true</bool>
952      <str name="signatureField">id</str>
953      <bool name="overwriteDupes">false</bool>
954      <str name="fields">name,features,cat</str>
955      <str name="signatureClass">org.apache.solr.update.processor.Lookup3Signature</str>
956    </processor>
957    <processor class="solr.LogUpdateProcessorFactory" />
958    <processor class="solr.RunUpdateProcessorFactory" />
959  </updateRequestProcessorChain>
960  -->
961
962
963  <!-- queryResponseWriter plugins... query responses will be written using the
964    writer specified by the 'wt' request parameter matching the name of a registered
965    writer.
966    The "default" writer is the default and will be used if 'wt' is not specified
967    in the request. XMLResponseWriter will be used if nothing is specified here.
968    The json, python, and ruby writers are also available by default.
969
970    <queryResponseWriter name="xml" class="org.apache.solr.request.XMLResponseWriter" default="true"/>
971    <queryResponseWriter name="json" class="org.apache.solr.request.JSONResponseWriter"/>
972    <queryResponseWriter name="python" class="org.apache.solr.request.PythonResponseWriter"/>
973    <queryResponseWriter name="ruby" class="org.apache.solr.request.RubyResponseWriter"/>
974    <queryResponseWriter name="php" class="org.apache.solr.request.PHPResponseWriter"/>
975    <queryResponseWriter name="phps" class="org.apache.solr.request.PHPSerializedResponseWriter"/>
976
977      <queryResponseWriter name="custom" class="com.example.MyResponseWriter"/>
978    -->
979
980    <!-- XSLT response writer transforms the XML output by any xslt file found
981        in Solr's conf/xslt directory.  Changes to xslt files are checked for
982        every xsltCacheLifetimeSeconds. 
983    -->
984    <queryResponseWriter name="xslt" class="org.apache.solr.response.XSLTResponseWriter">
985        <int name="xsltCacheLifetimeSeconds">5</int>
986    </queryResponseWriter>
987
988
989    <!-- example of registering a query parser
990    <queryParser name="lucene" class="org.apache.solr.search.LuceneQParserPlugin"/>
991    -->
992
993    <!-- example of registering a custom function parser
994    <valueSourceParser name="myfunc" class="com.mycompany.MyValueSourceParser" />
995    -->
996
997    <!-- config for the admin interface -->
998    <admin>
999        <defaultQuery>solr</defaultQuery>
1000
1001        <!-- configure a healthcheck file for servers behind a loadbalancer
1002        <healthcheck type="file">server-enabled</healthcheck>
1003        -->
1004    </admin>
1005
1006</config>
Note: See TracBrowser for help on using the repository browser.