Project

General

Profile

« Previous | Next » 

Revision 7564

Added by Jing Tao over 11 years ago

Add the solr home directory.

View differences:

metacat-index/src/test/java/edu/ucsb/nceas/metacat/index/SolrIndexTest.java
38 38
     */
39 39
    @Test
40 40
    public void testDelete() throws Exception {
41
       SolrIndex solrIndex = generateSolrIndex();
42
       solrIndex.remove(id);
41
       //SolrIndex solrIndex = generateSolrIndex();
42
       //solrIndex.remove(id);
43 43
       
44 44
    }
45 45
    
metacat-index/src/main/resources/solr-home/conf/schema.xml
1
<?xml version="1.0" ?>
2
<!-- 
3
THE OFFICIAL DataONE Index Solr Schema definition file.  
4
This schema is copied into the dataone-cn-index buildout for deployment on cn nodes.
5

  
6
The Solr schema file. This file should be named "schema.xml" and
7
 should be in the conf directory under the solr home
8
 (i.e. ./solr/conf/schema.xml by default) 
9
 or located where the classloader for the Solr webapp can find it.
10

  
11
 For more information, on how to customize this file, please see...
12
 http://wiki.apache.org/solr/SchemaXml
13
-->
14

  
15
<schema name="dataone" version="1.1">
16
    <types>
17
        <!-- field type definitions. The "name" attribute is
18
   just a label to be used by field definitions.  The "class"
19
   attribute and any other attributes determine the real
20
   behavior of the fieldtype.  -->
21

  
22
        <!-- The StringField type is not analyzed, but indexed/stored verbatim  -->
23
        <fieldtype name="string" class="solr.StrField" sortMissingLast="true"/>
24

  
25
        <!-- boolean type: "true" or "false" -->
26
        <fieldtype name="boolean" class="solr.BoolField" sortMissingLast="true"/>
27

  
28
        <!-- The optional sortMissingLast and sortMissingFirst attributes are
29
             currently supported on types that are sorted internally as a strings.
30
           - If sortMissingLast="true" then a sort on this field will cause documents
31
           without the field to come after documents with the field,
32
           regardless of the requested sort order (asc or desc).
33
           - If sortMissingFirst="true" then a sort on this field will cause documents
34
           without the field to come before documents with the field,
35
           regardless of the requested sort order.
36
           - If sortMissingLast="false" and sortMissingFirst="false" (the default),
37
           then default lucene sorting will be used which places docs without the field
38
           first in an ascending sort and last in a descending sort.
39
        -->
40

  
41
        <!-- numeric field types that store and index the text
42
value verbatim (and hence don't support range queries since the
43
lexicographic ordering isn't equal to the numeric ordering) -->
44
        <fieldtype name="integer" class="solr.IntField"/>
45
        <fieldtype name="long" class="solr.LongField"/>
46
        <fieldtype name="float" class="solr.FloatField"/>
47
        <fieldtype name="double" class="solr.DoubleField"/>
48

  
49
        <!-- Numeric field types that manipulate the value into
50
  a string value that isn't human readable in it's internal form,
51
  but with a lexicographic ordering the same as the numeric ordering
52
  so that range queries correctly work. -->
53
        <fieldtype name="sint" class="solr.SortableIntField" sortMissingLast="true"/>
54
        <fieldtype name="slong" class="solr.SortableLongField" sortMissingLast="true"/>
55
        <fieldtype name="sfloat" class="solr.SortableFloatField" sortMissingLast="true"/>
56
        <fieldtype name="sdouble" class="solr.SortableDoubleField" sortMissingLast="true"/>
57

  
58
        <!-- The format for this date field is of the form 1995-12-31T23:59:59Z, and
59
   is a more restricted form of the canonical representation of dateTime
60
   http://www.w3.org/TR/xmlschema-2/#dateTime
61
   The trailing "Z" designates UTC time and is mandatory.
62
   Optional fractional seconds are allowed: 1995-12-31T23:59:59.999Z
63
   All other components are mandatory. -->
64
        <fieldtype name="date" class="solr.DateField" sortMissingLast="true"/>
65

  
66
        <!-- solr.TextField allows the specification of custom text analyzers
67
            specified as a tokenizer and a list of token filters. Different
68
            analyzers may be specified for indexing and querying.
69

  
70
            The optional positionIncrementGap puts space between multiple fields of
71
            this type on the same document, with the purpose of preventing false phrase
72
            matching across fields.
73

  
74
            For more info on customizing your analyzer chain, please see...
75
         http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters
76

  
77
        -->
78

  
79
        <!-- Standard analyzer commonly used by Lucene developers
80
        -->
81
        <!-- Standard analyzer commonly used by Lucene developers -->
82
<!--
83
         <fieldtype name="text_lu" class="solr.TextField" positionIncrementGap="100">
84
            <analyzer>
85
                <tokenizer class="solr.StandardTokenizerFactory"/>
86
                <filter class="solr.StandardFilterFactory"/>
87
                <filter class="solr.LowerCaseFilterFactory"/>
88
                <filter class="solr.StopFilterFactory"/>
89
                <filter class="solr.EnglishPorterFilterFactory"/>
90
            </analyzer>
91
        </fieldtype> 
92
-->
93
        <!-- One could also specify an existing Analyzer implementation in Java
94
             via the class attribute on the analyzer element:
95
        <fieldtype name="text_lu" class="solr.TextField">
96
          <analyzer class="org.apache.lucene.analysis.snowball.SnowballAnalyzer"/>
97
        </fieldType>
98
        -->
99

  
100
        <!-- A text field that only splits on whitespace for more exact matching -->
101
        <fieldtype name="text_ws" class="solr.TextField" positionIncrementGap="100">
102
            <analyzer>
103
                <tokenizer class="solr.WhitespaceTokenizerFactory"/>
104
            </analyzer>
105
        </fieldtype>
106

  
107
        <fieldtype name="text" class="solr.TextField" positionIncrementGap="100">
108
            <analyzer type="index">
109
          		<tokenizer class="solr.WhitespaceTokenizerFactory"/>
110
                <filter class="solr.WordDelimiterFilterFactory" 
111
                	generateWordParts="1"
112
                	catenateWords="1"
113
                	generateNumberParts="1"
114
                	splitOnNumerics="0"/>
115
                
116
                <filter class="solr.LowerCaseFilterFactory"/>
117
                <filter class="solr.StopFilterFactory" />
118
                <filter class="solr.PorterStemFilterFactory" />
119
                <filter class="solr.ReversedWildcardFilterFactory" withOriginal="true"/>
120
            </analyzer>
121
            <analyzer type="query">
122
                <tokenizer class="solr.WhitespaceTokenizerFactory"/>
123
                
124
                <filter class="solr.WordDelimiterFilterFactory" 
125
                	generateWordParts="1"
126
                	catenateWords="0"
127
                	generateNumberParts="1"
128
                	splitOnNumerics="0"/>
129
                
130
                <filter class="solr.LowerCaseFilterFactory"/>
131
                <filter class="solr.StopFilterFactory"/>
132
                <filter class="solr.PorterStemFilterFactory" />
133
            </analyzer>
134
        </fieldtype>
135

  
136
        <fieldtype name="text_no_token" class="solr.TextField" positionIncrementGap="100">
137
            <analyzer type="index">
138
                <tokenizer class="solr.WhitespaceTokenizerFactory"/>    
139
                <filter class="solr.LowerCaseFilterFactory"/>
140
                <filter class="solr.StopFilterFactory" />
141
            </analyzer>
142
            <analyzer type="query">
143
                <tokenizer class="solr.WhitespaceTokenizerFactory"/>                
144
                <filter class="solr.LowerCaseFilterFactory"/>
145
                <filter class="solr.StopFilterFactory"/>
146
            </analyzer>
147
        </fieldtype>
148

  
149
<!--
150
         <fieldtype name="text_all" class="solr.TextField" positionIncrementGap="100">
151
            <analyzer type="index">
152
                <tokenizer class="solr.WhitespaceTokenizerFactory"/>
153
                in this example, we will only use synonyms at query time
154
                <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
155
               
156
                <filter class="solr.StopFilterFactory" ignoreCase="true"/>
157
                <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1"
158
                        catenateWords="1" catenateNumbers="1" catenateAll="0"/>
159
                <filter class="solr.LowerCaseFilterFactory"/>
160
                <filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/>
161
            </analyzer>
162
            <analyzer type="query">
163
                <tokenizer class="solr.WhitespaceTokenizerFactory"/>
164
                <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
165
                <filter class="solr.StopFilterFactory" ignoreCase="true"/>
166
                <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1"
167
                        catenateWords="0" catenateNumbers="0" catenateAll="0"/>
168
                <filter class="solr.LowerCaseFilterFactory"/>
169
                <filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/>
170
            </analyzer>
171
        </fieldtype>
172
 -->
173

  
174
        <!-- Less flexible matching, but less false matches.  Probably not ideal for product names
175
but may be good for SKUs.  Can insert dashes in the wrong place and still match. -->
176
         <fieldtype name="textTight" class="solr.TextField" positionIncrementGap="100">
177
            <analyzer>
178
                <tokenizer class="solr.WhitespaceTokenizerFactory"/>
179
                <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="false"/>
180
                <filter class="solr.StopFilterFactory" ignoreCase="true"/>
181
                <filter class="solr.WordDelimiterFilterFactory" generateWordParts="0" generateNumberParts="0"
182
                        catenateWords="1" catenateNumbers="1" catenateAll="0"/>
183
                <filter class="solr.LowerCaseFilterFactory"/>
184
                <filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/>
185
            </analyzer>
186
        </fieldtype> 
187
		
188
    </types>
189

  
190

  
191
<!-- ======================================================================= -->
192
    <fields>
193
        <!-- Valid attributes for fields:
194
            name: mandatory - the name for the field
195
            type: mandatory - the name of a previously defined type from the <types> section
196
            indexed: true if this field should be indexed (searchable)
197
            stored: true if this field should be retrievable
198
            multiValued: true if this field may contain multiple values per document
199
            omitNorms: (expert) set to true to omit the norms associated with this field
200
                       (this disables length normalization and index-time boosting for the field)
201
        -->
202

  
203
        <field name="id"              	type="string"   indexed="true" stored="true" multiValued="false"/>
204
        <field name="formatId"    		type="string"   indexed="true" stored="true" multiValued="false"/>
205
		<field name="formatType"		type="string"	indexed="true"	stored="true"	multiValued="false"/>
206
        <field name="size"            	type="slong"     indexed="true" stored="true" multiValued="false"/>
207
        <field name="checksum"        	type="string"   indexed="false" stored="true" multiValued="false"/>
208
        <field name="checksumAlgorithm" type="string" indexed="false" stored="true"/>
209
        <field name="dateUploaded"    type="date"     indexed="true" stored="true" multiValued="false"/>
210
        <field name="dateModified"    type="date"     indexed="true" stored="true" multiValued="false"/>
211
        <field name="submitter"       type="string"   indexed="true" stored="true" multiValued="false"/>
212
        <field name="rightsHolder"    type="string"   indexed="true" stored="true" multiValued="false"/>
213
        <field name="authoritativeMN"       	type="string"   indexed="false" stored="true" multiValued="false"/>
214
        <field name="replicationAllowed"     	type="boolean"  indexed="false" stored="true" multiValued="false"/>
215
        <field name="numberReplicas"      		type="integer"  indexed="false" stored="true" multiValued="false"/>
216
        <field name="preferredReplicationMN"   	type="string"   indexed="false" stored="true" multiValued="true"/>
217
        <field name="blockedReplicationMN"  	type="string"   indexed="false" stored="true" multiValued="true"/>
218
        <field name="replicaMN"      		type="string"   indexed="false" stored="true" multiValued="true"/>
219
        <field name="replicaVerifiedDate" 	type="date"    indexed="false" stored="true" multiValued="true"/>
220
        <field name="datasource"       		type="string"  indexed="true" stored="true" multiValued="false"/>
221
        <field name="obsoletes"       		type="string"   indexed="true" stored="true" multiValued="false"/>
222
        <field name="obsoletedBy"      		type="string"   indexed="true" stored="true" multiValued="false"/>
223

  
224
        <!-- Object relationships -->
225
        <field name="resourceMap"		type="string"   indexed="true" stored="true" multiValued="true"/>
226
        <field name="documents"			type="string"   indexed="true" stored="true" multiValued="true"/>
227
        <field name="isDocumentedBy"	type="string"   indexed="true" stored="true" multiValued="true"/>
228

  
229
        <!--Permissions-->
230
        <field name="readPermission"    type="string"   indexed="true" stored="true" multiValued="true"/>
231
        <field name="writePermission"   type="string"   indexed="true" stored="true" multiValued="true"/>
232
        <field name="changePermission"  type="string"   indexed="true" stored="true" multiValued="true"/>
233
        <field name="isPublic"          type="boolean"  indexed="true" stored="true" />
234
        
235
        <!-- Science metadata properties -->
236
        <field name="abstract"                 type="text"      multiValued="false" indexed="true" stored="true" />
237
        <field name="author"                   type="string"    multiValued="false" indexed="true" stored="true" />
238
        <field name="authorLastName"             type="string"    multiValued="true" indexed="true" stored="true" />
239
        <field name="keywords"                 type="string"    multiValued="true" indexed="true" stored="true" />
240
        <field name="keyConcept"               type="string"    multiValued="true" indexed="true" stored="true" />
241
        <field name="southBoundCoord"          type="sfloat"     multiValued="false" indexed="true" stored="true"/>
242
        <field name="northBoundCoord"          type="sfloat"     multiValued="false" indexed="true" stored="true"/>
243
        <field name="westBoundCoord"           type="sfloat"     multiValued="false" indexed="true" stored="true"/>
244
        <field name="eastBoundCoord"           type="sfloat"     multiValued="false" indexed="true" stored="true"/>
245
        <field name="namedLocation"            type="string"    multiValued="true" indexed="true" stored="true" />
246
        <field name="beginDate"                type="date"      multiValued="false" indexed="true" stored="true" />
247
        <field name="endDate"                  type="date"      multiValued="false" indexed="true" stored="true" />
248
        
249
        <field name="title"                    type="text"    multiValued="false" indexed="true" stored="true" />
250
        <field name="scientificName"           type="string"    multiValued="true" indexed="true" stored="true" />
251
        <field name="relatedOrganizations"     type="string"    multiValued="true" indexed="true" stored="true" />
252
        <field name="datePublished"            type="date"      multiValued="false" indexed="true" stored="true" />
253
        <field name="pubDate" 				   type="date" 							indexed="true" stored="true"/>
254

  
255
		<field name="investigator" 		type="string" 	indexed="true" stored="true" multiValued="true"/>
256
		<field name="investigatorText" 	type="text" 	indexed="true" stored="false" multiValued="true"/>
257
        <field name="ogcUrl" 			type="text" 	indexed="false" stored="true"/>
258
        <field name="sku" 				type="textTight" indexed="true" stored="true"/>
259
        <field name="identifier" 		type="textTight" indexed="true" stored="true"/>
260
        <field name="LTERSite"	 		type="string" 	indexed="true" stored="true"/>
261
        <field name="origin" 			type="string" 	indexed="true" stored="true" multiValued="true"/>
262
        <field name="originText" 		type="text" 	indexed="true" stored="false" multiValued="true"/>
263
        <field name="titlestr" 			type="string" 	indexed="true" stored="false"/>
264
        <field name="geoform" 			type="string" 	indexed="true" stored="true"/>
265
        <field name="presentationCat" 	type="string" 	indexed="true" stored="true"/>
266
        <field name="purpose" 			type="text" 	indexed="true" stored="true"/>
267
        <field name="updateDate" 		type="date" 	indexed="true" stored="true"/>
268
        <field name="edition" 			type="text" 	indexed="true" stored="true"/>
269
        <field name="dataUrl" 			type="string" 	indexed="false" stored="true"/>
270
        <field name="originator" 		type="string" 	indexed="true" stored="true" multiValued="true"/>
271
        <field name="originatorText" 	type="text"	  	indexed="true" stored="false" multiValued="true"/>
272
        <field name="family" 			type="string" 	indexed="true" stored="true" multiValued="true"/>
273
        <field name="species" 			type="string" 	indexed="true" stored="true" multiValued="true"/>
274
        <field name="genus" 			type="string" 	indexed="true" stored="true" multiValued="true"/>
275
        <field name="kingdom" 			type="string" 	indexed="true" stored="true" multiValued="true"/>
276
        <field name="phylum" 			type="string" 	indexed="true" stored="true" multiValued="true"/>
277
        <field name="order" 			type="string" 	indexed="true" stored="true" multiValued="true"/>
278
        <field name="class" 			type="string" 	indexed="true" stored="true" multiValued="true"/>
279

  
280
        <field name="webUrl" 			type="string" 	indexed="false" stored="true" multiValued="true"/>
281

  
282
        <field name="contactOrganization" 		type="string" indexed="true" stored="true" multiValued="true"/>
283
        <field name="contactOrganizationText" 	type="text"   indexed="true" stored="false" multiValued="true"/>
284

  
285
        <field name="keywordsText" 		type="text" 	indexed="true" stored="false" multiValued="true"/>
286
        <field name="placeKey" 			type="text" 	indexed="true" stored="true" multiValued="true"/>
287

  
288
        <field name="noBoundingBox" 	type="string" 	indexed="true" stored="true"/>
289
        <field name="isSpatial" 		type="string" 	indexed="true" stored="true"/>
290

  
291
        <field name="decade" 			type="string" 	indexed="true" stored="true"/>
292
        <field name="gcmdKeyword" 		type="text" 	indexed="true" stored="true" multiValued="true"/>
293

  
294
        <!-- these are ornl daac fields, may not be populated for nbii, but are required to be here for indexing purpose-->
295
        <field name="project" 			type="string" 	indexed="true" stored="true"/>
296
        <field name="projectText" 		type="text" 	indexed="true" stored="false"/>
297

  
298
        <field name="site" 				type="string" 	indexed="true" stored="true" multiValued="true"/>
299
        <field name="siteText" 			type="text" 	indexed="true" stored="false" multiValued="true"/>
300

  
301
        <field name="parameter" 		type="string" 	indexed="true" stored="true" multiValued="true"/>
302
        <field name="parameterText"		type="text" 	indexed="true" stored="false" multiValued="true"/>
303

  
304
        <field name="sensor" 			type="string" 	indexed="true" stored="true" multiValued="true"/>
305
        <field name="sensorText" 		type="text" 	indexed="true" stored="false" multiValued="true"/>
306

  
307
        <field name="source" 			type="string" 	indexed="true" stored="true" multiValued="true"/>
308
        <field name="sourceText" 		type="text" 	indexed="true" stored="false" multiValued="true"/>
309

  
310
        <field name="term" 				type="string" 	indexed="true" stored="true" multiValued="true"/>
311
        <field name="termText" 			type="text" 	indexed="true" stored="false" multiValued="true"/>
312

  
313
        <field name="topic" 			type="string" 	indexed="true" stored="true" multiValued="true"/>
314
        <field name="topicText" 		type="text" 	indexed="true" stored="false" multiValued="true"/>
315

  
316
        <field name="fileID" 			type="string" 	indexed="true" stored="true"/>
317
   		<field name="text"				type="text"		indexed="true" stored="true" multiValued="false" />
318
<!-- ======================================================================= -->
319
        <!-- Dynamic field definitions.  If a field name is not found, dynamicFields
320
will be used if the name matches any of the patterns.
321
RESTRICTION: the glob-like pattern in the name attribute must have
322
a "*" only at the start or the end.
323
EXAMPLE:  name="*_i" will match any field ending in _i (like myid_i, z_i)
324
Longer patterns will be matched first.  if equal size patterns
325
both match, the first appearing in the schema will be used.  -->
326
        <dynamicField name="*_i" type="sint" indexed="true" stored="true"/>
327
        <dynamicField name="*_s" type="string" indexed="true" stored="true"/>
328
        <dynamicField name="*_l" type="slong" indexed="true" stored="true"/>
329
        <dynamicField name="*_t" type="text" indexed="true" stored="true"/>
330
        <dynamicField name="*_b" type="boolean" indexed="true" stored="true"/>
331
        <dynamicField name="*_f" type="sfloat" indexed="true" stored="true"/>
332
        <dynamicField name="*_d" type="sdouble" indexed="true" stored="true"/>
333
        <dynamicField name="*_dt" type="date" indexed="true" stored="true"/>
334
    </fields>
335

  
336
<!-- ======================================================================= -->
337
    <!-- field to use to determine and enforce document uniqueness. -->
338
    <uniqueKey>id</uniqueKey>
339

  
340
    <!-- field for the QueryParser to use when an explicit fieldname is absent -->
341
    <defaultSearchField>text</defaultSearchField>
342

  
343
    <!-- SolrQueryParser configuration: defaultOperator="AND|OR" -->
344
    <solrQueryParser defaultOperator="AND"/>
345

  
346
<!-- ======================================================================= -->
347
    <!-- copyField commands copy one field to another at the time a document
348
is added to the index.  It's used either to index the same field different
349
ways, or to add multiple fields to the same field for easier/faster searching.  -->
350

  
351
    <copyField source="id" dest="sku"/>
352
    <copyField source="id" dest="identifier"/>
353
    <copyfield source="replicaMN" dest="datasource" />
354

  
355
    <copyField source="title" dest="titlestr"/>
356

  
357
    <copyField source="origin" dest="originText"/>
358
    <copyField source="origin" dest="originatorText"/>
359
    
360
    <copyField source="project" dest="projectText"/>
361
    
362
    <copyField source="site" dest="siteText"/>
363
    <copyField source="parameter" dest="parameterText"/>
364
    <copyField source="sensor" dest="sensorText"/>
365
    <copyField source="source" dest="sourceText"/>
366
    <copyField source="term" dest="termText"/>
367
    <copyField source="topic" dest="topicText"/>
368
    <copyField source="investigator" dest="investigatorText"/>
369
    <copyField source="keywords" dest="keywordsText"/>
370
    <copyField source="pubDate" dest="datePublished" />
371
    <copyField source="dateUploaded" dest="updateDate" />
372
    <copyField source="contactOrganization" dest="contactOrganizationText"/>
373
  
374

  
375
    <!-- Similarity is the scoring routine for each document vs a query.
376
A custom similarity may be specified here, but the default is fine
377
for most applications.  -->
378
    <!-- <similarity class="org.apache.lucene.search.DefaultSimilarity"/> -->
379

  
380
</schema>
metacat-index/src/main/resources/solr-home/conf/solrconfig.xml
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
<!-- 
20
     For more details about configurations options that may appear in
21
     this file, see http://wiki.apache.org/solr/SolrConfigXml. 
22
-->
23
<config>
24
  <!-- In all configuration below, a prefix of "solr." for class names
25
       is an alias that causes solr to search appropriate packages,
26
       including org.apache.solr.(search|update|request|core|analysis)
27

  
28
       You may also specify a fully qualified Java classname if you
29
       have your own custom plugins.
30
    -->
31

  
32
  <!-- Set this to 'false' if you want solr to continue working after
33
       it has encountered an severe configuration error.  In a
34
       production environment, you may want solr to keep working even
35
       if one handler is mis-configured.
36

  
37
       You may also set this to false using by setting the system
38
       property:
39

  
40
         -Dsolr.abortOnConfigurationError=false
41
    -->
42
  <abortOnConfigurationError>${solr.abortOnConfigurationError:true}</abortOnConfigurationError>
43
  
44
  <!-- Controls what version of Lucene various components of Solr
45
       adhere to.  Generally, you want to use the latest version to
46
       get all bug fixes and improvements. It is highly recommended
47
       that you fully re-index after changing this setting as it can
48
       affect both how text is indexed and queried.
49
    -->
50
  <luceneMatchVersion>LUCENE_34</luceneMatchVersion>
51

  
52
  <!-- lib directives can be used to instruct Solr to load an Jars
53
       identified and use them to resolve any "plugins" specified in
54
       your solrconfig.xml or schema.xml (ie: Analyzers, Request
55
       Handlers, etc...).
56

  
57
       All directories and paths are resolved relative to the
58
       instanceDir.
59

  
60
       If a "./lib" directory exists in your instanceDir, all files
61
       found in it are included as if you had used the following
62
       syntax...
63
       
64
              <lib dir="./lib" />
65
    -->
66
  <!-- A dir option by itself adds any files found in the directory to
67
       the classpath, this is useful for including all jars in a
68
       directory.
69
    -->
70
  <lib dir="../../contrib/extraction/lib" />
71
  <!-- When a regex is specified in addition to a directory, only the
72
       files in that directory which completely match the regex
73
       (anchored on both ends) will be included.
74
    -->
75
  <lib dir="../../dist/" regex="apache-solr-cell-\d.*\.jar" />
76
  <lib dir="../../dist/" regex="apache-solr-clustering-\d.*\.jar" />
77
  <lib dir="../../dist/" regex="apache-solr-dataimporthandler-\d.*\.jar" />
78

  
79
  <!-- If a dir option (with or without a regex) is used and nothing
80
       is found that matches, it will be ignored
81
    -->
82
  <lib dir="../../contrib/clustering/lib/" />
83
  <lib dir="/total/crap/dir/ignored" /> 
84
  <!-- an exact path can be used to specify a specific file.  This
85
       will cause a serious error to be logged if it can't be loaded.
86
    -->
87
  <!--
88
  <lib path="../a-jar-that-does-not-exist.jar" /> 
89
  -->
90
  
91
  <!-- Data Directory
92

  
93
       Used to specify an alternate directory to hold all index data
94
       other than the default ./data under the Solr home.  If
95
       replication is in use, this should match the replication
96
       configuration.
97
    -->
98
  <dataDir>${solr.data.dir:}</dataDir>
99

  
100

  
101
  <!-- The DirectoryFactory to use for indexes.
102
       
103
       solr.StandardDirectoryFactory, the default, is filesystem
104
       based and tries to pick the best implementation for the current
105
       JVM and platform.  One can force a particular implementation
106
       via solr.MMapDirectoryFactory, solr.NIOFSDirectoryFactory, or
107
       solr.SimpleFSDirectoryFactory.
108

  
109
       solr.RAMDirectoryFactory is memory based, not
110
       persistent, and doesn't work with replication.
111
    -->
112
  <directoryFactory name="DirectoryFactory" 
113
                    class="${solr.directoryFactory:solr.StandardDirectoryFactory}"/>
114

  
115

  
116
  <!-- Index Defaults
117

  
118
       Values here affect all index writers and act as a default
119
       unless overridden.
120

  
121
       WARNING: See also the <mainIndex> section below for parameters
122
       that overfor Solr's main Lucene index.
123
    -->
124
  <indexDefaults>
125

  
126
    <useCompoundFile>false</useCompoundFile>
127

  
128
    <mergeFactor>10</mergeFactor>
129
    <!-- Sets the amount of RAM that may be used by Lucene indexing
130
         for buffering added documents and deletions before they are
131
         flushed to the Directory.  -->
132
    <ramBufferSizeMB>32</ramBufferSizeMB>
133
    <!-- If both ramBufferSizeMB and maxBufferedDocs is set, then
134
         Lucene will flush based on whichever limit is hit first.  
135
      -->
136
    <!-- <maxBufferedDocs>1000</maxBufferedDocs> -->
137

  
138
    <maxFieldLength>10000</maxFieldLength>
139
    <writeLockTimeout>1000</writeLockTimeout>
140
    <commitLockTimeout>10000</commitLockTimeout>
141

  
142
    <!-- Expert: Merge Policy 
143

  
144
         The Merge Policy in Lucene controls how merging is handled by
145
         Lucene.  The default in Solr 3.3 is TieredMergePolicy.
146
         
147
         The default in 2.3 was the LogByteSizeMergePolicy,
148
         previous versions used LogDocMergePolicy.
149
         
150
         LogByteSizeMergePolicy chooses segments to merge based on
151
         their size.  The Lucene 2.2 default, LogDocMergePolicy chose
152
         when to merge based on number of documents
153
         
154
         Other implementations of MergePolicy must have a no-argument
155
         constructor
156
      -->
157
    <!--
158
       <mergePolicy class="org.apache.lucene.index.TieredMergePolicy"/>
159
       -->
160

  
161
    <!-- Expert: Merge Scheduler
162

  
163
         The Merge Scheduler in Lucene controls how merges are
164
         performed.  The ConcurrentMergeScheduler (Lucene 2.3 default)
165
         can perform merges in the background using separate threads.
166
         The SerialMergeScheduler (Lucene 2.2 default) does not.
167
     -->
168
    <!-- 
169
       <mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"/>
170
       -->
171
	  
172
    <!-- LockFactory 
173

  
174
         This option specifies which Lucene LockFactory implementation
175
         to use.
176
      
177
         single = SingleInstanceLockFactory - suggested for a
178
                  read-only index or when there is no possibility of
179
                  another process trying to modify the index.
180
         native = NativeFSLockFactory - uses OS native file locking.
181
                  Do not use when multiple solr webapps in the same
182
                  JVM are attempting to share a single index.
183
         simple = SimpleFSLockFactory  - uses a plain file for locking
184

  
185
         (For backwards compatibility with Solr 1.2, 'simple' is the
186
         default if not specified.)
187

  
188
         More details on the nuances of each LockFactory...
189
         http://wiki.apache.org/lucene-java/AvailableLockFactories
190
    -->
191
    <lockType>native</lockType>
192

  
193
    <!-- Expert: Controls how often Lucene loads terms into memory
194
         Default is 128 and is likely good for most everyone.
195
      -->
196
    <!-- <termIndexInterval>256</termIndexInterval> -->
197
  </indexDefaults>
198

  
199
  <!-- Main Index
200

  
201
       Values here override the values in the <indexDefaults> section
202
       for the main on disk index.
203
    -->
204
  <mainIndex>
205

  
206
    <useCompoundFile>false</useCompoundFile>
207
    <ramBufferSizeMB>32</ramBufferSizeMB>
208
    <mergeFactor>10</mergeFactor>
209

  
210
    <!-- Unlock On Startup
211

  
212
         If true, unlock any held write or commit locks on startup.
213
         This defeats the locking mechanism that allows multiple
214
         processes to safely access a lucene index, and should be used
215
         with care.
216

  
217
         This is not needed if lock type is 'none' or 'single'
218
     -->
219
    <unlockOnStartup>false</unlockOnStartup>
220
    
221
    <!-- If true, IndexReaders will be reopened (often more efficient)
222
         instead of closed and then opened.
223
      -->
224
    <reopenReaders>true</reopenReaders>
225

  
226
    <!-- Commit Deletion Policy
227

  
228
         Custom deletion policies can specified here. The class must
229
         implement org.apache.lucene.index.IndexDeletionPolicy.
230

  
231
         http://lucene.apache.org/java/2_9_1/api/all/org/apache/lucene/index/IndexDeletionPolicy.html
232

  
233
         The standard Solr IndexDeletionPolicy implementation supports
234
         deleting index commit points on number of commits, age of
235
         commit point and optimized status.
236
         
237
         The latest commit point should always be preserved regardless
238
         of the criteria.
239
    -->
240
    <deletionPolicy class="solr.SolrDeletionPolicy">
241
      <!-- The number of commit points to be kept -->
242
      <str name="maxCommitsToKeep">1</str>
243
      <!-- The number of optimized commit points to be kept -->
244
      <str name="maxOptimizedCommitsToKeep">0</str>
245
      <!--
246
          Delete all commit points once they have reached the given age.
247
          Supports DateMathParser syntax e.g.
248
        -->
249
      <!--
250
         <str name="maxCommitAge">30MINUTES</str>
251
         <str name="maxCommitAge">1DAY</str>
252
      -->
253
    </deletionPolicy>
254

  
255
    <!-- Lucene Infostream
256
       
257
         To aid in advanced debugging, Lucene provides an "InfoStream"
258
         of detailed information when indexing.
259

  
260
         Setting The value to true will instruct the underlying Lucene
261
         IndexWriter to write its debugging info the specified file
262
      -->
263
     <infoStream file="INFOSTREAM.txt">false</infoStream> 
264

  
265
  </mainIndex>
266

  
267
  <!-- JMX
268
       
269
       This example enables JMX if and only if an existing MBeanServer
270
       is found, use this if you want to configure JMX through JVM
271
       parameters. Remove this to disable exposing Solr configuration
272
       and statistics to JMX.
273

  
274
       For more details see http://wiki.apache.org/solr/SolrJmx
275
    -->
276
  <jmx />
277
  <!-- If you want to connect to a particular server, specify the
278
       agentId 
279
    -->
280
  <!-- <jmx agentId="myAgent" /> -->
281
  <!-- If you want to start a new MBeanServer, specify the serviceUrl -->
282
  <!-- <jmx serviceUrl="service:jmx:rmi:///jndi/rmi://localhost:9999/solr"/>
283
    -->
284

  
285
  <!-- The default high-performance update handler -->
286
  <updateHandler class="solr.DirectUpdateHandler2">
287

  
288
    <!-- AutoCommit
289

  
290
         Perform a <commit/> automatically under certain conditions.
291
         Instead of enabling autoCommit, consider using "commitWithin"
292
         when adding documents. 
293

  
294
         http://wiki.apache.org/solr/UpdateXmlMessages
295

  
296
         maxDocs - Maximum number of documents to add since the last
297
                   commit before automatically triggering a new commit.
298

  
299
         maxTime - Maximum amount of time that is allowed to pass
300
                   since a document was added before automaticly
301
                   triggering a new commit. 
302
      -->
303
    <!--
304
       <autoCommit> 
305
         <maxDocs>10000</maxDocs>
306
         <maxTime>1000</maxTime> 
307
       </autoCommit>
308
      -->
309

  
310
    <!-- Update Related Event Listeners
311
         
312
         Various IndexWriter related events can trigger Listeners to
313
         take actions.
314

  
315
         postCommit - fired after every commit or optimize command
316
         postOptimize - fired after every optimize command
317
      -->
318
    <!-- The RunExecutableListener executes an external command from a
319
         hook such as postCommit or postOptimize.
320
         
321
         exe - the name of the executable to run
322
         dir - dir to use as the current working directory. (default=".")
323
         wait - the calling thread waits until the executable returns. 
324
                (default="true")
325
         args - the arguments to pass to the program.  (default is none)
326
         env - environment variables to set.  (default is none)
327
      -->
328
    <!-- This example shows how RunExecutableListener could be used
329
         with the script based replication...
330
         http://wiki.apache.org/solr/CollectionDistribution
331
      -->
332
    <!--
333
       <listener event="postCommit" class="solr.RunExecutableListener">
334
         <str name="exe">solr/bin/snapshooter</str>
335
         <str name="dir">.</str>
336
         <bool name="wait">true</bool>
337
         <arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
338
         <arr name="env"> <str>MYVAR=val1</str> </arr>
339
       </listener>
340
      -->
341
  </updateHandler>
342
  
343
  <!-- IndexReaderFactory
344

  
345
       Use the following format to specify a custom IndexReaderFactory,
346
       which allows for alternate IndexReader implementations.
347

  
348
       ** Experimental Feature **
349

  
350
       Please note - Using a custom IndexReaderFactory may prevent
351
       certain other features from working. The API to
352
       IndexReaderFactory may change without warning or may even be
353
       removed from future releases if the problems cannot be
354
       resolved.
355

  
356

  
357
       ** Features that may not work with custom IndexReaderFactory **
358

  
359
       The ReplicationHandler assumes a disk-resident index. Using a
360
       custom IndexReader implementation may cause incompatibility
361
       with ReplicationHandler and may cause replication to not work
362
       correctly. See SOLR-1366 for details.
363

  
364
    -->
365
  <!--
366
  <indexReaderFactory name="IndexReaderFactory" class="package.class">
367
    <str name="someArg">Some Value</str>
368
  </indexReaderFactory >
369
  -->
370
  <!-- By explicitly declaring the Factory, the termIndexDivisor can
371
       be specified.
372
    -->
373
  <!--
374
     <indexReaderFactory name="IndexReaderFactory" 
375
                         class="solr.StandardIndexReaderFactory">
376
       <int name="setTermIndexDivisor">12</int>
377
     </indexReaderFactory >
378
    -->
379

  
380

  
381
  <query>
382
    <!-- Max Boolean Clauses
383

  
384
         Maximum number of clauses in each BooleanQuery,  an exception
385
         is thrown if exceeded.
386

  
387
         ** WARNING **
388
         
389
         This option actually modifies a global Lucene property that
390
         will affect all SolrCores.  If multiple solrconfig.xml files
391
         disagree on this property, the value at any given moment will
392
         be based on the last SolrCore to be initialized.
393
         
394
      -->
395
    <maxBooleanClauses>1024</maxBooleanClauses>
396

  
397

  
398
    <!-- Solr Internal Query Caches
399

  
400
         There are two implementations of cache available for Solr,
401
         LRUCache, based on a synchronized LinkedHashMap, and
402
         FastLRUCache, based on a ConcurrentHashMap.  
403

  
404
         FastLRUCache has faster gets and slower puts in single
405
         threaded operation and thus is generally faster than LRUCache
406
         when the hit ratio of the cache is high (> 75%), and may be
407
         faster under other scenarios on multi-cpu systems.
408
    -->
409

  
410
    <!-- Filter Cache
411

  
412
         Cache used by SolrIndexSearcher for filters (DocSets),
413
         unordered sets of *all* documents that match a query.  When a
414
         new searcher is opened, its caches may be prepopulated or
415
         "autowarmed" using data from caches in the old searcher.
416
         autowarmCount is the number of items to prepopulate.  For
417
         LRUCache, the autowarmed items will be the most recently
418
         accessed items.
419

  
420
         Parameters:
421
           class - the SolrCache implementation LRUCache or
422
               (LRUCache or FastLRUCache)
423
           size - the maximum number of entries in the cache
424
           initialSize - the initial capacity (number of entries) of
425
               the cache.  (see java.util.HashMap)
426
           autowarmCount - the number of entries to prepopulate from
427
               and old cache.  
428
      -->
429
    <filterCache class="solr.FastLRUCache"
430
                 size="512"
431
                 initialSize="512"
432
                 autowarmCount="0"/>
433

  
434
    <!-- Query Result Cache
435
         
436
         Caches results of searches - ordered lists of document ids
437
         (DocList) based on a query, a sort, and the range of documents requested.  
438
      -->
439
    <queryResultCache class="solr.LRUCache"
440
                     size="512"
441
                     initialSize="512"
442
                     autowarmCount="0"/>
443
   
444
    <!-- Document Cache
445

  
446
         Caches Lucene Document objects (the stored fields for each
447
         document).  Since Lucene internal document ids are transient,
448
         this cache will not be autowarmed.  
449
      -->
450
    <documentCache class="solr.LRUCache"
451
                   size="512"
452
                   initialSize="512"
453
                   autowarmCount="0"/>
454
    
455
    <!-- Field Value Cache
456
         
457
         Cache used to hold field values that are quickly accessible
458
         by document id.  The fieldValueCache is created by default
459
         even if not configured here.
460
      -->
461
    <!--
462
       <fieldValueCache class="solr.FastLRUCache"
463
                        size="512"
464
                        autowarmCount="128"
465
                        showItems="32" />
466
      -->
467

  
468
    <!-- Custom Cache
469

  
470
         Example of a generic cache.  These caches may be accessed by
471
         name through SolrIndexSearcher.getCache(),cacheLookup(), and
472
         cacheInsert().  The purpose is to enable easy caching of
473
         user/application level data.  The regenerator argument should
474
         be specified as an implementation of solr.CacheRegenerator 
475
         if autowarming is desired.  
476
      -->
477
    <!--
478
       <cache name="myUserCache"
479
              class="solr.LRUCache"
480
              size="4096"
481
              initialSize="1024"
482
              autowarmCount="1024"
483
              regenerator="com.mycompany.MyRegenerator"
484
              />
485
      -->
486

  
487

  
488
    <!-- Lazy Field Loading
489

  
490
         If true, stored fields that are not requested will be loaded
491
         lazily.  This can result in a significant speed improvement
492
         if the usual case is to not load all stored fields,
493
         especially if the skipped fields are large compressed text
494
         fields.
495
    -->
496
    <enableLazyFieldLoading>true</enableLazyFieldLoading>
497

  
498
   <!-- Use Filter For Sorted Query
499

  
500
        A possible optimization that attempts to use a filter to
501
        satisfy a search.  If the requested sort does not include
502
        score, then the filterCache will be checked for a filter
503
        matching the query. If found, the filter will be used as the
504
        source of document ids, and then the sort will be applied to
505
        that.
506

  
507
        For most situations, this will not be useful unless you
508
        frequently get the same search repeatedly with different sort
509
        options, and none of them ever use "score"
510
     -->
511
   <!--
512
      <useFilterForSortedQuery>true</useFilterForSortedQuery>
513
     -->
514

  
515
   <!-- Result Window Size
516

  
517
        An optimization for use with the queryResultCache.  When a search
518
        is requested, a superset of the requested number of document ids
519
        are collected.  For example, if a search for a particular query
520
        requests matching documents 10 through 19, and queryWindowSize is 50,
521
        then documents 0 through 49 will be collected and cached.  Any further
522
        requests in that range can be satisfied via the cache.  
523
     -->
524
   <queryResultWindowSize>20</queryResultWindowSize>
525

  
526
   <!-- Maximum number of documents to cache for any entry in the
527
        queryResultCache. 
528
     -->
529
   <queryResultMaxDocsCached>200</queryResultMaxDocsCached>
530

  
531
   <!-- Query Related Event Listeners
532

  
533
        Various IndexSearcher related events can trigger Listeners to
534
        take actions.
535

  
536
        newSearcher - fired whenever a new searcher is being prepared
537
        and there is a current searcher handling requests (aka
538
        registered).  It can be used to prime certain caches to
539
        prevent long request times for certain requests.
540

  
541
        firstSearcher - fired whenever a new searcher is being
542
        prepared but there is no current registered searcher to handle
543
        requests or to gain autowarming data from.
544

  
545
        
546
     -->
547
    <!-- QuerySenderListener takes an array of NamedList and executes a
548
         local query request for each NamedList in sequence. 
549
      -->
550
    <listener event="newSearcher" class="solr.QuerySenderListener">
551
      <arr name="queries">
552
        <!--
553
           <lst><str name="q">solr</str><str name="sort">price asc</str></lst>
554
           <lst><str name="q">rocks</str><str name="sort">weight asc</str></lst>
555
          -->
556
      </arr>
557
    </listener>
558
    <listener event="firstSearcher" class="solr.QuerySenderListener">
559
      <arr name="queries">
560
        <lst>
561
          <str name="q">static firstSearcher warming in solrconfig.xml</str>
562
        </lst>
563
      </arr>
564
    </listener>
565

  
566
    <!-- Use Cold Searcher
567

  
568
         If a search request comes in and there is no current
569
         registered searcher, then immediately register the still
570
         warming searcher and use it.  If "false" then all requests
571
         will block until the first searcher is done warming.
572
      -->
573
    <useColdSearcher>false</useColdSearcher>
574

  
575
    <!-- Max Warming Searchers
576
         
577
         Maximum number of searchers that may be warming in the
578
         background concurrently.  An error is returned if this limit
579
         is exceeded.
580

  
581
         Recommend values of 1-2 for read-only slaves, higher for
582
         masters w/o cache warming.
583
      -->
584
    <maxWarmingSearchers>2</maxWarmingSearchers>
585

  
586
  </query>
587

  
588

  
589
  <!-- Request Dispatcher
590

  
591
       This section contains instructions for how the SolrDispatchFilter
592
       should behave when processing requests for this SolrCore.
593

  
594
       handleSelect affects the behavior of requests such as /select?qt=XXX
595

  
596
       handleSelect="true" will cause the SolrDispatchFilter to process
597
       the request and will result in consistent error handling and
598
       formatting for all types of requests.
599

  
600
       handleSelect="false" will cause the SolrDispatchFilter to
601
       ignore "/select" requests and fallback to using the legacy
602
       SolrServlet and it's Solr 1.1 style error formatting
603
    -->
604
  <requestDispatcher handleSelect="true" >
605
    <!-- Request Parsing
606

  
607
         These settings indicate how Solr Requests may be parsed, and
608
         what restrictions may be placed on the ContentStreams from
609
         those requests
610

  
611
         enableRemoteStreaming - enables use of the stream.file
612
         and stream.url parameters for specifying remote streams.
613

  
614
         multipartUploadLimitInKB - specifies the max size of
615
         Multipart File Uploads that Solr will allow in a Request.
616
         
617
         *** WARNING ***
618
         The settings below authorize Solr to fetch remote files, You
619
         should make sure your system has some authentication before
620
         using enableRemoteStreaming="true"
621

  
622
      --> 
623
    <requestParsers enableRemoteStreaming="true" 
624
                    multipartUploadLimitInKB="2048000" />
625

  
626
    <!-- HTTP Caching
627

  
628
         Set HTTP caching related parameters (for proxy caches and clients).
629

  
630
         The options below instruct Solr not to output any HTTP Caching
631
         related headers
632
      -->
633
    <httpCaching never304="true" />
634
    <!-- If you include a <cacheControl> directive, it will be used to
635
         generate a Cache-Control header (as well as an Expires header
636
         if the value contains "max-age=")
637
         
638
         By default, no Cache-Control header is generated.
639
         
640
         You can use the <cacheControl> option even if you have set
641
         never304="true"
642
      -->
643
    <!--
644
       <httpCaching never304="true" >
645
         <cacheControl>max-age=30, public</cacheControl> 
646
       </httpCaching>
647
      -->
648
    <!-- To enable Solr to respond with automatically generated HTTP
649
         Caching headers, and to response to Cache Validation requests
650
         correctly, set the value of never304="false"
651
         
652
         This will cause Solr to generate Last-Modified and ETag
653
         headers based on the properties of the Index.
654

  
655
         The following options can also be specified to affect the
656
         values of these headers...
657

  
658
         lastModFrom - the default value is "openTime" which means the
659
         Last-Modified value (and validation against If-Modified-Since
660
         requests) will all be relative to when the current Searcher
661
         was opened.  You can change it to lastModFrom="dirLastMod" if
662
         you want the value to exactly correspond to when the physical
663
         index was last modified.
664

  
665
         etagSeed="..." is an option you can change to force the ETag
666
         header (and validation against If-None-Match requests) to be
667
         different even if the index has not changed (ie: when making
668
         significant changes to your config file)
669

  
670
         (lastModifiedFrom and etagSeed are both ignored if you use
671
         the never304="true" option)
672
      -->
673
    <!--
674
       <httpCaching lastModifiedFrom="openTime"
675
                    etagSeed="Solr">
676
         <cacheControl>max-age=30, public</cacheControl> 
677
       </httpCaching>
678
      -->
679
  </requestDispatcher>
680

  
681
  <!-- Request Handlers 
682

  
683
       http://wiki.apache.org/solr/SolrRequestHandler
684

  
685
       incoming queries will be dispatched to the correct handler
686
       based on the path or the qt (query type) param.
687

  
688
       Names starting with a '/' are accessed with the a path equal to
689
       the registered name.  Names without a leading '/' are accessed
690
       with: http://host/app/[core/]select?qt=name
691

  
692
       If a /select request is processed with out a qt param
693
       specified, the requestHandler that declares default="true" will
694
       be used.
695
       
696
       If a Request Handler is declared with startup="lazy", then it will
697
       not be initialized until the first request that uses it.
698

  
699
    -->
700
  <!-- SearchHandler
701

  
702
       http://wiki.apache.org/solr/SearchHandler
703

  
704
       For processing Search Queries, the primary Request Handler
705
       provided with Solr is "SearchHandler" It delegates to a sequent
706
       of SearchComponents (see below) and supports distributed
707
       queries across multiple shards
708
    -->
709
  <requestHandler name="search" class="solr.SearchHandler" default="true">
710
    <!-- default values for query parameters can be specified, these
711
         will be overridden by parameters in the request
712
      -->
713
     <lst name="defaults">
714
       <str name="echoParams">explicit</str>
715
       <int name="rows">10</int>
716
     </lst>
717
    <!-- In addition to defaults, "appends" params can be specified
718
         to identify values which should be appended to the list of
719
         multi-val params from the query (or the existing "defaults").
720
      -->
721
    <!-- In this example, the param "fq=instock:true" would be appended to
722
         any query time fq params the user may specify, as a mechanism for
723
         partitioning the index, independent of any user selected filtering
724
         that may also be desired (perhaps as a result of faceted searching).
725

  
726
         NOTE: there is *absolutely* nothing a client can do to prevent these
727
         "appends" values from being used, so don't use this mechanism
728
         unless you are sure you always want it.
729
      -->
730
    <!--
731
       <lst name="appends">
732
         <str name="fq">inStock:true</str>
733
       </lst>
734
      -->
735
    <!-- "invariants" are a way of letting the Solr maintainer lock down
736
         the options available to Solr clients.  Any params values
737
         specified here are used regardless of what values may be specified
738
         in either the query, the "defaults", or the "appends" params.
739

  
740
         In this example, the facet.field and facet.query params would
741
         be fixed, limiting the facets clients can use.  Faceting is
742
         not turned on by default - but if the client does specify
743
         facet=true in the request, these are the only facets they
744
         will be able to see counts for; regardless of what other
745
         facet.field or facet.query params they may specify.
746

  
747
         NOTE: there is *absolutely* nothing a client can do to prevent these
748
         "invariants" values from being used, so don't use this mechanism
749
         unless you are sure you always want it.
750
      -->
751
    <!--
752
       <lst name="invariants">
753
         <str name="facet.field">cat</str>
754
         <str name="facet.field">manu_exact</str>
755
         <str name="facet.query">price:[* TO 500]</str>
756
         <str name="facet.query">price:[500 TO *]</str>
757
       </lst>
758
      -->
759
    <!-- If the default list of SearchComponents is not desired, that
760
         list can either be overridden completely, or components can be
761
         prepended or appended to the default list.  (see below)
762
      -->
763
    <!--
764
       <arr name="components">
765
         <str>nameOfCustomComponent1</str>
766
         <str>nameOfCustomComponent2</str>
767
       </arr>
768
      -->
769
    </requestHandler>
770

  
771
  <!-- A Robust Example
772

  
773
       This example SearchHandler declaration shows off usage of the
774
       SearchHandler with many defaults declared
775

  
776
       Note that multiple instances of the same Request Handler
777
       (SearchHandler) can be registered multiple times with different
778
       names (and different init parameters)
779
    -->
780
  <requestHandler name="/browse" class="solr.SearchHandler">
781
     <lst name="defaults">
782
       <str name="echoParams">explicit</str>
783

  
784
       <!-- VelocityResponseWriter settings -->
785
       <str name="wt">velocity</str>
786

  
787
       <str name="v.template">browse</str>
788
       <str name="v.layout">layout</str>
789
       <str name="title">Solritas</str>
790

  
791
       <str name="defType">edismax</str>
792
       <str name="q.alt">*:*</str>
793
       <str name="rows">10</str>
794
       <str name="fl">*,score</str>
795
       <str name="mlt.qf">
796
         text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
797
       </str>
798
       <str name="mlt.fl">text,features,name,sku,id,manu,cat</str>
799
       <int name="mlt.count">3</int>
800

  
801
       <str name="qf">
802
          text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
803
       </str>
804

  
805
       <str name="facet">on</str>
806
       <str name="facet.field">cat</str>
807
       <str name="facet.field">manu_exact</str>
808
       <str name="facet.query">ipod</str>
809
       <str name="facet.query">GB</str>
810
       <str name="facet.mincount">1</str>
811
       <str name="facet.pivot">cat,inStock</str>
812
       <str name="facet.range.other">after</str>
813
       <str name="facet.range">price</str>
814
       <int name="f.price.facet.range.start">0</int>
815
       <int name="f.price.facet.range.end">600</int>
816
       <int name="f.price.facet.range.gap">50</int>
817
       <str name="facet.range">popularity</str>
818
       <int name="f.popularity.facet.range.start">0</int>
819
       <int name="f.popularity.facet.range.end">10</int>
820
       <int name="f.popularity.facet.range.gap">3</int>
821
       <str name="facet.range">manufacturedate_dt</str>
822
       <str name="f.manufacturedate_dt.facet.range.start">NOW/YEAR-10YEARS</str>
823
       <str name="f.manufacturedate_dt.facet.range.end">NOW</str>
824
       <str name="f.manufacturedate_dt.facet.range.gap">+1YEAR</str>
825
       <str name="f.manufacturedate_dt.facet.range.other">before</str>
826
       <str name="f.manufacturedate_dt.facet.range.other">after</str>
827

  
828

  
829
       <!-- Highlighting defaults -->
830
       <str name="hl">on</str>
831
       <str name="hl.fl">text features name</str>
832
       <str name="f.name.hl.fragsize">0</str>
833
       <str name="f.name.hl.alternateField">name</str>
834
     </lst>
835
     <arr name="last-components">
836
       <str>spellcheck</str>
837
     </arr>
838
     <!--
839
     <str name="url-scheme">httpx</str>
840
     -->
841
  </requestHandler>
842

  
843
  <!-- XML Update Request Handler.  
844
       
845
       http://wiki.apache.org/solr/UpdateXmlMessages
846

  
847
       The canonical Request Handler for Modifying the Index through
848
       commands specified using XML.
849

  
850
       Note: Since solr1.1 requestHandlers requires a valid content
851
       type header if posted in the body. For example, curl now
852
       requires: -H 'Content-type:text/xml; charset=utf-8'
853
    -->
854
  <requestHandler name="/update" 
855
                  class="solr.XmlUpdateRequestHandler">
856
    <!-- See below for information on defining 
857
         updateRequestProcessorChains that can be used by name 
858
         on each Update Request
859
      -->
860
    <!--
861
       <lst name="defaults">
862
         <str name="update.chain">dedupe</str>
863
       </lst>
864
       -->
865
    </requestHandler>
866
  <!-- Binary Update Request Handler
867
       http://wiki.apache.org/solr/javabin
868
    -->
869
  <requestHandler name="/update/javabin" 
870
                  class="solr.BinaryUpdateRequestHandler" />
871

  
872
  <!-- CSV Update Request Handler
873
       http://wiki.apache.org/solr/UpdateCSV
874
    -->
875
  <requestHandler name="/update/csv" 
876
                  class="solr.CSVRequestHandler" 
877
                  startup="lazy" />
878

  
879
  <!-- JSON Update Request Handler
880
       http://wiki.apache.org/solr/UpdateJSON
881
    -->
882
  <requestHandler name="/update/json" 
883
                  class="solr.JsonUpdateRequestHandler" 
884
                  startup="lazy" />
885

  
886
  <!-- Solr Cell Update Request Handler
887

  
888
       http://wiki.apache.org/solr/ExtractingRequestHandler 
889

  
890
    -->
891
  <requestHandler name="/update/extract" 
892
                  startup="lazy"
893
                  class="solr.extraction.ExtractingRequestHandler" >
894
    <lst name="defaults">
895
      <!-- All the main content goes into "text"... if you need to return
896
           the extracted text or do highlighting, use a stored field. -->
897
      <str name="fmap.content">text</str>
898
      <str name="lowernames">true</str>
899
      <str name="uprefix">ignored_</str>
900

  
901
      <!-- capture link hrefs but ignore div attributes -->
902
      <str name="captureAttr">true</str>
903
      <str name="fmap.a">links</str>
904
      <str name="fmap.div">ignored_</str>
905
    </lst>
906
  </requestHandler>
907

  
908
  <!-- XSLT Update Request Handler
909
       Transforms incoming XML with stylesheet identified by tr=
910
  -->
911
  <requestHandler name="/update/xslt"
912
                   startup="lazy"
913
                   class="solr.XsltUpdateRequestHandler"/>
914

  
915
  <!-- Field Analysis Request Handler
916

  
917
       RequestHandler that provides much the same functionality as
918
       analysis.jsp. Provides the ability to specify multiple field
919
       types and field names in the same request and outputs
920
       index-time and query-time analysis for each of them.
921

  
922
       Request parameters are:
923
       analysis.fieldname - field name whose analyzers are to be used
924

  
925
       analysis.fieldtype - field type whose analyzers are to be used
926
       analysis.fieldvalue - text for index-time analysis
927
       q (or analysis.q) - text for query time analysis
928
       analysis.showmatch (true|false) - When set to true and when
929
           query analysis is performed, the produced tokens of the
930
           field value analysis will be marked as "matched" for every
931
           token that is produces by the query analysis
932
   -->
933
  <requestHandler name="/analysis/field" 
934
                  startup="lazy"
935
                  class="solr.FieldAnalysisRequestHandler" />
936

  
937

  
938
  <!-- Document Analysis Handler
939

  
940
       http://wiki.apache.org/solr/AnalysisRequestHandler
941

  
942
       An analysis handler that provides a breakdown of the analysis
943
       process of provided docuemnts. This handler expects a (single)
944
       content stream with the following format:
945

  
946
       <docs>
947
         <doc>
948
           <field name="id">1</field>
949
           <field name="name">The Name</field>
950
           <field name="text">The Text Value</field>
951
         </doc>
952
         <doc>...</doc>
953
         <doc>...</doc>
954
         ...
955
       </docs>
956

  
957
    Note: Each document must contain a field which serves as the
958
    unique key. This key is used in the returned response to associate
959
    an analysis breakdown to the analyzed document.
960

  
961
    Like the FieldAnalysisRequestHandler, this handler also supports
962
    query analysis by sending either an "analysis.query" or "q"
963
    request parameter that holds the query text to be analyzed. It
964
    also supports the "analysis.showmatch" parameter which when set to
965
    true, all field tokens that match the query tokens will be marked
966
    as a "match". 
967
  -->
968
  <requestHandler name="/analysis/document" 
969
                  class="solr.DocumentAnalysisRequestHandler" 
970
                  startup="lazy" />
971

  
972
  <!-- Admin Handlers
973

  
974
       Admin Handlers - This will register all the standard admin
975
       RequestHandlers.  
976
    -->
977
  <requestHandler name="/admin/" 
978
                  class="solr.admin.AdminHandlers" />
979
  <!-- This single handler is equivalent to the following... -->
980
  <!--
981
     <requestHandler name="/admin/luke"       class="solr.admin.LukeRequestHandler" />
982
     <requestHandler name="/admin/system"     class="solr.admin.SystemInfoHandler" />
983
     <requestHandler name="/admin/plugins"    class="solr.admin.PluginInfoHandler" />
984
     <requestHandler name="/admin/threads"    class="solr.admin.ThreadDumpHandler" />
985
     <requestHandler name="/admin/properties" class="solr.admin.PropertiesRequestHandler" />
986
     <requestHandler name="/admin/file"       class="solr.admin.ShowFileRequestHandler" >
987
    -->
988
  <!-- If you wish to hide files under ${solr.home}/conf, explicitly
989
       register the ShowFileRequestHandler using: 
990
    -->
991
  <!--
992
     <requestHandler name="/admin/file" 
993
                     class="solr.admin.ShowFileRequestHandler" >
994
       <lst name="invariants">
995
         <str name="hidden">synonyms.txt</str> 
996
         <str name="hidden">anotherfile.txt</str> 
997
       </lst>
998
     </requestHandler>
999
    -->
1000

  
1001
  <!-- ping/healthcheck -->
1002
  <requestHandler name="/admin/ping" class="solr.PingRequestHandler">
1003
    <lst name="invariants">
1004
      <str name="qt">search</str>
1005
      <str name="q">solrpingquery</str>
1006
    </lst>
1007
    <lst name="defaults">
1008
      <str name="echoParams">all</str>
1009
    </lst>
1010
  </requestHandler>
1011

  
1012
  <!-- Echo the request contents back to the client -->
1013
  <requestHandler name="/debug/dump" class="solr.DumpRequestHandler" >
1014
    <lst name="defaults">
1015
     <str name="echoParams">explicit</str> 
1016
     <str name="echoHandler">true</str>
1017
    </lst>
1018
  </requestHandler>
1019
  
1020
  <!-- Solr Replication
1021

  
1022
       The SolrReplicationHandler supports replicating indexes from a
1023
       "master" used for indexing and "salves" used for queries.
1024

  
1025
       http://wiki.apache.org/solr/SolrReplication 
1026

  
1027
       In the example below, remove the <lst name="master"> section if
1028
       this is just a slave and remove  the <lst name="slave"> section
1029
       if this is just a master.
1030
    -->
1031
  <!--
1032
     <requestHandler name="/replication" class="solr.ReplicationHandler" >
1033
       <lst name="master">
1034
         <str name="replicateAfter">commit</str>
1035
         <str name="replicateAfter">startup</str>
1036
         <str name="confFiles">schema.xml,stopwords.txt</str>
1037
       </lst>
1038
       <lst name="slave">
1039
         <str name="masterUrl">http://localhost:8983/solr/replication</str>
1040
         <str name="pollInterval">00:00:60</str>
1041
       </lst>
1042
     </requestHandler>
1043
    -->
1044

  
1045
  <!-- Search Components
1046

  
1047
       Search components are registered to SolrCore and used by 
1048
       instances of SearchHandler (which can access them by name)
1049
       
1050
       By default, the following components are available:
1051
       
1052
       <searchComponent name="query"     class="solr.QueryComponent" />
1053
       <searchComponent name="facet"     class="solr.FacetComponent" />
1054
       <searchComponent name="mlt"       class="solr.MoreLikeThisComponent" />
1055
       <searchComponent name="highlight" class="solr.HighlightComponent" />
1056
       <searchComponent name="stats"     class="solr.StatsComponent" />
1057
       <searchComponent name="debug"     class="solr.DebugComponent" />
1058
   
1059
       Default configuration in a requestHandler would look like:
1060

  
1061
       <arr name="components">
1062
         <str>query</str>
1063
         <str>facet</str>
1064
         <str>mlt</str>
1065
         <str>highlight</str>
1066
         <str>stats</str>
1067
         <str>debug</str>
1068
       </arr>
1069

  
1070
       If you register a searchComponent to one of the standard names, 
1071
       that will be used instead of the default.
1072

  
1073
       To insert components before or after the 'standard' components, use:
1074
    
1075
       <arr name="first-components">
1076
         <str>myFirstComponentName</str>
1077
       </arr>
1078
    
1079
       <arr name="last-components">
1080
         <str>myLastComponentName</str>
1081
       </arr>
1082

  
1083
       NOTE: The component registered with the name "debug" will
1084
       always be executed after the "last-components" 
1085
       
1086
     -->
1087

  
1088
   <!-- Spell Check
1089

  
1090
        The spell check component can return a list of alternative spelling
1091
        suggestions.  
1092

  
1093
        http://wiki.apache.org/solr/SpellCheckComponent
1094
     -->
1095
  <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff