source: sandbox/expresso-solr/solr/example/example-DIH/solr/db/conf/solrconfig.xml @ 7588

Revision 7588, 19.9 KB checked in by adir, 11 years ago (diff)

Ticket #000 - Adicionando a integracao de buscas com Solr na base a ser isnerida na comunidade

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<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  <jmx />
30
31  <lib dir="../../../../dist/" regex="apache-solr-dataimporthandler-.*\.jar" />
32
33  <!-- <indexConfig> section could go here, but we want the defaults -->
34
35  <!-- the default high-performance update handler -->
36  <updateHandler class="solr.DirectUpdateHandler2">
37
38    <!-- A prefix of "solr." for class names is an alias that
39         causes solr to search appropriate packages, including
40         org.apache.solr.(search|update|request|core|analysis)
41     -->
42
43    <!-- Limit the number of deletions Solr will buffer during doc updating.
44       
45        Setting this lower can help bound memory use during indexing.
46    -->
47    <maxPendingDeletes>100000</maxPendingDeletes>
48
49    <!-- Perform a <commit/> automatically under certain conditions:
50
51         maxDocs - number of updates since last commit is greater than this
52         maxTime - oldest uncommited update (in ms) is this long ago
53    <autoCommit>
54      <maxDocs>10000</maxDocs>
55      <maxTime>1000</maxTime>
56    </autoCommit>
57    -->
58
59    <!-- The RunExecutableListener executes an external command.
60         exe - the name of the executable to run
61         dir - dir to use as the current working directory. default="."
62         wait - the calling thread waits until the executable returns. default="true"
63         args - the arguments to pass to the program.  default=nothing
64         env - environment variables to set.  default=nothing
65      -->
66    <!-- A postCommit event is fired after every commit or optimize command
67    <listener event="postCommit" class="solr.RunExecutableListener">
68      <str name="exe">solr/bin/snapshooter</str>
69      <str name="dir">.</str>
70      <bool name="wait">true</bool>
71      <arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
72      <arr name="env"> <str>MYVAR=val1</str> </arr>
73    </listener>
74    -->
75    <!-- A postOptimize event is fired only after every optimize command, useful
76         in conjunction with index distribution to only distribute optimized indicies
77    <listener event="postOptimize" class="solr.RunExecutableListener">
78      <str name="exe">snapshooter</str>
79      <str name="dir">solr/bin</str>
80      <bool name="wait">true</bool>
81    </listener>
82    -->
83
84  </updateHandler>
85
86
87  <query>
88    <!-- Maximum number of clauses in a boolean query... can affect
89        range or prefix queries that expand to big boolean
90        queries.  An exception is thrown if exceeded.  -->
91    <maxBooleanClauses>1024</maxBooleanClauses>
92
93   
94    <!-- Cache used by SolrIndexSearcher for filters (DocSets),
95         unordered sets of *all* documents that match a query.
96         When a new searcher is opened, its caches may be prepopulated
97         or "autowarmed" using data from caches in the old searcher.
98         autowarmCount is the number of items to prepopulate.  For LRUCache,
99         the autowarmed items will be the most recently accessed items.
100       Parameters:
101         class - the SolrCache implementation (currently only LRUCache)
102         size - the maximum number of entries in the cache
103         initialSize - the initial capacity (number of entries) of
104           the cache.  (seel java.util.HashMap)
105         autowarmCount - the number of entries to prepopulate from
106           and old cache.
107         -->
108    <filterCache
109      class="solr.LRUCache"
110      size="512"
111      initialSize="512"
112      autowarmCount="256"/>
113
114   <!-- queryResultCache caches results of searches - ordered lists of
115         document ids (DocList) based on a query, a sort, and the range
116         of documents requested.  -->
117    <queryResultCache
118      class="solr.LRUCache"
119      size="512"
120      initialSize="512"
121      autowarmCount="256"/>
122
123  <!-- documentCache caches Lucene Document objects (the stored fields for each document).
124       Since Lucene internal document ids are transient, this cache will not be autowarmed.  -->
125    <documentCache
126      class="solr.LRUCache"
127      size="512"
128      initialSize="512"
129      autowarmCount="0"/>
130
131    <!-- If true, stored fields that are not requested will be loaded lazily.
132
133    This can result in a significant speed improvement if the usual case is to
134    not load all stored fields, especially if the skipped fields are large compressed
135    text fields.
136    -->
137    <enableLazyFieldLoading>true</enableLazyFieldLoading>
138
139    <!-- Example of a generic cache.  These caches may be accessed by name
140         through SolrIndexSearcher.getCache(),cacheLookup(), and cacheInsert().
141         The purpose is to enable easy caching of user/application level data.
142         The regenerator argument should be specified as an implementation
143         of solr.search.CacheRegenerator if autowarming is desired.  -->
144    <!--
145    <cache name="myUserCache"
146      class="solr.LRUCache"
147      size="4096"
148      initialSize="1024"
149      autowarmCount="1024"
150      regenerator="org.mycompany.mypackage.MyRegenerator"
151      />
152    -->
153
154   <!-- An optimization that attempts to use a filter to satisfy a search.
155         If the requested sort does not include score, then the filterCache
156         will be checked for a filter matching the query. If found, the filter
157         will be used as the source of document ids, and then the sort will be
158         applied to that.
159    <useFilterForSortedQuery>true</useFilterForSortedQuery>
160   -->
161
162   <!-- An optimization for use with the queryResultCache.  When a search
163         is requested, a superset of the requested number of document ids
164         are collected.  For example, if a search for a particular query
165         requests matching documents 10 through 19, and queryWindowSize is 50,
166         then documents 0 through 49 will be collected and cached.  Any further
167         requests in that range can be satisfied via the cache.  -->
168    <queryResultWindowSize>50</queryResultWindowSize>
169   
170    <!-- Maximum number of documents to cache for any entry in the
171         queryResultCache. -->
172    <queryResultMaxDocsCached>200</queryResultMaxDocsCached>
173
174    <!-- This entry enables an int hash representation for filters (DocSets)
175         when the number of items in the set is less than maxSize.  For smaller
176         sets, this representation is more memory efficient, more efficient to
177         iterate over, and faster to take intersections.  -->
178    <HashDocSet maxSize="3000" loadFactor="0.75"/>
179
180    <!-- a newSearcher event is fired whenever a new searcher is being prepared
181         and there is a current searcher handling requests (aka registered). -->
182    <!-- QuerySenderListener takes an array of NamedList and executes a
183         local query request for each NamedList in sequence. -->
184    <listener event="newSearcher" class="solr.QuerySenderListener">
185      <arr name="queries">
186        <lst> <str name="q">solr</str> <str name="start">0</str> <str name="rows">10</str> </lst>
187        <lst> <str name="q">rocks</str> <str name="start">0</str> <str name="rows">10</str> </lst>
188        <lst><str name="q">static newSearcher warming query from solrconfig.xml</str></lst>
189      </arr>
190    </listener>
191
192    <!-- a firstSearcher event is fired whenever a new searcher is being
193         prepared but there is no current registered searcher to handle
194         requests or to gain autowarming data from. -->
195    <listener event="firstSearcher" class="solr.QuerySenderListener">
196      <arr name="queries">
197      </arr>
198    </listener>
199
200    <!-- If a search request comes in and there is no current registered searcher,
201         then immediately register the still warming searcher and use it.  If
202         "false" then all requests will block until the first searcher is done
203         warming. -->
204    <useColdSearcher>false</useColdSearcher>
205
206    <!-- Maximum number of searchers that may be warming in the background
207      concurrently.  An error is returned if this limit is exceeded. Recommend
208      1-2 for read-only slaves, higher for masters w/o cache warming. -->
209    <maxWarmingSearchers>4</maxWarmingSearchers>
210
211  </query>
212
213  <!--
214    Let the dispatch filter handler /select?qt=XXX
215    handleSelect=true will use consistent error handling for /select and /update
216    handleSelect=false will use solr1.1 style error formatting
217    -->
218  <requestDispatcher handleSelect="true" >
219    <!--Make sure your system has some authentication before enabling remote streaming!  -->
220    <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="2048" />
221       
222    <!-- Set HTTP caching related parameters (for proxy caches and clients).
223         
224         To get the behaviour of Solr 1.2 (ie: no caching related headers)
225         use the never304="true" option and do not specify a value for
226         <cacheControl>
227    -->
228    <httpCaching never304="true">
229    <!--httpCaching lastModifiedFrom="openTime"
230                 etagSeed="Solr"-->
231       <!-- lastModFrom="openTime" is the default, the Last-Modified value
232            (and validation against If-Modified-Since requests) will all be
233            relative to when the current Searcher was opened.
234            You can change it to lastModFrom="dirLastMod" if you want the
235            value to exactly corrispond to when the physical index was last
236            modified.
237               
238            etagSeed="..." is an option you can change to force the ETag
239            header (and validation against If-None-Match requests) to be
240            differnet even if the index has not changed (ie: when making
241            significant changes to your config file)
242
243            lastModifiedFrom and etagSeed are both ignored if you use the
244            never304="true" option.
245       -->
246       <!-- If you include a <cacheControl> directive, it will be used to
247            generate a Cache-Control header, as well as an Expires header
248            if the value contains "max-age="
249               
250            By default, no Cache-Control header is generated.
251
252            You can use the <cacheControl> option even if you have set
253            never304="true"
254       -->
255       <!-- <cacheControl>max-age=30, public</cacheControl> -->
256    </httpCaching>
257  </requestDispatcher>
258 
259     
260  <!-- requestHandler plugins... incoming queries will be dispatched to the
261     correct handler based on the path or the 'qt' param.
262     Names starting with a '/' are accessed with the a path equal to the
263     registered name.  Names without a leading '/' are accessed with:
264      http://host/app/select?qt=name
265     If no qt is defined, the requestHandler that declares default="true"
266     will be used.
267  -->
268  <requestHandler name="standard" class="solr.StandardRequestHandler" default="true">
269    <!-- default values for query parameters -->
270     <lst name="defaults">
271       <str name="echoParams">explicit</str>
272       <!--
273       <int name="rows">10</int>
274       <str name="fl">*</str>
275       <str name="version">2.1</str>
276        -->
277     </lst>
278  </requestHandler>
279
280  <!-- SpellCheckerRequestHandler takes in a word (or several words) as the
281       value of the "q" parameter and returns a list of alternative spelling
282       suggestions.  If invoked with a ...&cmd=rebuild, it will rebuild the
283       spellchecker index.
284  -->
285  <requestHandler name="spellchecker" class="solr.SpellCheckerRequestHandler" startup="lazy">
286    <!-- default values for query parameters -->
287     <lst name="defaults">
288       <int name="suggestionCount">1</int>
289       <float name="accuracy">0.5</float>
290     </lst>
291     
292     <!-- Main init params for handler -->
293     
294     <!-- The directory where your SpellChecker Index should live.   -->
295     <!-- May be absolute, or relative to the Solr "dataDir" directory. -->
296     <!-- If this option is not specified, a RAM directory will be used -->
297     <str name="spellcheckerIndexDir">spell</str>
298     
299     <!-- the field in your schema that you want to be able to build -->
300     <!-- your spell index on. This should be a field that uses a very -->
301     <!-- simple FieldType without a lot of Analysis (ie: string) -->
302     <str name="termSourceField">word</str>
303     
304   </requestHandler>
305
306   <requestHandler name="/mlt" class="solr.MoreLikeThisHandler">
307     <lst name="defaults">
308       <str name="mlt.fl">manu,cat</str>
309       <int name="mlt.mindf">1</int>
310     </lst>
311   </requestHandler>
312
313   <requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
314    <lst name="defaults">
315        <str name="config">db-data-config.xml</str>
316    </lst>
317  </requestHandler>
318   
319 
320 
321  <!--
322   
323   Search components are registered to SolrCore and used by Search Handlers
324   
325   By default, the following components are avaliable:
326   
327   <searchComponent name="query"     class="org.apache.solr.handler.component.QueryComponent" />
328   <searchComponent name="facet"     class="org.apache.solr.handler.component.FacetComponent" />
329   <searchComponent name="mlt"       class="org.apache.solr.handler.component.MoreLikeThisComponent" />
330   <searchComponent name="highlight" class="org.apache.solr.handler.component.HighlightComponent" />
331   <searchComponent name="debug"     class="org.apache.solr.handler.component.DebugComponent" />
332 
333   If you register a searchComponent to one of the standard names, that will be used instead.
334 
335   -->
336 
337  <requestHandler name="/search" class="org.apache.solr.handler.component.SearchHandler">
338    <lst name="defaults">
339      <str name="echoParams">explicit</str>
340    </lst>
341    <!--
342    By default, this will register the following components:
343   
344    <arr name="components">
345      <str>query</str>
346      <str>facet</str>
347      <str>mlt</str>
348      <str>highlight</str>
349      <str>debug</str>
350    </arr>
351   
352    To insert handlers before or after the 'standard' components, use:
353   
354    <arr name="first-components">
355      <str>first</str>
356    </arr>
357   
358    <arr name="last-components">
359      <str>last</str>
360    </arr>
361   
362    -->
363  </requestHandler>
364 
365  <searchComponent name="elevator" class="org.apache.solr.handler.component.QueryElevationComponent" >
366    <!-- pick a fieldType to analyze queries -->
367    <str name="queryFieldType">string</str>
368    <str name="config-file">elevate.xml</str>
369  </searchComponent>
370 
371  <requestHandler name="/elevate" class="org.apache.solr.handler.component.SearchHandler" startup="lazy">
372    <lst name="defaults">
373      <str name="echoParams">explicit</str>
374    </lst>
375    <arr name="last-components">
376      <str>elevator</str>
377    </arr>
378  </requestHandler>
379 
380
381 
382  <!-- Update request handler. 
383 
384       Note: Since solr1.1 requestHandlers requires a valid content type header if posted in
385       the body. For example, curl now requires: -H 'Content-type:text/xml; charset=utf-8'
386       The response format differs from solr1.1 formatting and returns a standard error code.
387       
388       To enable solr1.1 behavior, remove the /update handler or change its path
389       
390       "update.processor.class" is the class name for the UpdateRequestProcessor.  It is initalized
391       only once.  This can not be changed for each request.
392    -->
393  <requestHandler name="/update" class="solr.UpdateRequestHandler"  />
394
395
396  <!--
397   Admin Handlers - This will register all the standard admin RequestHandlers.  Adding
398   this single handler is equivolent to registering:
399   
400  <requestHandler name="/admin/luke"       class="org.apache.solr.handler.admin.LukeRequestHandler" />
401  <requestHandler name="/admin/system"     class="org.apache.solr.handler.admin.SystemInfoHandler" />
402  <requestHandler name="/admin/plugins"    class="org.apache.solr.handler.admin.PluginInfoHandler" />
403  <requestHandler name="/admin/threads"    class="org.apache.solr.handler.admin.ThreadDumpHandler" />
404  <requestHandler name="/admin/properties" class="org.apache.solr.handler.admin.PropertiesRequestHandler" />
405  <requestHandler name="/admin/file"       class="org.apache.solr.handler.admin.ShowFileRequestHandler" >
406 
407  If you wish to hide files under ${solr.home}/conf, explicitly register the ShowFileRequestHandler using:
408  <requestHandler name="/admin/file" class="org.apache.solr.handler.admin.ShowFileRequestHandler" >
409    <lst name="invariants">
410     <str name="hidden">synonyms.txt</str>
411     <str name="hidden">anotherfile.txt</str>
412    </lst>
413  </requestHandler>
414  -->
415  <requestHandler name="/admin/" class="org.apache.solr.handler.admin.AdminHandlers" />
416 
417  <!-- Echo the request contents back to the client -->
418  <requestHandler name="/debug/dump" class="solr.DumpRequestHandler" >
419    <lst name="defaults">
420     <str name="echoParams">explicit</str> <!-- for all params (including the default etc) use: 'all' -->
421     <str name="echoHandler">true</str>
422    </lst>
423  </requestHandler>
424 
425  <highlighting>
426   <!-- Configure the standard fragmenter -->
427   <!-- This could most likely be commented out in the "default" case -->
428   <fragmenter name="gap" class="org.apache.solr.highlight.GapFragmenter" default="true">
429    <lst name="defaults">
430     <int name="hl.fragsize">100</int>
431    </lst>
432   </fragmenter>
433
434   <!-- A regular-expression-based fragmenter (f.i., for sentence extraction) -->
435   <fragmenter name="regex" class="org.apache.solr.highlight.RegexFragmenter">
436    <lst name="defaults">
437      <!-- slightly smaller fragsizes work better because of slop -->
438      <int name="hl.fragsize">70</int>
439      <!-- allow 50% slop on fragment sizes -->
440      <float name="hl.regex.slop">0.5</float>
441      <!-- a basic sentence pattern -->
442      <str name="hl.regex.pattern">[-\w ,/\n\"']{20,200}</str>
443    </lst>
444   </fragmenter>
445   
446   <!-- Configure the standard formatter -->
447   <formatter name="html" class="org.apache.solr.highlight.HtmlFormatter" default="true">
448    <lst name="defaults">
449     <str name="hl.simple.pre"><![CDATA[<em>]]></str>
450     <str name="hl.simple.post"><![CDATA[</em>]]></str>
451    </lst>
452   </formatter>
453  </highlighting>
454 
455 
456  <!-- queryResponseWriter plugins... query responses will be written using the
457    writer specified by the 'wt' request parameter matching the name of a registered
458    writer.
459    The "default" writer is the default and will be used if 'wt' is not specified
460    in the request. XMLResponseWriter will be used if nothing is specified here.
461    The json, python, and ruby writers are also available by default.
462
463    <queryResponseWriter name="xml" class="solr.XMLResponseWriter" default="true"/>
464    <queryResponseWriter name="json" class="solr.JSONResponseWriter"/>
465    <queryResponseWriter name="python" class="solr.PythonResponseWriter"/>
466    <queryResponseWriter name="ruby" class="solr.RubyResponseWriter"/>
467    <queryResponseWriter name="php" class="solr.PHPResponseWriter"/>
468    <queryResponseWriter name="phps" class="solr.PHPSerializedResponseWriter"/>
469
470    <queryResponseWriter name="custom" class="com.example.MyResponseWriter"/>
471  -->
472
473  <!-- XSLT response writer transforms the XML output by any xslt file found
474       in Solr's conf/xslt directory.  Changes to xslt files are checked for
475       every xsltCacheLifetimeSeconds. 
476   -->
477  <queryResponseWriter name="xslt" class="solr.XSLTResponseWriter">
478    <int name="xsltCacheLifetimeSeconds">5</int>
479  </queryResponseWriter>
480   
481  <!-- config for the admin interface -->
482  <admin>
483    <defaultQuery>*:*</defaultQuery>
484  </admin>
485
486</config>
487
Note: See TracBrowser for help on using the repository browser.