blacklight-access_controls 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +10 -0
  3. data/Gemfile +32 -0
  4. data/README.textile +74 -0
  5. data/Rakefile +47 -0
  6. data/VERSION +1 -0
  7. data/blacklight-access_controls.gemspec +29 -0
  8. data/lib/blacklight-access_controls.rb +23 -0
  9. data/lib/blacklight/access_controls.rb +14 -0
  10. data/lib/blacklight/access_controls/ability.rb +148 -0
  11. data/lib/blacklight/access_controls/catalog.rb +27 -0
  12. data/lib/blacklight/access_controls/config.rb +39 -0
  13. data/lib/blacklight/access_controls/enforcement.rb +103 -0
  14. data/lib/blacklight/access_controls/permissions_cache.rb +19 -0
  15. data/lib/blacklight/access_controls/permissions_query.rb +53 -0
  16. data/lib/blacklight/access_controls/permissions_solr_document.rb +2 -0
  17. data/lib/blacklight/access_controls/user.rb +23 -0
  18. data/lib/generators/blacklight/ability.rb +4 -0
  19. data/lib/generators/blacklight/access_controls_generator.rb +49 -0
  20. data/solr_conf/conf/abc123 +0 -0
  21. data/solr_conf/conf/admin-extra.html +24 -0
  22. data/solr_conf/conf/admin-extra.menu-bottom.html +25 -0
  23. data/solr_conf/conf/admin-extra.menu-top.html +25 -0
  24. data/solr_conf/conf/clustering/carrot2/kmeans-attributes.xml +19 -0
  25. data/solr_conf/conf/clustering/carrot2/lingo-attributes.xml +24 -0
  26. data/solr_conf/conf/clustering/carrot2/stc-attributes.xml +19 -0
  27. data/solr_conf/conf/currency.xml +67 -0
  28. data/solr_conf/conf/dataimport.properties +3 -0
  29. data/solr_conf/conf/db-data-config.xml +93 -0
  30. data/solr_conf/conf/elevate.xml +38 -0
  31. data/solr_conf/conf/lang/contractions_ca.txt +8 -0
  32. data/solr_conf/conf/lang/contractions_fr.txt +15 -0
  33. data/solr_conf/conf/lang/contractions_ga.txt +5 -0
  34. data/solr_conf/conf/lang/contractions_it.txt +23 -0
  35. data/solr_conf/conf/lang/hyphenations_ga.txt +5 -0
  36. data/solr_conf/conf/lang/stemdict_nl.txt +6 -0
  37. data/solr_conf/conf/lang/stoptags_ja.txt +420 -0
  38. data/solr_conf/conf/lang/stopwords_ar.txt +125 -0
  39. data/solr_conf/conf/lang/stopwords_bg.txt +193 -0
  40. data/solr_conf/conf/lang/stopwords_ca.txt +220 -0
  41. data/solr_conf/conf/lang/stopwords_ckb.txt +136 -0
  42. data/solr_conf/conf/lang/stopwords_cz.txt +172 -0
  43. data/solr_conf/conf/lang/stopwords_da.txt +110 -0
  44. data/solr_conf/conf/lang/stopwords_de.txt +294 -0
  45. data/solr_conf/conf/lang/stopwords_el.txt +78 -0
  46. data/solr_conf/conf/lang/stopwords_en.txt +54 -0
  47. data/solr_conf/conf/lang/stopwords_es.txt +356 -0
  48. data/solr_conf/conf/lang/stopwords_eu.txt +99 -0
  49. data/solr_conf/conf/lang/stopwords_fa.txt +313 -0
  50. data/solr_conf/conf/lang/stopwords_fi.txt +97 -0
  51. data/solr_conf/conf/lang/stopwords_fr.txt +186 -0
  52. data/solr_conf/conf/lang/stopwords_ga.txt +110 -0
  53. data/solr_conf/conf/lang/stopwords_gl.txt +161 -0
  54. data/solr_conf/conf/lang/stopwords_hi.txt +235 -0
  55. data/solr_conf/conf/lang/stopwords_hu.txt +211 -0
  56. data/solr_conf/conf/lang/stopwords_hy.txt +46 -0
  57. data/solr_conf/conf/lang/stopwords_id.txt +359 -0
  58. data/solr_conf/conf/lang/stopwords_it.txt +303 -0
  59. data/solr_conf/conf/lang/stopwords_ja.txt +127 -0
  60. data/solr_conf/conf/lang/stopwords_lv.txt +172 -0
  61. data/solr_conf/conf/lang/stopwords_nl.txt +119 -0
  62. data/solr_conf/conf/lang/stopwords_no.txt +194 -0
  63. data/solr_conf/conf/lang/stopwords_pt.txt +253 -0
  64. data/solr_conf/conf/lang/stopwords_ro.txt +233 -0
  65. data/solr_conf/conf/lang/stopwords_ru.txt +243 -0
  66. data/solr_conf/conf/lang/stopwords_sv.txt +133 -0
  67. data/solr_conf/conf/lang/stopwords_th.txt +119 -0
  68. data/solr_conf/conf/lang/stopwords_tr.txt +212 -0
  69. data/solr_conf/conf/lang/userdict_ja.txt +29 -0
  70. data/solr_conf/conf/mapping-FoldToASCII.txt +3813 -0
  71. data/solr_conf/conf/mapping-ISOLatin1Accent.txt +246 -0
  72. data/solr_conf/conf/protwords.txt +21 -0
  73. data/solr_conf/conf/schema.blacklight.xml +724 -0
  74. data/solr_conf/conf/schema.xml +1268 -0
  75. data/solr_conf/conf/schema.xml.orig +1524 -0
  76. data/solr_conf/conf/solrconfig.adams.xml +1903 -0
  77. data/solr_conf/conf/solrconfig.blacklight.xml +411 -0
  78. data/solr_conf/conf/solrconfig.old.xml +1634 -0
  79. data/solr_conf/conf/solrconfig.xml +332 -0
  80. data/solr_conf/conf/solrconfig.xml.orig +3531 -0
  81. data/solr_conf/conf/spellings.txt +2 -0
  82. data/solr_conf/conf/stopwords.txt +14 -0
  83. data/solr_conf/conf/synonyms.txt +29 -0
  84. data/solr_conf/conf/update-script.js +53 -0
  85. data/solr_conf/conf/xslt/example.xsl +132 -0
  86. data/solr_conf/conf/xslt/example_atom.xsl +67 -0
  87. data/solr_conf/conf/xslt/example_rss.xsl +66 -0
  88. data/solr_conf/conf/xslt/luke.xsl +337 -0
  89. data/solr_conf/conf/xslt/updateXml.xsl +70 -0
  90. data/spec/factories/user.rb +6 -0
  91. data/spec/spec_helper.rb +29 -0
  92. data/spec/support/solr_support.rb +11 -0
  93. data/spec/test_app_templates/blacklight.yml +18 -0
  94. data/spec/test_app_templates/lib/generators/test_app_generator.rb +25 -0
  95. data/spec/unit/ability_spec.rb +202 -0
  96. data/spec/unit/catalog_spec.rb +41 -0
  97. data/spec/unit/config_spec.rb +69 -0
  98. data/spec/unit/enforcement_spec.rb +147 -0
  99. metadata +265 -0
@@ -0,0 +1,411 @@
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
+ This is a stripped down config file used for a simple example...
21
+ It is *not* a good example to work from.
22
+ -->
23
+ <config>
24
+
25
+ <!-- Controls what version of Lucene various components of Solr
26
+ adhere to. Generally, you want to use the latest version to
27
+ get all bug fixes and improvements. It is highly recommended
28
+ that you fully re-index after changing this setting as it can
29
+ affect both how text is indexed and queried.
30
+ -->
31
+ <luceneMatchVersion>5.0.0</luceneMatchVersion>
32
+
33
+ <lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lib" />
34
+ <lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lucene-libs" />
35
+
36
+ <directoryFactory name="DirectoryFactory"
37
+ class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}">
38
+ </directoryFactory>
39
+
40
+ <codecFactory class="solr.SchemaCodecFactory"/>
41
+
42
+ <schemaFactory class="ClassicIndexSchemaFactory"/>
43
+
44
+
45
+ <dataDir>${solr.blacklight-core.data.dir:}</dataDir>
46
+
47
+ <requestDispatcher handleSelect="true" >
48
+ <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="2048" />
49
+ </requestDispatcher>
50
+
51
+ <requestHandler name="/analysis/field" startup="lazy" class="solr.FieldAnalysisRequestHandler" />
52
+
53
+ <!-- config for the admin interface -->
54
+ <admin>
55
+ <defaultQuery>*:*</defaultQuery>
56
+ </admin>
57
+
58
+ <!-- SearchHandler
59
+
60
+ http://wiki.apache.org/solr/SearchHandler
61
+
62
+ For processing Search Queries, the primary Request Handler
63
+ provided with Solr is "SearchHandler" It delegates to a sequent
64
+ of SearchComponents (see below) and supports distributed
65
+ queries across multiple shards
66
+ -->
67
+ <requestHandler name="search" class="solr.SearchHandler" default="true">
68
+ <!-- default values for query parameters can be specified, these
69
+ will be overridden by parameters in the request
70
+ -->
71
+ <lst name="defaults">
72
+ <str name="defType">dismax</str>
73
+ <str name="echoParams">explicit</str>
74
+ <int name="rows">10</int>
75
+
76
+ <str name="q.alt">*:*</str>
77
+ <str name="mm">2&lt;-1 5&lt;-2 6&lt;90%</str>
78
+
79
+ <!-- this qf and pf are used by default, if not otherwise specified by
80
+ client. The default blacklight_config will use these for the
81
+ "keywords" search. See the author_qf/author_pf, title_qf, etc
82
+ below, which the default blacklight_config will specify for
83
+ those searches. You may also be interested in:
84
+ http://wiki.apache.org/solr/LocalParams
85
+ -->
86
+
87
+ <str name="qf">
88
+ title_unstem_search^100000
89
+ subtitle_unstem_search^50000
90
+ title_t^25000
91
+ subtitle_t^10000
92
+ title_addl_unstem_search^5000
93
+ title_addl_t^2500
94
+ title_added_entry_unstem_search^1500
95
+ title_added_entry_t^1250
96
+ subject_topic_unstem_search^1000
97
+ subject_unstem_search^750
98
+ subject_topic_facet^625
99
+ subject_t^500
100
+ author_unstem_search^250
101
+ author_addl_unstem_search^250
102
+ author_t^100
103
+ author_addl_t^50
104
+ subject_addl_unstem_search^250
105
+ subject_addl_t^50
106
+ title_series_unstem_search^25
107
+ title_series_t^10
108
+ isbn_t
109
+ text
110
+ </str>
111
+ <str name="pf">
112
+ title_unstem_search^1000000
113
+ subtitle_unstem_search^500000
114
+ title_t^250000
115
+ subtitle_t^100000
116
+ title_addl_unstem_search^50000
117
+ title_addl_t^25000
118
+ title_added_entry_unstem_search^15000
119
+ title_added_entry_t^12500
120
+ subject_topic_unstem_search^10000
121
+ subject_unstem_search^7500
122
+ subject_topic_facet^6250
123
+ subject_t^5000
124
+ author_unstem_search^2500
125
+ author_addl_unstem_search^2500
126
+ author_t^1000
127
+ author_addl_t^500
128
+ subject_addl_unstem_search^2500
129
+ subject_addl_t^500
130
+ title_series_unstem_search^250
131
+ title_series_t^100
132
+ text^10
133
+ </str>
134
+ <str name="author_qf">
135
+ author_unstem_search^200
136
+ author_addl_unstem_search^50
137
+ author_t^20
138
+ author_addl_t
139
+ </str>
140
+ <str name="author_pf">
141
+ author_unstem_search^2000
142
+ author_addl_unstem_search^500
143
+ author_t^200
144
+ author_addl_t^10
145
+ </str>
146
+ <str name="title_qf">
147
+ title_unstem_search^50000
148
+ subtitle_unstem_search^25000
149
+ title_addl_unstem_search^10000
150
+ title_t^5000
151
+ subtitle_t^2500
152
+ title_addl_t^100
153
+ title_added_entry_unstem_search^50
154
+ title_added_entry_t^10
155
+ title_series_unstem_search^5
156
+ title_series_t
157
+ </str>
158
+ <str name="title_pf">
159
+ title_unstem_search^500000
160
+ subtitle_unstem_search^250000
161
+ title_addl_unstem_search^100000
162
+ title_t^50000
163
+ subtitle_t^25000
164
+ title_addl_t^1000
165
+ title_added_entry_unstem_search^500
166
+ title_added_entry_t^100
167
+ title_series_t^50
168
+ title_series_unstem_search^10
169
+ </str>
170
+ <str name="subject_qf">
171
+ subject_topic_unstem_search^200
172
+ subject_unstem_search^125
173
+ subject_topic_facet^100
174
+ subject_t^50
175
+ subject_addl_unstem_search^10
176
+ subject_addl_t
177
+ </str>
178
+ <str name="subject_pf">
179
+ subject_topic_unstem_search^2000
180
+ subject_unstem_search^1250
181
+ subject_t^1000
182
+ subject_topic_facet^500
183
+ subject_addl_unstem_search^100
184
+ subject_addl_t^10
185
+ </str>
186
+
187
+ <int name="ps">3</int>
188
+ <float name="tie">0.01</float>
189
+
190
+ <!-- NOT using marc_display because it is large and will slow things down for search results -->
191
+ <str name="fl">
192
+ id,
193
+ score,
194
+ author_display,
195
+ author_vern_display,
196
+ format,
197
+ isbn_t,
198
+ language_facet,
199
+ lc_callnum_display,
200
+ material_type_display,
201
+ published_display,
202
+ published_vern_display,
203
+ pub_date,
204
+ title_display,
205
+ title_vern_display,
206
+ subject_topic_facet,
207
+ subject_geo_facet,
208
+ subject_era_facet,
209
+ subtitle_display,
210
+ subtitle_vern_display,
211
+ url_fulltext_display,
212
+ url_suppl_display,
213
+ </str>
214
+
215
+ <str name="facet">true</str>
216
+ <str name="facet.mincount">1</str>
217
+ <str name="facet.limit">10</str>
218
+ <str name="facet.field">format</str>
219
+ <str name="facet.field">lc_1letter_facet</str>
220
+ <str name="facet.field">lc_alpha_facet</str>
221
+ <str name="facet.field">lc_b4cutter_facet</str>
222
+ <str name="facet.field">language_facet</str>
223
+ <str name="facet.field">pub_date</str>
224
+ <str name="facet.field">subject_era_facet</str>
225
+ <str name="facet.field">subject_geo_facet</str>
226
+ <str name="facet.field">subject_topic_facet</str>
227
+
228
+ <str name="spellcheck">true</str>
229
+ <str name="spellcheck.dictionary">default</str>
230
+ <str name="spellcheck.onlyMorePopular">true</str>
231
+ <str name="spellcheck.extendedResults">true</str>
232
+ <str name="spellcheck.collate">false</str>
233
+ <str name="spellcheck.count">5</str>
234
+
235
+ </lst>
236
+ <!-- In addition to defaults, "appends" params can be specified
237
+ to identify values which should be appended to the list of
238
+ multi-val params from the query (or the existing "defaults").
239
+ -->
240
+ <!-- In this example, the param "fq=instock:true" would be appended to
241
+ any query time fq params the user may specify, as a mechanism for
242
+ partitioning the index, independent of any user selected filtering
243
+ that may also be desired (perhaps as a result of faceted searching).
244
+
245
+ NOTE: there is *absolutely* nothing a client can do to prevent these
246
+ "appends" values from being used, so don't use this mechanism
247
+ unless you are sure you always want it.
248
+ -->
249
+ <!--
250
+ <lst name="appends">
251
+ <str name="fq">inStock:true</str>
252
+ </lst>
253
+ -->
254
+ <!-- "invariants" are a way of letting the Solr maintainer lock down
255
+ the options available to Solr clients. Any params values
256
+ specified here are used regardless of what values may be specified
257
+ in either the query, the "defaults", or the "appends" params.
258
+
259
+ In this example, the facet.field and facet.query params would
260
+ be fixed, limiting the facets clients can use. Faceting is
261
+ not turned on by default - but if the client does specify
262
+ facet=true in the request, these are the only facets they
263
+ will be able to see counts for; regardless of what other
264
+ facet.field or facet.query params they may specify.
265
+
266
+ NOTE: there is *absolutely* nothing a client can do to prevent these
267
+ "invariants" values from being used, so don't use this mechanism
268
+ unless you are sure you always want it.
269
+ -->
270
+ <!--
271
+ <lst name="invariants">
272
+ <str name="facet.field">cat</str>
273
+ <str name="facet.field">manu_exact</str>
274
+ <str name="facet.query">price:[* TO 500]</str>
275
+ <str name="facet.query">price:[500 TO *]</str>
276
+ </lst>
277
+ -->
278
+ <!-- If the default list of SearchComponents is not desired, that
279
+ list can either be overridden completely, or components can be
280
+ prepended or appended to the default list. (see below)
281
+ -->
282
+ <!--
283
+ <arr name="components">
284
+ <str>nameOfCustomComponent1</str>
285
+ <str>nameOfCustomComponent2</str>
286
+ </arr>
287
+ -->
288
+ <arr name="last-components">
289
+ <str>spellcheck</str>
290
+ </arr>
291
+
292
+ </requestHandler>
293
+
294
+ <!-- for requests to get a single document; use id=666 instead of q=id:666 -->
295
+ <requestHandler name="document" class="solr.SearchHandler" >
296
+ <lst name="defaults">
297
+ <str name="echoParams">all</str>
298
+ <str name="fl">*</str>
299
+ <str name="rows">1</str>
300
+ <str name="q">{!term f=id v=$id}</str> <!-- use id=666 instead of q=id:666 -->
301
+ </lst>
302
+ </requestHandler>
303
+
304
+ <!-- Spell Check
305
+
306
+ The spell check component can return a list of alternative spelling
307
+ suggestions.
308
+
309
+ http://wiki.apache.org/solr/SpellCheckComponent
310
+ -->
311
+ <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
312
+
313
+ <str name="queryAnalyzerFieldType">textSpell</str>
314
+
315
+ <!-- Multiple "Spell Checkers" can be declared and used by this
316
+ component
317
+ -->
318
+
319
+ <!-- a spellchecker built from a field of the main index, and
320
+ written to disk
321
+ -->
322
+ <lst name="spellchecker">
323
+ <str name="name">default</str>
324
+ <str name="field">spell</str>
325
+ <str name="spellcheckIndexDir">./spell</str>
326
+ <str name="buildOnOptimize">true</str>
327
+ </lst>
328
+ <lst name="spellchecker">
329
+ <str name="name">author</str>
330
+ <str name="field">author_spell</str>
331
+ <str name="spellcheckIndexDir">./spell_author</str>
332
+ <str name="accuracy">0.7</str>
333
+ <str name="buildOnOptimize">true</str>
334
+ </lst>
335
+ <lst name="spellchecker">
336
+ <str name="name">subject</str>
337
+ <str name="field">subject_spell</str>
338
+ <str name="spellcheckIndexDir">./spell_subject</str>
339
+ <str name="accuracy">0.7</str>
340
+ <str name="buildOnOptimize">true</str>
341
+ </lst>
342
+ <lst name="spellchecker">
343
+ <str name="name">title</str>
344
+ <str name="field">title_spell</str>
345
+ <str name="spellcheckIndexDir">./spell_title</str>
346
+ <str name="accuracy">0.7</str>
347
+ <str name="buildOnOptimize">true</str>
348
+ </lst>
349
+
350
+ <!-- a spellchecker that uses a different distance measure -->
351
+ <!--
352
+ <lst name="spellchecker">
353
+ <str name="name">jarowinkler</str>
354
+ <str name="field">spell</str>
355
+ <str name="distanceMeasure">
356
+ org.apache.lucene.search.spell.JaroWinklerDistance
357
+ </str>
358
+ <str name="spellcheckIndexDir">spellcheckerJaro</str>
359
+ </lst>
360
+ -->
361
+
362
+ <!-- a spellchecker that use an alternate comparator
363
+
364
+ comparatorClass be one of:
365
+ 1. score (default)
366
+ 2. freq (Frequency first, then score)
367
+ 3. A fully qualified class name
368
+ -->
369
+ <!--
370
+ <lst name="spellchecker">
371
+ <str name="name">freq</str>
372
+ <str name="field">lowerfilt</str>
373
+ <str name="spellcheckIndexDir">spellcheckerFreq</str>
374
+ <str name="comparatorClass">freq</str>
375
+ <str name="buildOnCommit">true</str>
376
+ -->
377
+
378
+ <!-- A spellchecker that reads the list of words from a file -->
379
+ <!--
380
+ <lst name="spellchecker">
381
+ <str name="classname">solr.FileBasedSpellChecker</str>
382
+ <str name="name">file</str>
383
+ <str name="sourceLocation">spellings.txt</str>
384
+ <str name="characterEncoding">UTF-8</str>
385
+ <str name="spellcheckIndexDir">spellcheckerFile</str>
386
+ </lst>
387
+ -->
388
+ </searchComponent>
389
+
390
+ <searchComponent name="suggest" class="solr.SuggestComponent">
391
+ <lst name="suggester">
392
+ <str name="name">mySuggester</str>
393
+ <str name="lookupImpl">FuzzyLookupFactory</str>
394
+ <str name="suggestAnalyzerFieldType">textSuggest</str>
395
+ <str name="buildOnCommit">true</str>
396
+ <str name="field">suggest</str>
397
+ </lst>
398
+ </searchComponent>
399
+
400
+ <requestHandler name="/suggest" class="solr.SearchHandler" startup="lazy">
401
+ <lst name="defaults">
402
+ <str name="suggest">true</str>
403
+ <str name="suggest.count">5</str>
404
+ <str name="suggest.dictionary">mySuggester</str>
405
+ </lst>
406
+ <arr name="components">
407
+ <str>suggest</str>
408
+ </arr>
409
+ </requestHandler>
410
+
411
+ </config>
@@ -0,0 +1,1634 @@
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
+ <!-- Controls what version of Lucene various components of Solr
33
+ adhere to. Generally, you want to use the latest version to
34
+ get all bug fixes and improvements. It is highly recommended
35
+ that you fully re-index after changing this setting as it can
36
+ affect both how text is indexed and queried.
37
+ -->
38
+ <luceneMatchVersion>5.2.0</luceneMatchVersion>
39
+
40
+ <!-- <lib/> directives can be used to instruct Solr to load any Jars
41
+ identified and use them to resolve any "plugins" specified in
42
+ your solrconfig.xml or schema.xml (ie: Analyzers, Request
43
+ Handlers, etc...).
44
+
45
+ All directories and paths are resolved relative to the
46
+ instanceDir.
47
+
48
+ Please note that <lib/> directives are processed in the order
49
+ that they appear in your solrconfig.xml file, and are "stacked"
50
+ on top of each other when building a ClassLoader - so if you have
51
+ plugin jars with dependencies on other jars, the "lower level"
52
+ dependency jars should be loaded first.
53
+
54
+ If a "./lib" directory exists in your instanceDir, all files
55
+ found in it are included as if you had used the following
56
+ syntax...
57
+
58
+ <lib dir="./lib" />
59
+ -->
60
+
61
+ <!-- A 'dir' option by itself adds any files found in the directory
62
+ to the classpath, this is useful for including all jars in a
63
+ directory.
64
+
65
+ When a 'regex' is specified in addition to a 'dir', only the
66
+ files in that directory which completely match the regex
67
+ (anchored on both ends) will be included.
68
+
69
+ If a 'dir' option (with or without a regex) is used and nothing
70
+ is found that matches, a warning will be logged.
71
+
72
+ The examples below can be used to load some solr-contribs along
73
+ with their external dependencies.
74
+ -->
75
+ <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-dataimporthandler-.*\.jar"/>
76
+
77
+ <lib dir="${solr.install.dir:../../../..}/contrib/extraction/lib" regex=".*\.jar"/>
78
+ <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-cell-\d.*\.jar"/>
79
+
80
+ <lib dir="${solr.install.dir:../../../..}/contrib/clustering/lib/" regex=".*\.jar"/>
81
+ <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-clustering-\d.*\.jar"/>
82
+
83
+ <lib dir="${solr.install.dir:../../../..}/contrib/langid/lib/" regex=".*\.jar"/>
84
+ <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-langid-\d.*\.jar"/>
85
+
86
+ <lib dir="${solr.install.dir:../../../..}/contrib/velocity/lib" regex=".*\.jar"/>
87
+ <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-velocity-\d.*\.jar"/>
88
+
89
+ <!-- an exact 'path' can be used instead of a 'dir' to specify a
90
+ specific jar file. This will cause a serious error to be logged
91
+ if it can't be loaded.
92
+ -->
93
+ <!--
94
+ <lib path="../a-jar-that-does-not-exist.jar" />
95
+ -->
96
+
97
+ <!-- Data Directory
98
+
99
+ Used to specify an alternate directory to hold all index data
100
+ other than the default ./data under the Solr home. If
101
+ replication is in use, this should match the replication
102
+ configuration.
103
+ -->
104
+ <dataDir>${solr.data.dir:}</dataDir>
105
+
106
+
107
+ <!-- The DirectoryFactory to use for indexes.
108
+
109
+ solr.StandardDirectoryFactory is filesystem
110
+ based and tries to pick the best implementation for the current
111
+ JVM and platform. solr.NRTCachingDirectoryFactory, the default,
112
+ wraps solr.StandardDirectoryFactory and caches small files in memory
113
+ for better NRT performance.
114
+
115
+ One can force a particular implementation via solr.MMapDirectoryFactory,
116
+ solr.NIOFSDirectoryFactory, or solr.SimpleFSDirectoryFactory.
117
+
118
+ solr.RAMDirectoryFactory is memory based, not
119
+ persistent, and doesn't work with replication.
120
+ -->
121
+ <directoryFactory name="DirectoryFactory"
122
+ class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}">
123
+
124
+
125
+ <!-- These will be used if you are using the solr.HdfsDirectoryFactory,
126
+ otherwise they will be ignored. If you don't plan on using hdfs,
127
+ you can safely remove this section. -->
128
+ <!-- The root directory that collection data should be written to. -->
129
+ <str name="solr.hdfs.home">${solr.hdfs.home:}</str>
130
+ <!-- The hadoop configuration files to use for the hdfs client. -->
131
+ <str name="solr.hdfs.confdir">${solr.hdfs.confdir:}</str>
132
+ <!-- Enable/Disable the hdfs cache. -->
133
+ <str name="solr.hdfs.blockcache.enabled">${solr.hdfs.blockcache.enabled:true}</str>
134
+ <!-- Enable/Disable using one global cache for all SolrCores.
135
+ The settings used will be from the first HdfsDirectoryFactory created. -->
136
+ <str name="solr.hdfs.blockcache.global">${solr.hdfs.blockcache.global:true}</str>
137
+
138
+ </directoryFactory>
139
+
140
+ <!-- The CodecFactory for defining the format of the inverted index.
141
+ The default implementation is SchemaCodecFactory, which is the official Lucene
142
+ index format, but hooks into the schema to provide per-field customization of
143
+ the postings lists and per-document values in the fieldType element
144
+ (postingsFormat/docValuesFormat). Note that most of the alternative implementations
145
+ are experimental, so if you choose to customize the index format, it's a good
146
+ idea to convert back to the official format e.g. via IndexWriter.addIndexes(IndexReader)
147
+ before upgrading to a newer version to avoid unnecessary reindexing.
148
+ -->
149
+ <codecFactory class="solr.SchemaCodecFactory"/>
150
+
151
+ <!-- To enable dynamic schema REST APIs, use the following for <schemaFactory>:
152
+
153
+ <schemaFactory class="ManagedIndexSchemaFactory">
154
+ <bool name="mutable">true</bool>
155
+ <str name="managedSchemaResourceName">managed-schema</str>
156
+ </schemaFactory>
157
+
158
+ When ManagedIndexSchemaFactory is specified, Solr will load the schema from
159
+ the resource named in 'managedSchemaResourceName', rather than from schema.xml.
160
+ Note that the managed schema resource CANNOT be named schema.xml. If the managed
161
+ schema does not exist, Solr will create it after reading schema.xml, then rename
162
+ 'schema.xml' to 'schema.xml.bak'.
163
+
164
+ Do NOT hand edit the managed schema - external modifications will be ignored and
165
+ overwritten as a result of schema modification REST API calls.
166
+
167
+ When ManagedIndexSchemaFactory is specified with mutable = true, schema
168
+ modification REST API calls will be allowed; otherwise, error responses will be
169
+ sent back for these requests.
170
+ -->
171
+ <schemaFactory class="ClassicIndexSchemaFactory"/>
172
+
173
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
174
+ Index Config - These settings control low-level behavior of indexing
175
+ Most example settings here show the default value, but are commented
176
+ out, to more easily see where customizations have been made.
177
+
178
+ Note: This replaces <indexDefaults> and <mainIndex> from older versions
179
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
180
+ <indexConfig>
181
+ <!-- maxFieldLength was removed in 4.0. To get similar behavior, include a
182
+ LimitTokenCountFilterFactory in your fieldType definition. E.g.
183
+ <filter class="solr.LimitTokenCountFilterFactory" maxTokenCount="10000"/>
184
+ -->
185
+ <!-- Maximum time to wait for a write lock (ms) for an IndexWriter. Default: 1000 -->
186
+ <!-- <writeLockTimeout>1000</writeLockTimeout> -->
187
+
188
+ <!-- Expert: Enabling compound file will use less files for the index,
189
+ using fewer file descriptors on the expense of performance decrease.
190
+ Default in Lucene is "true". Default in Solr is "false" (since 3.6) -->
191
+ <!-- <useCompoundFile>false</useCompoundFile> -->
192
+
193
+ <!-- ramBufferSizeMB sets the amount of RAM that may be used by Lucene
194
+ indexing for buffering added documents and deletions before they are
195
+ flushed to the Directory.
196
+ maxBufferedDocs sets a limit on the number of documents buffered
197
+ before flushing.
198
+ If both ramBufferSizeMB and maxBufferedDocs is set, then
199
+ Lucene will flush based on whichever limit is hit first.
200
+ The default is 100 MB. -->
201
+ <!-- <ramBufferSizeMB>100</ramBufferSizeMB> -->
202
+ <!-- <maxBufferedDocs>1000</maxBufferedDocs> -->
203
+
204
+ <!-- Expert: Merge Policy
205
+ The Merge Policy in Lucene controls how merging of segments is done.
206
+ The default since Solr/Lucene 3.3 is TieredMergePolicy.
207
+ The default since Lucene 2.3 was the LogByteSizeMergePolicy,
208
+ Even older versions of Lucene used LogDocMergePolicy.
209
+ -->
210
+ <!--
211
+ <mergePolicy class="org.apache.lucene.index.TieredMergePolicy">
212
+ <int name="maxMergeAtOnce">10</int>
213
+ <int name="segmentsPerTier">10</int>
214
+ </mergePolicy>
215
+ -->
216
+
217
+ <!-- Merge Factor
218
+ The merge factor controls how many segments will get merged at a time.
219
+ For TieredMergePolicy, mergeFactor is a convenience parameter which
220
+ will set both MaxMergeAtOnce and SegmentsPerTier at once.
221
+ For LogByteSizeMergePolicy, mergeFactor decides how many new segments
222
+ will be allowed before they are merged into one.
223
+ Default is 10 for both merge policies.
224
+ -->
225
+ <!--
226
+ <mergeFactor>10</mergeFactor>
227
+ -->
228
+
229
+ <!-- Expert: Merge Scheduler
230
+ The Merge Scheduler in Lucene controls how merges are
231
+ performed. The ConcurrentMergeScheduler (Lucene 2.3 default)
232
+ can perform merges in the background using separate threads.
233
+ The SerialMergeScheduler (Lucene 2.2 default) does not.
234
+ -->
235
+ <!--
236
+ <mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"/>
237
+ -->
238
+
239
+ <!-- LockFactory
240
+
241
+ This option specifies which Lucene LockFactory implementation
242
+ to use.
243
+
244
+ single = SingleInstanceLockFactory - suggested for a
245
+ read-only index or when there is no possibility of
246
+ another process trying to modify the index.
247
+ native = NativeFSLockFactory - uses OS native file locking.
248
+ Do not use when multiple solr webapps in the same
249
+ JVM are attempting to share a single index.
250
+ simple = SimpleFSLockFactory - uses a plain file for locking
251
+
252
+ Defaults: 'native' is default for Solr3.6 and later, otherwise
253
+ 'simple' is the default
254
+
255
+ More details on the nuances of each LockFactory...
256
+ http://wiki.apache.org/lucene-java/AvailableLockFactories
257
+ -->
258
+ <lockType>${solr.lock.type:native}</lockType>
259
+
260
+ <!-- Commit Deletion Policy
261
+ Custom deletion policies can be specified here. The class must
262
+ implement org.apache.lucene.index.IndexDeletionPolicy.
263
+
264
+ The default Solr IndexDeletionPolicy implementation supports
265
+ deleting index commit points on number of commits, age of
266
+ commit point and optimized status.
267
+
268
+ The latest commit point should always be preserved regardless
269
+ of the criteria.
270
+ -->
271
+ <!--
272
+ <deletionPolicy class="solr.SolrDeletionPolicy">
273
+ -->
274
+ <!-- The number of commit points to be kept -->
275
+ <!-- <str name="maxCommitsToKeep">1</str> -->
276
+ <!-- The number of optimized commit points to be kept -->
277
+ <!-- <str name="maxOptimizedCommitsToKeep">0</str> -->
278
+ <!--
279
+ Delete all commit points once they have reached the given age.
280
+ Supports DateMathParser syntax e.g.
281
+ -->
282
+ <!--
283
+ <str name="maxCommitAge">30MINUTES</str>
284
+ <str name="maxCommitAge">1DAY</str>
285
+ -->
286
+ <!--
287
+ </deletionPolicy>
288
+ -->
289
+
290
+ <!-- Lucene Infostream
291
+
292
+ To aid in advanced debugging, Lucene provides an "InfoStream"
293
+ of detailed information when indexing.
294
+
295
+ Setting the value to true will instruct the underlying Lucene
296
+ IndexWriter to write its info stream to solr's log. By default,
297
+ this is enabled here, and controlled through log4j.properties.
298
+ -->
299
+ <infoStream>true</infoStream>
300
+ </indexConfig>
301
+
302
+
303
+ <!-- JMX
304
+
305
+ This example enables JMX if and only if an existing MBeanServer
306
+ is found, use this if you want to configure JMX through JVM
307
+ parameters. Remove this to disable exposing Solr configuration
308
+ and statistics to JMX.
309
+
310
+ For more details see http://wiki.apache.org/solr/SolrJmx
311
+ -->
312
+ <jmx/>
313
+ <!-- If you want to connect to a particular server, specify the
314
+ agentId
315
+ -->
316
+ <!-- <jmx agentId="myAgent" /> -->
317
+ <!-- If you want to start a new MBeanServer, specify the serviceUrl -->
318
+ <!-- <jmx serviceUrl="service:jmx:rmi:///jndi/rmi://localhost:9999/solr"/>
319
+ -->
320
+
321
+ <!-- The default high-performance update handler -->
322
+ <updateHandler class="solr.DirectUpdateHandler2">
323
+
324
+ <!-- Enables a transaction log, used for real-time get, durability, and
325
+ and solr cloud replica recovery. The log can grow as big as
326
+ uncommitted changes to the index, so use of a hard autoCommit
327
+ is recommended (see below).
328
+ "dir" - the target directory for transaction logs, defaults to the
329
+ solr data directory. -->
330
+ <updateLog>
331
+ <str name="dir">${solr.ulog.dir:}</str>
332
+ </updateLog>
333
+
334
+ <!-- AutoCommit
335
+
336
+ Perform a hard commit automatically under certain conditions.
337
+ Instead of enabling autoCommit, consider using "commitWithin"
338
+ when adding documents.
339
+
340
+ http://wiki.apache.org/solr/UpdateXmlMessages
341
+
342
+ maxDocs - Maximum number of documents to add since the last
343
+ commit before automatically triggering a new commit.
344
+
345
+ maxTime - Maximum amount of time in ms that is allowed to pass
346
+ since a document was added before automatically
347
+ triggering a new commit.
348
+ openSearcher - if false, the commit causes recent index changes
349
+ to be flushed to stable storage, but does not cause a new
350
+ searcher to be opened to make those changes visible.
351
+
352
+ If the updateLog is enabled, then it's highly recommended to
353
+ have some sort of hard autoCommit to limit the log size.
354
+ -->
355
+ <autoCommit>
356
+ <maxTime>${solr.autoCommit.maxTime:15000}</maxTime>
357
+ <openSearcher>false</openSearcher>
358
+ </autoCommit>
359
+
360
+ <!-- softAutoCommit is like autoCommit except it causes a
361
+ 'soft' commit which only ensures that changes are visible
362
+ but does not ensure that data is synced to disk. This is
363
+ faster and more near-realtime friendly than a hard commit.
364
+ -->
365
+
366
+ <autoSoftCommit>
367
+ <maxTime>${solr.autoSoftCommit.maxTime:-1}</maxTime>
368
+ </autoSoftCommit>
369
+
370
+ <!-- Update Related Event Listeners
371
+
372
+ Various IndexWriter related events can trigger Listeners to
373
+ take actions.
374
+
375
+ postCommit - fired after every commit or optimize command
376
+ postOptimize - fired after every optimize command
377
+ -->
378
+ <!-- The RunExecutableListener executes an external command from a
379
+ hook such as postCommit or postOptimize.
380
+
381
+ exe - the name of the executable to run
382
+ dir - dir to use as the current working directory. (default=".")
383
+ wait - the calling thread waits until the executable returns.
384
+ (default="true")
385
+ args - the arguments to pass to the program. (default is none)
386
+ env - environment variables to set. (default is none)
387
+ -->
388
+ <!-- This example shows how RunExecutableListener could be used
389
+ with the script based replication...
390
+ http://wiki.apache.org/solr/CollectionDistribution
391
+ -->
392
+ <!--
393
+ <listener event="postCommit" class="solr.RunExecutableListener">
394
+ <str name="exe">solr/bin/snapshooter</str>
395
+ <str name="dir">.</str>
396
+ <bool name="wait">true</bool>
397
+ <arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
398
+ <arr name="env"> <str>MYVAR=val1</str> </arr>
399
+ </listener>
400
+ -->
401
+
402
+ </updateHandler>
403
+
404
+ <!-- IndexReaderFactory
405
+
406
+ Use the following format to specify a custom IndexReaderFactory,
407
+ which allows for alternate IndexReader implementations.
408
+
409
+ ** Experimental Feature **
410
+
411
+ Please note - Using a custom IndexReaderFactory may prevent
412
+ certain other features from working. The API to
413
+ IndexReaderFactory may change without warning or may even be
414
+ removed from future releases if the problems cannot be
415
+ resolved.
416
+
417
+
418
+ ** Features that may not work with custom IndexReaderFactory **
419
+
420
+ The ReplicationHandler assumes a disk-resident index. Using a
421
+ custom IndexReader implementation may cause incompatibility
422
+ with ReplicationHandler and may cause replication to not work
423
+ correctly. See SOLR-1366 for details.
424
+
425
+ -->
426
+ <!--
427
+ <indexReaderFactory name="IndexReaderFactory" class="package.class">
428
+ <str name="someArg">Some Value</str>
429
+ </indexReaderFactory >
430
+ -->
431
+
432
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
433
+ Query section - these settings control query time things like caches
434
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
435
+ <query>
436
+ <!-- Max Boolean Clauses
437
+
438
+ Maximum number of clauses in each BooleanQuery, an exception
439
+ is thrown if exceeded.
440
+
441
+ ** WARNING **
442
+
443
+ This option actually modifies a global Lucene property that
444
+ will affect all SolrCores. If multiple solrconfig.xml files
445
+ disagree on this property, the value at any given moment will
446
+ be based on the last SolrCore to be initialized.
447
+
448
+ -->
449
+ <maxBooleanClauses>1024</maxBooleanClauses>
450
+
451
+
452
+ <!-- Solr Internal Query Caches
453
+
454
+ There are two implementations of cache available for Solr,
455
+ LRUCache, based on a synchronized LinkedHashMap, and
456
+ FastLRUCache, based on a ConcurrentHashMap.
457
+
458
+ FastLRUCache has faster gets and slower puts in single
459
+ threaded operation and thus is generally faster than LRUCache
460
+ when the hit ratio of the cache is high (> 75%), and may be
461
+ faster under other scenarios on multi-cpu systems.
462
+ -->
463
+
464
+ <!-- Filter Cache
465
+
466
+ Cache used by SolrIndexSearcher for filters (DocSets),
467
+ unordered sets of *all* documents that match a query. When a
468
+ new searcher is opened, its caches may be prepopulated or
469
+ "autowarmed" using data from caches in the old searcher.
470
+ autowarmCount is the number of items to prepopulate. For
471
+ LRUCache, the autowarmed items will be the most recently
472
+ accessed items.
473
+
474
+ Parameters:
475
+ class - the SolrCache implementation LRUCache or
476
+ (LRUCache or FastLRUCache)
477
+ size - the maximum number of entries in the cache
478
+ initialSize - the initial capacity (number of entries) of
479
+ the cache. (see java.util.HashMap)
480
+ autowarmCount - the number of entries to prepopulate from
481
+ and old cache.
482
+ -->
483
+ <filterCache class="solr.FastLRUCache"
484
+ size="512"
485
+ initialSize="512"
486
+ autowarmCount="0"/>
487
+
488
+ <!-- Query Result Cache
489
+
490
+ Caches results of searches - ordered lists of document ids
491
+ (DocList) based on a query, a sort, and the range of documents requested.
492
+ -->
493
+ <queryResultCache class="solr.LRUCache"
494
+ size="512"
495
+ initialSize="512"
496
+ autowarmCount="0"/>
497
+
498
+ <!-- Document Cache
499
+
500
+ Caches Lucene Document objects (the stored fields for each
501
+ document). Since Lucene internal document ids are transient,
502
+ this cache will not be autowarmed.
503
+ -->
504
+ <documentCache class="solr.LRUCache"
505
+ size="512"
506
+ initialSize="512"
507
+ autowarmCount="0"/>
508
+
509
+ <!-- custom cache currently used by block join -->
510
+ <cache name="perSegFilter"
511
+ class="solr.search.LRUCache"
512
+ size="10"
513
+ initialSize="0"
514
+ autowarmCount="10"
515
+ regenerator="solr.NoOpRegenerator"/>
516
+
517
+ <!-- Field Value Cache
518
+
519
+ Cache used to hold field values that are quickly accessible
520
+ by document id. The fieldValueCache is created by default
521
+ even if not configured here.
522
+ -->
523
+ <!--
524
+ <fieldValueCache class="solr.FastLRUCache"
525
+ size="512"
526
+ autowarmCount="128"
527
+ showItems="32" />
528
+ -->
529
+
530
+ <!-- Custom Cache
531
+
532
+ Example of a generic cache. These caches may be accessed by
533
+ name through SolrIndexSearcher.getCache(),cacheLookup(), and
534
+ cacheInsert(). The purpose is to enable easy caching of
535
+ user/application level data. The regenerator argument should
536
+ be specified as an implementation of solr.CacheRegenerator
537
+ if autowarming is desired.
538
+ -->
539
+ <!--
540
+ <cache name="myUserCache"
541
+ class="solr.LRUCache"
542
+ size="4096"
543
+ initialSize="1024"
544
+ autowarmCount="1024"
545
+ regenerator="com.mycompany.MyRegenerator"
546
+ />
547
+ -->
548
+
549
+
550
+ <!-- Lazy Field Loading
551
+
552
+ If true, stored fields that are not requested will be loaded
553
+ lazily. This can result in a significant speed improvement
554
+ if the usual case is to not load all stored fields,
555
+ especially if the skipped fields are large compressed text
556
+ fields.
557
+ -->
558
+ <enableLazyFieldLoading>true</enableLazyFieldLoading>
559
+
560
+ <!-- Use Filter For Sorted Query
561
+
562
+ A possible optimization that attempts to use a filter to
563
+ satisfy a search. If the requested sort does not include
564
+ score, then the filterCache will be checked for a filter
565
+ matching the query. If found, the filter will be used as the
566
+ source of document ids, and then the sort will be applied to
567
+ that.
568
+
569
+ For most situations, this will not be useful unless you
570
+ frequently get the same search repeatedly with different sort
571
+ options, and none of them ever use "score"
572
+ -->
573
+ <!--
574
+ <useFilterForSortedQuery>true</useFilterForSortedQuery>
575
+ -->
576
+
577
+ <!-- Result Window Size
578
+
579
+ An optimization for use with the queryResultCache. When a search
580
+ is requested, a superset of the requested number of document ids
581
+ are collected. For example, if a search for a particular query
582
+ requests matching documents 10 through 19, and queryWindowSize is 50,
583
+ then documents 0 through 49 will be collected and cached. Any further
584
+ requests in that range can be satisfied via the cache.
585
+ -->
586
+ <queryResultWindowSize>20</queryResultWindowSize>
587
+
588
+ <!-- Maximum number of documents to cache for any entry in the
589
+ queryResultCache.
590
+ -->
591
+ <queryResultMaxDocsCached>200</queryResultMaxDocsCached>
592
+
593
+ <!-- Query Related Event Listeners
594
+
595
+ Various IndexSearcher related events can trigger Listeners to
596
+ take actions.
597
+
598
+ newSearcher - fired whenever a new searcher is being prepared
599
+ and there is a current searcher handling requests (aka
600
+ registered). It can be used to prime certain caches to
601
+ prevent long request times for certain requests.
602
+
603
+ firstSearcher - fired whenever a new searcher is being
604
+ prepared but there is no current registered searcher to handle
605
+ requests or to gain autowarming data from.
606
+
607
+
608
+ -->
609
+ <!-- QuerySenderListener takes an array of NamedList and executes a
610
+ local query request for each NamedList in sequence.
611
+ -->
612
+ <listener event="newSearcher" class="solr.QuerySenderListener">
613
+ <arr name="queries">
614
+ <!--
615
+ <lst><str name="q">solr</str><str name="sort">price asc</str></lst>
616
+ <lst><str name="q">rocks</str><str name="sort">weight asc</str></lst>
617
+ -->
618
+ </arr>
619
+ </listener>
620
+ <listener event="firstSearcher" class="solr.QuerySenderListener">
621
+ <arr name="queries">
622
+ <lst>
623
+ <str name="q">static firstSearcher warming in solrconfig.xml</str>
624
+ </lst>
625
+ </arr>
626
+ </listener>
627
+
628
+ <!-- Use Cold Searcher
629
+
630
+ If a search request comes in and there is no current
631
+ registered searcher, then immediately register the still
632
+ warming searcher and use it. If "false" then all requests
633
+ will block until the first searcher is done warming.
634
+ -->
635
+ <useColdSearcher>false</useColdSearcher>
636
+
637
+ <!-- Max Warming Searchers
638
+
639
+ Maximum number of searchers that may be warming in the
640
+ background concurrently. An error is returned if this limit
641
+ is exceeded.
642
+
643
+ Recommend values of 1-2 for read-only slaves, higher for
644
+ masters w/o cache warming.
645
+ -->
646
+ <maxWarmingSearchers>2</maxWarmingSearchers>
647
+
648
+ </query>
649
+
650
+
651
+ <!-- Request Dispatcher
652
+
653
+ This section contains instructions for how the SolrDispatchFilter
654
+ should behave when processing requests for this SolrCore.
655
+
656
+ handleSelect is a legacy option that affects the behavior of requests
657
+ such as /select?qt=XXX
658
+
659
+ handleSelect="true" will cause the SolrDispatchFilter to process
660
+ the request and dispatch the query to a handler specified by the
661
+ "qt" param, assuming "/select" isn't already registered.
662
+
663
+ handleSelect="false" will cause the SolrDispatchFilter to
664
+ ignore "/select" requests, resulting in a 404 unless a handler
665
+ is explicitly registered with the name "/select"
666
+
667
+ handleSelect="true" is not recommended for new users, but is the default
668
+ for backwards compatibility
669
+ -->
670
+ <requestDispatcher handleSelect="false">
671
+ <!-- Request Parsing
672
+
673
+ These settings indicate how Solr Requests may be parsed, and
674
+ what restrictions may be placed on the ContentStreams from
675
+ those requests
676
+
677
+ enableRemoteStreaming - enables use of the stream.file
678
+ and stream.url parameters for specifying remote streams.
679
+
680
+ multipartUploadLimitInKB - specifies the max size (in KiB) of
681
+ Multipart File Uploads that Solr will allow in a Request.
682
+
683
+ formdataUploadLimitInKB - specifies the max size (in KiB) of
684
+ form data (application/x-www-form-urlencoded) sent via
685
+ POST. You can use POST to pass request parameters not
686
+ fitting into the URL.
687
+
688
+ addHttpRequestToContext - if set to true, it will instruct
689
+ the requestParsers to include the original HttpServletRequest
690
+ object in the context map of the SolrQueryRequest under the
691
+ key "httpRequest". It will not be used by any of the existing
692
+ Solr components, but may be useful when developing custom
693
+ plugins.
694
+
695
+ *** WARNING ***
696
+ The settings below authorize Solr to fetch remote files, You
697
+ should make sure your system has some authentication before
698
+ using enableRemoteStreaming="true"
699
+
700
+ -->
701
+ <requestParsers enableRemoteStreaming="true"
702
+ multipartUploadLimitInKB="2048000"
703
+ formdataUploadLimitInKB="2048"
704
+ addHttpRequestToContext="false"/>
705
+
706
+ <!-- HTTP Caching
707
+
708
+ Set HTTP caching related parameters (for proxy caches and clients).
709
+
710
+ The options below instruct Solr not to output any HTTP Caching
711
+ related headers
712
+ -->
713
+ <httpCaching never304="true"/>
714
+ <!-- If you include a <cacheControl> directive, it will be used to
715
+ generate a Cache-Control header (as well as an Expires header
716
+ if the value contains "max-age=")
717
+
718
+ By default, no Cache-Control header is generated.
719
+
720
+ You can use the <cacheControl> option even if you have set
721
+ never304="true"
722
+ -->
723
+ <!--
724
+ <httpCaching never304="true" >
725
+ <cacheControl>max-age=30, public</cacheControl>
726
+ </httpCaching>
727
+ -->
728
+ <!-- To enable Solr to respond with automatically generated HTTP
729
+ Caching headers, and to response to Cache Validation requests
730
+ correctly, set the value of never304="false"
731
+
732
+ This will cause Solr to generate Last-Modified and ETag
733
+ headers based on the properties of the Index.
734
+
735
+ The following options can also be specified to affect the
736
+ values of these headers...
737
+
738
+ lastModFrom - the default value is "openTime" which means the
739
+ Last-Modified value (and validation against If-Modified-Since
740
+ requests) will all be relative to when the current Searcher
741
+ was opened. You can change it to lastModFrom="dirLastMod" if
742
+ you want the value to exactly correspond to when the physical
743
+ index was last modified.
744
+
745
+ etagSeed="..." is an option you can change to force the ETag
746
+ header (and validation against If-None-Match requests) to be
747
+ different even if the index has not changed (ie: when making
748
+ significant changes to your config file)
749
+
750
+ (lastModifiedFrom and etagSeed are both ignored if you use
751
+ the never304="true" option)
752
+ -->
753
+ <!--
754
+ <httpCaching lastModifiedFrom="openTime"
755
+ etagSeed="Solr">
756
+ <cacheControl>max-age=30, public</cacheControl>
757
+ </httpCaching>
758
+ -->
759
+ </requestDispatcher>
760
+
761
+ <!-- Request Handlers
762
+
763
+ http://wiki.apache.org/solr/SolrRequestHandler
764
+
765
+ Incoming queries will be dispatched to a specific handler by name
766
+ based on the path specified in the request.
767
+
768
+ Legacy behavior: If the request path uses "/select" but no Request
769
+ Handler has that name, and if handleSelect="true" has been specified in
770
+ the requestDispatcher, then the Request Handler is dispatched based on
771
+ the qt parameter. Handlers without a leading '/' are accessed this way
772
+ like so: http://host/app/[core/]select?qt=name If no qt is
773
+ given, then the requestHandler that declares default="true" will be
774
+ used or the one named "standard".
775
+
776
+ If a Request Handler is declared with startup="lazy", then it will
777
+ not be initialized until the first request that uses it.
778
+
779
+ -->
780
+
781
+ <requestHandler name="/dataimport" class="solr.DataImportHandler">
782
+ <lst name="defaults">
783
+ <str name="config">db-data-config.xml</str>
784
+ </lst>
785
+ </requestHandler>
786
+
787
+ <!-- SearchHandler
788
+
789
+ http://wiki.apache.org/solr/SearchHandler
790
+
791
+ For processing Search Queries, the primary Request Handler
792
+ provided with Solr is "SearchHandler" It delegates to a sequent
793
+ of SearchComponents (see below) and supports distributed
794
+ queries across multiple shards
795
+ -->
796
+ <requestHandler name="/select" class="solr.SearchHandler">
797
+ <!-- default values for query parameters can be specified, these
798
+ will be overridden by parameters in the request
799
+ -->
800
+ <lst name="defaults">
801
+ <str name="echoParams">explicit</str>
802
+ <int name="rows">10</int>
803
+ <str name="df">text</str>
804
+ </lst>
805
+ <!-- In addition to defaults, "appends" params can be specified
806
+ to identify values which should be appended to the list of
807
+ multi-val params from the query (or the existing "defaults").
808
+ -->
809
+ <!-- In this example, the param "fq=instock:true" would be appended to
810
+ any query time fq params the user may specify, as a mechanism for
811
+ partitioning the index, independent of any user selected filtering
812
+ that may also be desired (perhaps as a result of faceted searching).
813
+
814
+ NOTE: there is *absolutely* nothing a client can do to prevent these
815
+ "appends" values from being used, so don't use this mechanism
816
+ unless you are sure you always want it.
817
+ -->
818
+ <!--
819
+ <lst name="appends">
820
+ <str name="fq">inStock:true</str>
821
+ </lst>
822
+ -->
823
+ <!-- "invariants" are a way of letting the Solr maintainer lock down
824
+ the options available to Solr clients. Any params values
825
+ specified here are used regardless of what values may be specified
826
+ in either the query, the "defaults", or the "appends" params.
827
+
828
+ In this example, the facet.field and facet.query params would
829
+ be fixed, limiting the facets clients can use. Faceting is
830
+ not turned on by default - but if the client does specify
831
+ facet=true in the request, these are the only facets they
832
+ will be able to see counts for; regardless of what other
833
+ facet.field or facet.query params they may specify.
834
+
835
+ NOTE: there is *absolutely* nothing a client can do to prevent these
836
+ "invariants" values from being used, so don't use this mechanism
837
+ unless you are sure you always want it.
838
+ -->
839
+ <!--
840
+ <lst name="invariants">
841
+ <str name="facet.field">cat</str>
842
+ <str name="facet.field">manu_exact</str>
843
+ <str name="facet.query">price:[* TO 500]</str>
844
+ <str name="facet.query">price:[500 TO *]</str>
845
+ </lst>
846
+ -->
847
+ <!-- If the default list of SearchComponents is not desired, that
848
+ list can either be overridden completely, or components can be
849
+ prepended or appended to the default list. (see below)
850
+ -->
851
+ <!--
852
+ <arr name="components">
853
+ <str>nameOfCustomComponent1</str>
854
+ <str>nameOfCustomComponent2</str>
855
+ </arr>
856
+ -->
857
+ </requestHandler>
858
+
859
+ <!-- A request handler that returns indented JSON by default -->
860
+ <requestHandler name="/query" class="solr.SearchHandler">
861
+ <lst name="defaults">
862
+ <str name="echoParams">explicit</str>
863
+ <str name="wt">json</str>
864
+ <str name="indent">true</str>
865
+ <str name="df">text</str>
866
+ </lst>
867
+ </requestHandler>
868
+
869
+
870
+ <!-- A Robust Example
871
+
872
+ This example SearchHandler declaration shows off usage of the
873
+ SearchHandler with many defaults declared
874
+
875
+ Note that multiple instances of the same Request Handler
876
+ (SearchHandler) can be registered multiple times with different
877
+ names (and different init parameters)
878
+ -->
879
+ <requestHandler name="/browse" class="solr.SearchHandler">
880
+ <lst name="defaults">
881
+ <str name="echoParams">explicit</str>
882
+
883
+ <!-- VelocityResponseWriter settings -->
884
+ <str name="wt">velocity</str>
885
+ <str name="v.template">browse</str>
886
+ <str name="v.layout">layout</str>
887
+
888
+ <!-- Query settings -->
889
+ <str name="defType">edismax</str>
890
+ <str name="q.alt">*:*</str>
891
+ <str name="rows">10</str>
892
+ <str name="fl">*,score</str>
893
+
894
+ <!-- Faceting defaults -->
895
+ <str name="facet">on</str>
896
+ <str name="facet.mincount">1</str>
897
+ </lst>
898
+ </requestHandler>
899
+
900
+ <initParams path="/update/**,/query,/select,/tvrh,/elevate,/spell,/browse">
901
+ <lst name="defaults">
902
+ <str name="df">text</str>
903
+ </lst>
904
+ </initParams>
905
+
906
+ <!-- Solr Cell Update Request Handler
907
+
908
+ http://wiki.apache.org/solr/ExtractingRequestHandler
909
+
910
+ -->
911
+ <requestHandler name="/update/extract"
912
+ startup="lazy"
913
+ class="solr.extraction.ExtractingRequestHandler">
914
+ <lst name="defaults">
915
+ <str name="lowernames">true</str>
916
+ <str name="uprefix">ignored_</str>
917
+
918
+ <!-- capture link hrefs but ignore div attributes -->
919
+ <str name="captureAttr">true</str>
920
+ <str name="fmap.a">links</str>
921
+ <str name="fmap.div">ignored_</str>
922
+ </lst>
923
+ </requestHandler>
924
+
925
+
926
+ <!-- Field Analysis Request Handler
927
+
928
+ RequestHandler that provides much the same functionality as
929
+ analysis.jsp. Provides the ability to specify multiple field
930
+ types and field names in the same request and outputs
931
+ index-time and query-time analysis for each of them.
932
+
933
+ Request parameters are:
934
+ analysis.fieldname - field name whose analyzers are to be used
935
+
936
+ analysis.fieldtype - field type whose analyzers are to be used
937
+ analysis.fieldvalue - text for index-time analysis
938
+ q (or analysis.q) - text for query time analysis
939
+ analysis.showmatch (true|false) - When set to true and when
940
+ query analysis is performed, the produced tokens of the
941
+ field value analysis will be marked as "matched" for every
942
+ token that is produces by the query analysis
943
+ -->
944
+ <requestHandler name="/analysis/field"
945
+ startup="lazy"
946
+ class="solr.FieldAnalysisRequestHandler"/>
947
+
948
+
949
+ <!-- Document Analysis Handler
950
+
951
+ http://wiki.apache.org/solr/AnalysisRequestHandler
952
+
953
+ An analysis handler that provides a breakdown of the analysis
954
+ process of provided documents. This handler expects a (single)
955
+ content stream with the following format:
956
+
957
+ <docs>
958
+ <doc>
959
+ <field name="id">1</field>
960
+ <field name="name">The Name</field>
961
+ <field name="text">The Text Value</field>
962
+ </doc>
963
+ <doc>...</doc>
964
+ <doc>...</doc>
965
+ ...
966
+ </docs>
967
+
968
+ Note: Each document must contain a field which serves as the
969
+ unique key. This key is used in the returned response to associate
970
+ an analysis breakdown to the analyzed document.
971
+
972
+ Like the FieldAnalysisRequestHandler, this handler also supports
973
+ query analysis by sending either an "analysis.query" or "q"
974
+ request parameter that holds the query text to be analyzed. It
975
+ also supports the "analysis.showmatch" parameter which when set to
976
+ true, all field tokens that match the query tokens will be marked
977
+ as a "match".
978
+ -->
979
+ <requestHandler name="/analysis/document"
980
+ class="solr.DocumentAnalysisRequestHandler"
981
+ startup="lazy"/>
982
+
983
+ <!-- Echo the request contents back to the client -->
984
+ <requestHandler name="/debug/dump" class="solr.DumpRequestHandler">
985
+ <lst name="defaults">
986
+ <str name="echoParams">explicit</str>
987
+ <str name="echoHandler">true</str>
988
+ </lst>
989
+ </requestHandler>
990
+
991
+ <!-- Search Components
992
+
993
+ Search components are registered to SolrCore and used by
994
+ instances of SearchHandler (which can access them by name)
995
+
996
+ By default, the following components are available:
997
+
998
+ <searchComponent name="query" class="solr.QueryComponent" />
999
+ <searchComponent name="facet" class="solr.FacetComponent" />
1000
+ <searchComponent name="mlt" class="solr.MoreLikeThisComponent" />
1001
+ <searchComponent name="highlight" class="solr.HighlightComponent" />
1002
+ <searchComponent name="stats" class="solr.StatsComponent" />
1003
+ <searchComponent name="debug" class="solr.DebugComponent" />
1004
+
1005
+ Default configuration in a requestHandler would look like:
1006
+
1007
+ <arr name="components">
1008
+ <str>query</str>
1009
+ <str>facet</str>
1010
+ <str>mlt</str>
1011
+ <str>highlight</str>
1012
+ <str>stats</str>
1013
+ <str>debug</str>
1014
+ </arr>
1015
+
1016
+ If you register a searchComponent to one of the standard names,
1017
+ that will be used instead of the default.
1018
+
1019
+ To insert components before or after the 'standard' components, use:
1020
+
1021
+ <arr name="first-components">
1022
+ <str>myFirstComponentName</str>
1023
+ </arr>
1024
+
1025
+ <arr name="last-components">
1026
+ <str>myLastComponentName</str>
1027
+ </arr>
1028
+
1029
+ NOTE: The component registered with the name "debug" will
1030
+ always be executed after the "last-components"
1031
+
1032
+ -->
1033
+
1034
+ <!-- Spell Check
1035
+
1036
+ The spell check component can return a list of alternative spelling
1037
+ suggestions.
1038
+
1039
+ http://wiki.apache.org/solr/SpellCheckComponent
1040
+ -->
1041
+ <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
1042
+
1043
+ <str name="queryAnalyzerFieldType">text_general</str>
1044
+
1045
+ <!-- Multiple "Spell Checkers" can be declared and used by this
1046
+ component
1047
+ -->
1048
+
1049
+ <!-- a spellchecker built from a field of the main index -->
1050
+ <lst name="spellchecker">
1051
+ <str name="name">default</str>
1052
+ <str name="field">text</str>
1053
+ <str name="classname">solr.DirectSolrSpellChecker</str>
1054
+ <!-- the spellcheck distance measure used, the default is the internal levenshtein -->
1055
+ <str name="distanceMeasure">internal</str>
1056
+ <!-- minimum accuracy needed to be considered a valid spellcheck suggestion -->
1057
+ <float name="accuracy">0.5</float>
1058
+ <!-- the maximum #edits we consider when enumerating terms: can be 1 or 2 -->
1059
+ <int name="maxEdits">2</int>
1060
+ <!-- the minimum shared prefix when enumerating terms -->
1061
+ <int name="minPrefix">1</int>
1062
+ <!-- maximum number of inspections per result. -->
1063
+ <int name="maxInspections">5</int>
1064
+ <!-- minimum length of a query term to be considered for correction -->
1065
+ <int name="minQueryLength">4</int>
1066
+ <!-- maximum threshold of documents a query term can appear to be considered for correction -->
1067
+ <float name="maxQueryFrequency">0.01</float>
1068
+ <!-- uncomment this to require suggestions to occur in 1% of the documents
1069
+ <float name="thresholdTokenFrequency">.01</float>
1070
+ -->
1071
+ </lst>
1072
+
1073
+ <!-- a spellchecker that can break or combine words. See "/spell" handler below for usage -->
1074
+ <lst name="spellchecker">
1075
+ <str name="name">wordbreak</str>
1076
+ <str name="classname">solr.WordBreakSolrSpellChecker</str>
1077
+ <str name="field">name</str>
1078
+ <str name="combineWords">true</str>
1079
+ <str name="breakWords">true</str>
1080
+ <int name="maxChanges">10</int>
1081
+ </lst>
1082
+
1083
+ <!-- a spellchecker that uses a different distance measure -->
1084
+ <!--
1085
+ <lst name="spellchecker">
1086
+ <str name="name">jarowinkler</str>
1087
+ <str name="field">spell</str>
1088
+ <str name="classname">solr.DirectSolrSpellChecker</str>
1089
+ <str name="distanceMeasure">
1090
+ org.apache.lucene.search.spell.JaroWinklerDistance
1091
+ </str>
1092
+ </lst>
1093
+ -->
1094
+
1095
+ <!-- a spellchecker that use an alternate comparator
1096
+
1097
+ comparatorClass be one of:
1098
+ 1. score (default)
1099
+ 2. freq (Frequency first, then score)
1100
+ 3. A fully qualified class name
1101
+ -->
1102
+ <!--
1103
+ <lst name="spellchecker">
1104
+ <str name="name">freq</str>
1105
+ <str name="field">lowerfilt</str>
1106
+ <str name="classname">solr.DirectSolrSpellChecker</str>
1107
+ <str name="comparatorClass">freq</str>
1108
+ -->
1109
+
1110
+ <!-- A spellchecker that reads the list of words from a file -->
1111
+ <!--
1112
+ <lst name="spellchecker">
1113
+ <str name="classname">solr.FileBasedSpellChecker</str>
1114
+ <str name="name">file</str>
1115
+ <str name="sourceLocation">spellings.txt</str>
1116
+ <str name="characterEncoding">UTF-8</str>
1117
+ <str name="spellcheckIndexDir">spellcheckerFile</str>
1118
+ </lst>
1119
+ -->
1120
+ </searchComponent>
1121
+
1122
+ <!-- A request handler for demonstrating the spellcheck component.
1123
+
1124
+ NOTE: This is purely as an example. The whole purpose of the
1125
+ SpellCheckComponent is to hook it into the request handler that
1126
+ handles your normal user queries so that a separate request is
1127
+ not needed to get suggestions.
1128
+
1129
+ IN OTHER WORDS, THERE IS REALLY GOOD CHANCE THE SETUP BELOW IS
1130
+ NOT WHAT YOU WANT FOR YOUR PRODUCTION SYSTEM!
1131
+
1132
+ See http://wiki.apache.org/solr/SpellCheckComponent for details
1133
+ on the request parameters.
1134
+ -->
1135
+ <requestHandler name="/spell" class="solr.SearchHandler" startup="lazy">
1136
+ <lst name="defaults">
1137
+ <str name="df">text</str>
1138
+ <!-- Solr will use suggestions from both the 'default' spellchecker
1139
+ and from the 'wordbreak' spellchecker and combine them.
1140
+ collations (re-written queries) can include a combination of
1141
+ corrections from both spellcheckers -->
1142
+ <str name="spellcheck.dictionary">default</str>
1143
+ <str name="spellcheck.dictionary">wordbreak</str>
1144
+ <str name="spellcheck">on</str>
1145
+ <str name="spellcheck.extendedResults">true</str>
1146
+ <str name="spellcheck.count">10</str>
1147
+ <str name="spellcheck.alternativeTermCount">5</str>
1148
+ <str name="spellcheck.maxResultsForSuggest">5</str>
1149
+ <str name="spellcheck.collate">true</str>
1150
+ <str name="spellcheck.collateExtendedResults">true</str>
1151
+ <str name="spellcheck.maxCollationTries">10</str>
1152
+ <str name="spellcheck.maxCollations">5</str>
1153
+ </lst>
1154
+ <arr name="last-components">
1155
+ <str>spellcheck</str>
1156
+ </arr>
1157
+ </requestHandler>
1158
+
1159
+ <searchComponent name="suggest" class="solr.SuggestComponent">
1160
+ <lst name="suggester">
1161
+ <str name="name">mySuggester</str>
1162
+ <str name="lookupImpl">FuzzyLookupFactory</str>
1163
+ <!-- org.apache.solr.spelling.suggest.fst -->
1164
+ <str name="dictionaryImpl">DocumentDictionaryFactory</str>
1165
+ <!-- org.apache.solr.spelling.suggest.HighFrequencyDictionaryFactory -->
1166
+ <str name="field">cat</str>
1167
+ <str name="weightField">price</str>
1168
+ <str name="suggestAnalyzerFieldType">string</str>
1169
+ </lst>
1170
+ </searchComponent>
1171
+
1172
+ <requestHandler name="/suggest" class="solr.SearchHandler" startup="lazy">
1173
+ <lst name="defaults">
1174
+ <str name="suggest">true</str>
1175
+ <str name="suggest.count">10</str>
1176
+ </lst>
1177
+ <arr name="components">
1178
+ <str>suggest</str>
1179
+ </arr>
1180
+ </requestHandler>
1181
+ <!-- Term Vector Component
1182
+
1183
+ http://wiki.apache.org/solr/TermVectorComponent
1184
+ -->
1185
+ <searchComponent name="tvComponent" class="solr.TermVectorComponent"/>
1186
+
1187
+ <!-- A request handler for demonstrating the term vector component
1188
+
1189
+ This is purely as an example.
1190
+
1191
+ In reality you will likely want to add the component to your
1192
+ already specified request handlers.
1193
+ -->
1194
+ <requestHandler name="/tvrh" class="solr.SearchHandler" startup="lazy">
1195
+ <lst name="defaults">
1196
+ <str name="df">text</str>
1197
+ <bool name="tv">true</bool>
1198
+ </lst>
1199
+ <arr name="last-components">
1200
+ <str>tvComponent</str>
1201
+ </arr>
1202
+ </requestHandler>
1203
+
1204
+ <!-- Clustering Component
1205
+
1206
+ You'll need to set the solr.clustering.enabled system property
1207
+ when running solr to run with clustering enabled:
1208
+
1209
+ java -Dsolr.clustering.enabled=true -jar start.jar
1210
+
1211
+ http://wiki.apache.org/solr/ClusteringComponent
1212
+ http://carrot2.github.io/solr-integration-strategies/
1213
+ -->
1214
+ <searchComponent name="clustering"
1215
+ enable="${solr.clustering.enabled:false}"
1216
+ class="solr.clustering.ClusteringComponent">
1217
+ <lst name="engine">
1218
+ <str name="name">lingo</str>
1219
+
1220
+ <!-- Class name of a clustering algorithm compatible with the Carrot2 framework.
1221
+
1222
+ Currently available open source algorithms are:
1223
+ * org.carrot2.clustering.lingo.LingoClusteringAlgorithm
1224
+ * org.carrot2.clustering.stc.STCClusteringAlgorithm
1225
+ * org.carrot2.clustering.kmeans.BisectingKMeansClusteringAlgorithm
1226
+
1227
+ See http://project.carrot2.org/algorithms.html for more information.
1228
+
1229
+ A commercial algorithm Lingo3G (needs to be installed separately) is defined as:
1230
+ * com.carrotsearch.lingo3g.Lingo3GClusteringAlgorithm
1231
+ -->
1232
+ <str name="carrot.algorithm">org.carrot2.clustering.lingo.LingoClusteringAlgorithm</str>
1233
+
1234
+ <!-- Override location of the clustering algorithm's resources
1235
+ (attribute definitions and lexical resources).
1236
+
1237
+ A directory from which to load algorithm-specific stop words,
1238
+ stop labels and attribute definition XMLs.
1239
+
1240
+ For an overview of Carrot2 lexical resources, see:
1241
+ http://download.carrot2.org/head/manual/#chapter.lexical-resources
1242
+
1243
+ For an overview of Lingo3G lexical resources, see:
1244
+ http://download.carrotsearch.com/lingo3g/manual/#chapter.lexical-resources
1245
+ -->
1246
+ <str name="carrot.resourcesDir">clustering/carrot2</str>
1247
+ </lst>
1248
+
1249
+ <!-- An example definition for the STC clustering algorithm. -->
1250
+ <lst name="engine">
1251
+ <str name="name">stc</str>
1252
+ <str name="carrot.algorithm">org.carrot2.clustering.stc.STCClusteringAlgorithm</str>
1253
+ </lst>
1254
+
1255
+ <!-- An example definition for the bisecting kmeans clustering algorithm. -->
1256
+ <lst name="engine">
1257
+ <str name="name">kmeans</str>
1258
+ <str name="carrot.algorithm">org.carrot2.clustering.kmeans.BisectingKMeansClusteringAlgorithm</str>
1259
+ </lst>
1260
+ </searchComponent>
1261
+
1262
+ <!-- A request handler for demonstrating the clustering component
1263
+
1264
+ This is purely as an example.
1265
+
1266
+ In reality you will likely want to add the component to your
1267
+ already specified request handlers.
1268
+ -->
1269
+ <requestHandler name="/clustering"
1270
+ startup="lazy"
1271
+ enable="${solr.clustering.enabled:false}"
1272
+ class="solr.SearchHandler">
1273
+ <lst name="defaults">
1274
+ <bool name="clustering">true</bool>
1275
+ <bool name="clustering.results">true</bool>
1276
+ <!-- Field name with the logical "title" of a each document (optional) -->
1277
+ <str name="carrot.title">name</str>
1278
+ <!-- Field name with the logical "URL" of a each document (optional) -->
1279
+ <str name="carrot.url">id</str>
1280
+ <!-- Field name with the logical "content" of a each document (optional) -->
1281
+ <str name="carrot.snippet">features</str>
1282
+ <!-- Apply highlighter to the title/ content and use this for clustering. -->
1283
+ <bool name="carrot.produceSummary">true</bool>
1284
+ <!-- the maximum number of labels per cluster -->
1285
+ <!--<int name="carrot.numDescriptions">5</int>-->
1286
+ <!-- produce sub clusters -->
1287
+ <bool name="carrot.outputSubClusters">false</bool>
1288
+
1289
+ <!-- Configure the remaining request handler parameters. -->
1290
+ <str name="defType">edismax</str>
1291
+ <str name="qf">
1292
+ text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
1293
+ </str>
1294
+ <str name="q.alt">*:*</str>
1295
+ <str name="rows">10</str>
1296
+ <str name="fl">*,score</str>
1297
+ </lst>
1298
+ <arr name="last-components">
1299
+ <str>clustering</str>
1300
+ </arr>
1301
+ </requestHandler>
1302
+
1303
+ <!-- Terms Component
1304
+
1305
+ http://wiki.apache.org/solr/TermsComponent
1306
+
1307
+ A component to return terms and document frequency of those
1308
+ terms
1309
+ -->
1310
+ <searchComponent name="terms" class="solr.TermsComponent"/>
1311
+
1312
+ <!-- A request handler for demonstrating the terms component -->
1313
+ <requestHandler name="/terms" class="solr.SearchHandler" startup="lazy">
1314
+ <lst name="defaults">
1315
+ <bool name="terms">true</bool>
1316
+ <bool name="distrib">false</bool>
1317
+ </lst>
1318
+ <arr name="components">
1319
+ <str>terms</str>
1320
+ </arr>
1321
+ </requestHandler>
1322
+
1323
+
1324
+ <!-- Query Elevation Component
1325
+
1326
+ http://wiki.apache.org/solr/QueryElevationComponent
1327
+
1328
+ a search component that enables you to configure the top
1329
+ results for a given query regardless of the normal lucene
1330
+ scoring.
1331
+ -->
1332
+ <searchComponent name="elevator" class="solr.QueryElevationComponent">
1333
+ <!-- pick a fieldType to analyze queries -->
1334
+ <str name="queryFieldType">string</str>
1335
+ <str name="config-file">elevate.xml</str>
1336
+ </searchComponent>
1337
+
1338
+ <!-- A request handler for demonstrating the elevator component -->
1339
+ <requestHandler name="/elevate" class="solr.SearchHandler" startup="lazy">
1340
+ <lst name="defaults">
1341
+ <str name="echoParams">explicit</str>
1342
+ <str name="df">text</str>
1343
+ </lst>
1344
+ <arr name="last-components">
1345
+ <str>elevator</str>
1346
+ </arr>
1347
+ </requestHandler>
1348
+
1349
+ <!-- Highlighting Component
1350
+
1351
+ http://wiki.apache.org/solr/HighlightingParameters
1352
+ -->
1353
+ <searchComponent class="solr.HighlightComponent" name="highlight">
1354
+ <highlighting>
1355
+ <!-- Configure the standard fragmenter -->
1356
+ <!-- This could most likely be commented out in the "default" case -->
1357
+ <fragmenter name="gap"
1358
+ default="true"
1359
+ class="solr.highlight.GapFragmenter">
1360
+ <lst name="defaults">
1361
+ <int name="hl.fragsize">100</int>
1362
+ </lst>
1363
+ </fragmenter>
1364
+
1365
+ <!-- A regular-expression-based fragmenter
1366
+ (for sentence extraction)
1367
+ -->
1368
+ <fragmenter name="regex"
1369
+ class="solr.highlight.RegexFragmenter">
1370
+ <lst name="defaults">
1371
+ <!-- slightly smaller fragsizes work better because of slop -->
1372
+ <int name="hl.fragsize">70</int>
1373
+ <!-- allow 50% slop on fragment sizes -->
1374
+ <float name="hl.regex.slop">0.5</float>
1375
+ <!-- a basic sentence pattern -->
1376
+ <str name="hl.regex.pattern">[-\w ,/\n\&quot;&apos;]{20,200}</str>
1377
+ </lst>
1378
+ </fragmenter>
1379
+
1380
+ <!-- Configure the standard formatter -->
1381
+ <formatter name="html"
1382
+ default="true"
1383
+ class="solr.highlight.HtmlFormatter">
1384
+ <lst name="defaults">
1385
+ <str name="hl.simple.pre"><![CDATA[<em>]]></str>
1386
+ <str name="hl.simple.post"><![CDATA[</em>]]></str>
1387
+ </lst>
1388
+ </formatter>
1389
+
1390
+ <!-- Configure the standard encoder -->
1391
+ <encoder name="html"
1392
+ class="solr.highlight.HtmlEncoder"/>
1393
+
1394
+ <!-- Configure the standard fragListBuilder -->
1395
+ <fragListBuilder name="simple"
1396
+ class="solr.highlight.SimpleFragListBuilder"/>
1397
+
1398
+ <!-- Configure the single fragListBuilder -->
1399
+ <fragListBuilder name="single"
1400
+ class="solr.highlight.SingleFragListBuilder"/>
1401
+
1402
+ <!-- Configure the weighted fragListBuilder -->
1403
+ <fragListBuilder name="weighted"
1404
+ default="true"
1405
+ class="solr.highlight.WeightedFragListBuilder"/>
1406
+
1407
+ <!-- default tag FragmentsBuilder -->
1408
+ <fragmentsBuilder name="default"
1409
+ default="true"
1410
+ class="solr.highlight.ScoreOrderFragmentsBuilder">
1411
+ <!--
1412
+ <lst name="defaults">
1413
+ <str name="hl.multiValuedSeparatorChar">/</str>
1414
+ </lst>
1415
+ -->
1416
+ </fragmentsBuilder>
1417
+
1418
+ <!-- multi-colored tag FragmentsBuilder -->
1419
+ <fragmentsBuilder name="colored"
1420
+ class="solr.highlight.ScoreOrderFragmentsBuilder">
1421
+ <lst name="defaults">
1422
+ <str name="hl.tag.pre"><![CDATA[
1423
+ <b style="background:yellow">,<b style="background:lawgreen">,
1424
+ <b style="background:aquamarine">,<b style="background:magenta">,
1425
+ <b style="background:palegreen">,<b style="background:coral">,
1426
+ <b style="background:wheat">,<b style="background:khaki">,
1427
+ <b style="background:lime">,<b style="background:deepskyblue">]]></str>
1428
+ <str name="hl.tag.post"><![CDATA[</b>]]></str>
1429
+ </lst>
1430
+ </fragmentsBuilder>
1431
+
1432
+ <boundaryScanner name="default"
1433
+ default="true"
1434
+ class="solr.highlight.SimpleBoundaryScanner">
1435
+ <lst name="defaults">
1436
+ <str name="hl.bs.maxScan">10</str>
1437
+ <str name="hl.bs.chars">.,!? &#9;&#10;&#13;</str>
1438
+ </lst>
1439
+ </boundaryScanner>
1440
+
1441
+ <boundaryScanner name="breakIterator"
1442
+ class="solr.highlight.BreakIteratorBoundaryScanner">
1443
+ <lst name="defaults">
1444
+ <!-- type should be one of CHARACTER, WORD(default), LINE and SENTENCE -->
1445
+ <str name="hl.bs.type">WORD</str>
1446
+ <!-- language and country are used when constructing Locale object. -->
1447
+ <!-- And the Locale object will be used when getting instance of BreakIterator -->
1448
+ <str name="hl.bs.language">en</str>
1449
+ <str name="hl.bs.country">US</str>
1450
+ </lst>
1451
+ </boundaryScanner>
1452
+ </highlighting>
1453
+ </searchComponent>
1454
+
1455
+ <!-- Update Processors
1456
+
1457
+ Chains of Update Processor Factories for dealing with Update
1458
+ Requests can be declared, and then used by name in Update
1459
+ Request Processors
1460
+
1461
+ http://wiki.apache.org/solr/UpdateRequestProcessor
1462
+
1463
+ -->
1464
+ <!-- Deduplication
1465
+
1466
+ An example dedup update processor that creates the "id" field
1467
+ on the fly based on the hash code of some other fields. This
1468
+ example has overwriteDupes set to false since we are using the
1469
+ id field as the signatureField and Solr will maintain
1470
+ uniqueness based on that anyway.
1471
+
1472
+ -->
1473
+ <!--
1474
+ <updateRequestProcessorChain name="dedupe">
1475
+ <processor class="solr.processor.SignatureUpdateProcessorFactory">
1476
+ <bool name="enabled">true</bool>
1477
+ <str name="signatureField">id</str>
1478
+ <bool name="overwriteDupes">false</bool>
1479
+ <str name="fields">name,features,cat</str>
1480
+ <str name="signatureClass">solr.processor.Lookup3Signature</str>
1481
+ </processor>
1482
+ <processor class="solr.LogUpdateProcessorFactory" />
1483
+ <processor class="solr.RunUpdateProcessorFactory" />
1484
+ </updateRequestProcessorChain>
1485
+ -->
1486
+
1487
+ <!-- Language identification
1488
+
1489
+ This example update chain identifies the language of the incoming
1490
+ documents using the langid contrib. The detected language is
1491
+ written to field language_s. No field name mapping is done.
1492
+ The fields used for detection are text, title, subject and description,
1493
+ making this example suitable for detecting languages form full-text
1494
+ rich documents injected via ExtractingRequestHandler.
1495
+ See more about langId at http://wiki.apache.org/solr/LanguageDetection
1496
+ -->
1497
+ <!--
1498
+ <updateRequestProcessorChain name="langid">
1499
+ <processor class="org.apache.solr.update.processor.TikaLanguageIdentifierUpdateProcessorFactory">
1500
+ <str name="langid.fl">text,title,subject,description</str>
1501
+ <str name="langid.langField">language_s</str>
1502
+ <str name="langid.fallback">en</str>
1503
+ </processor>
1504
+ <processor class="solr.LogUpdateProcessorFactory" />
1505
+ <processor class="solr.RunUpdateProcessorFactory" />
1506
+ </updateRequestProcessorChain>
1507
+ -->
1508
+
1509
+ <!-- Script update processor
1510
+
1511
+ This example hooks in an update processor implemented using JavaScript.
1512
+
1513
+ See more about the script update processor at http://wiki.apache.org/solr/ScriptUpdateProcessor
1514
+ -->
1515
+ <!--
1516
+ <updateRequestProcessorChain name="script">
1517
+ <processor class="solr.StatelessScriptUpdateProcessorFactory">
1518
+ <str name="script">update-script.js</str>
1519
+ <lst name="params">
1520
+ <str name="config_param">example config parameter</str>
1521
+ </lst>
1522
+ </processor>
1523
+ <processor class="solr.RunUpdateProcessorFactory" />
1524
+ </updateRequestProcessorChain>
1525
+ -->
1526
+
1527
+ <!-- Response Writers
1528
+
1529
+ http://wiki.apache.org/solr/QueryResponseWriter
1530
+
1531
+ Request responses will be written using the writer specified by
1532
+ the 'wt' request parameter matching the name of a registered
1533
+ writer.
1534
+
1535
+ The "default" writer is the default and will be used if 'wt' is
1536
+ not specified in the request.
1537
+ -->
1538
+ <!-- The following response writers are implicitly configured unless
1539
+ overridden...
1540
+ -->
1541
+ <!--
1542
+ <queryResponseWriter name="xml"
1543
+ default="true"
1544
+ class="solr.XMLResponseWriter" />
1545
+ <queryResponseWriter name="json" class="solr.JSONResponseWriter"/>
1546
+ <queryResponseWriter name="python" class="solr.PythonResponseWriter"/>
1547
+ <queryResponseWriter name="ruby" class="solr.RubyResponseWriter"/>
1548
+ <queryResponseWriter name="php" class="solr.PHPResponseWriter"/>
1549
+ <queryResponseWriter name="phps" class="solr.PHPSerializedResponseWriter"/>
1550
+ <queryResponseWriter name="csv" class="solr.CSVResponseWriter"/>
1551
+ <queryResponseWriter name="schema.xml" class="solr.SchemaXmlResponseWriter"/>
1552
+ -->
1553
+
1554
+ <queryResponseWriter name="json" class="solr.JSONResponseWriter">
1555
+ <!-- For the purposes of the tutorial, JSON responses are written as
1556
+ plain text so that they are easy to read in *any* browser.
1557
+ If you expect a MIME type of "application/json" just remove this override.
1558
+ -->
1559
+ <str name="content-type">text/plain; charset=UTF-8</str>
1560
+ </queryResponseWriter>
1561
+
1562
+ <!--
1563
+ Custom response writers can be declared as needed...
1564
+ -->
1565
+ <queryResponseWriter name="velocity" class="solr.VelocityResponseWriter" startup="lazy">
1566
+ <str name="template.base.dir">${velocity.template.base.dir:}</str>
1567
+ </queryResponseWriter>
1568
+
1569
+ <!-- XSLT response writer transforms the XML output by any xslt file found
1570
+ in Solr's conf/xslt directory. Changes to xslt files are checked for
1571
+ every xsltCacheLifetimeSeconds.
1572
+ -->
1573
+ <queryResponseWriter name="xslt" class="solr.XSLTResponseWriter">
1574
+ <int name="xsltCacheLifetimeSeconds">5</int>
1575
+ </queryResponseWriter>
1576
+
1577
+ <!-- Query Parsers
1578
+
1579
+ http://wiki.apache.org/solr/SolrQuerySyntax
1580
+
1581
+ Multiple QParserPlugins can be registered by name, and then
1582
+ used in either the "defType" param for the QueryComponent (used
1583
+ by SearchHandler) or in LocalParams
1584
+ -->
1585
+ <!-- example of registering a query parser -->
1586
+ <!--
1587
+ <queryParser name="myparser" class="com.mycompany.MyQParserPlugin"/>
1588
+ -->
1589
+
1590
+ <!-- Function Parsers
1591
+
1592
+ http://wiki.apache.org/solr/FunctionQuery
1593
+
1594
+ Multiple ValueSourceParsers can be registered by name, and then
1595
+ used as function names when using the "func" QParser.
1596
+ -->
1597
+ <!-- example of registering a custom function parser -->
1598
+ <!--
1599
+ <valueSourceParser name="myfunc"
1600
+ class="com.mycompany.MyValueSourceParser" />
1601
+ -->
1602
+
1603
+
1604
+ <!-- Document Transformers
1605
+ http://wiki.apache.org/solr/DocTransformers
1606
+ -->
1607
+ <!--
1608
+ Could be something like:
1609
+ <transformer name="db" class="com.mycompany.LoadFromDatabaseTransformer" >
1610
+ <int name="connection">jdbc://....</int>
1611
+ </transformer>
1612
+
1613
+ To add a constant value to all docs, use:
1614
+ <transformer name="mytrans2" class="org.apache.solr.response.transform.ValueAugmenterFactory" >
1615
+ <int name="value">5</int>
1616
+ </transformer>
1617
+
1618
+ If you want the user to still be able to change it with _value:something_ use this:
1619
+ <transformer name="mytrans3" class="org.apache.solr.response.transform.ValueAugmenterFactory" >
1620
+ <double name="defaultValue">5</double>
1621
+ </transformer>
1622
+
1623
+ If you are using the QueryElevationComponent, you may wish to mark documents that get boosted. The
1624
+ EditorialMarkerFactory will do exactly that:
1625
+ <transformer name="qecBooster" class="org.apache.solr.response.transform.EditorialMarkerFactory" />
1626
+ -->
1627
+
1628
+
1629
+ <!-- Legacy config for the admin interface -->
1630
+ <admin>
1631
+ <defaultQuery>*:*</defaultQuery>
1632
+ </admin>
1633
+
1634
+ </config>