blacklight 3.1.2 → 3.2.0pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. data/.gitignore +5 -2
  2. data/README.md +7 -2
  3. data/VERSION +1 -1
  4. data/app/assets/images/favicon.ico +0 -0
  5. data/app/assets/javascripts/blacklight/blacklight.js +23 -1
  6. data/app/assets/stylesheets/blacklight/_catalog.css.scss +369 -0
  7. data/app/assets/stylesheets/blacklight/_facets.css.scss +117 -0
  8. data/app/assets/stylesheets/blacklight/_folder.css.scss +38 -0
  9. data/app/assets/stylesheets/blacklight/_formatting.css.scss +164 -0
  10. data/app/assets/stylesheets/blacklight/_header.css.scss +36 -0
  11. data/app/assets/stylesheets/blacklight/_layout.css.scss +79 -0
  12. data/app/assets/stylesheets/blacklight/_print.css.scss +54 -0
  13. data/app/assets/stylesheets/blacklight/_search_history.css.scss +44 -0
  14. data/app/assets/stylesheets/blacklight/_susy_framework.css.scss +228 -0
  15. data/app/assets/stylesheets/blacklight/blacklight.css.scss +27 -0
  16. data/app/assets/stylesheets/blacklight/blacklight_defaults.css.scss +48 -0
  17. data/app/controllers/bookmarks_controller.rb +2 -1
  18. data/app/controllers/folder_controller.rb +4 -0
  19. data/app/controllers/saved_searches_controller.rb +4 -0
  20. data/app/controllers/search_history_controller.rb +4 -0
  21. data/app/helpers/blacklight/blacklight_helper_behavior.rb +64 -104
  22. data/app/helpers/blacklight/catalog_helper_behavior.rb +4 -4
  23. data/app/helpers/blacklight/facets_helper_behavior.rb +52 -5
  24. data/app/helpers/blacklight/render_constraints_helper_behavior.rb +14 -59
  25. data/app/helpers/blacklight/search_history_constraints_helper_behavior.rb +56 -0
  26. data/app/helpers/search_history_constraints_helper.rb +3 -0
  27. data/app/models/record_mailer.rb +1 -2
  28. data/app/views/_flash_msg.html.erb +4 -5
  29. data/app/views/_user_util_links.html.erb +3 -1
  30. data/app/views/bookmarks/index.html.erb +2 -2
  31. data/app/views/catalog/_bookmark_control.html.erb +6 -6
  32. data/app/views/catalog/_facet_layout.html.erb +4 -0
  33. data/app/views/catalog/_facet_limit.html.erb +20 -33
  34. data/app/views/catalog/_facets.html.erb +1 -5
  35. data/app/views/catalog/_folder_control.html.erb +5 -5
  36. data/app/views/catalog/_index_default.html.erb +1 -1
  37. data/app/views/catalog/_search_form.html.erb +4 -3
  38. data/app/views/catalog/_show_default.html.erb +1 -1
  39. data/app/views/catalog/_show_tools.html.erb +6 -6
  40. data/app/views/catalog/_sort_and_per_page.html.erb +1 -1
  41. data/app/views/catalog/index.atom.builder +2 -2
  42. data/app/views/catalog/index.rss.builder +1 -1
  43. data/app/views/catalog/opensearch.xml.builder +10 -0
  44. data/app/views/catalog/show.html.erb +1 -1
  45. data/app/views/folder/_tools.html.erb +4 -4
  46. data/app/views/layouts/blacklight.html.erb +25 -37
  47. data/app/views/record_mailer/email_record.text.erb +1 -1
  48. data/app/views/record_mailer/sms_record.text.erb +2 -2
  49. data/app/views/search_history/index.html.erb +1 -1
  50. data/blacklight.gemspec +11 -9
  51. data/lib/{generators/blacklight/templates/SolrMarc.jar → SolrMarc.jar} +0 -0
  52. data/lib/blacklight.rb +5 -3
  53. data/lib/blacklight/catalog.rb +3 -4
  54. data/lib/blacklight/configurable.rb +54 -39
  55. data/lib/blacklight/configuration.rb +126 -0
  56. data/lib/blacklight/configuration/fields.rb +142 -0
  57. data/lib/blacklight/configuration/search_field.rb +12 -0
  58. data/lib/blacklight/configuration/solr_field.rb +12 -0
  59. data/lib/blacklight/configuration/sort_field.rb +17 -0
  60. data/lib/blacklight/controller.rb +16 -14
  61. data/lib/blacklight/engine.rb +1 -1
  62. data/lib/blacklight/global_configurable.rb +46 -0
  63. data/lib/blacklight/search_fields.rb +21 -54
  64. data/lib/blacklight/solr/document.rb +13 -3
  65. data/lib/blacklight/solr_helper.rb +88 -52
  66. data/lib/blacklight/utils.rb +18 -0
  67. data/lib/generators/blacklight/assets_generator.rb +14 -20
  68. data/lib/generators/blacklight/blacklight_generator.rb +14 -6
  69. data/lib/generators/blacklight/jetty_generator.rb +1 -1
  70. data/lib/generators/blacklight/templates/assets/standard.css.scss +51 -0
  71. data/lib/generators/blacklight/templates/catalog_controller.rb +148 -0
  72. data/lib/generators/blacklight/templates/config/blacklight_config.rb +2 -239
  73. data/lib/generators/blacklight/templates/config/sass.rb +5 -0
  74. data/lib/generators/blacklight/templates/solr_conf/schema.xml +514 -164
  75. data/lib/generators/blacklight/templates/solr_conf/solrconfig.xml +1591 -323
  76. data/lib/generators/blacklight/templates/solr_document.rb +2 -0
  77. data/lib/railties/all_tests.rake +36 -3
  78. data/lib/railties/blacklight_cucumber.rake +6 -4
  79. data/lib/railties/blacklight_rspec.rake +5 -4
  80. data/test_support/bin/run-tests.sh +2 -13
  81. data/test_support/bin/test.sh +30 -23
  82. data/test_support/features/did_you_mean.feature +14 -13
  83. data/test_support/features/step_definitions/saved_searches_steps.rb +1 -1
  84. data/test_support/features/step_definitions/search_steps.rb +4 -4
  85. data/test_support/spec/controllers/application_controller_spec.rb +3 -13
  86. data/test_support/spec/controllers/catalog_controller_spec.rb +102 -24
  87. data/test_support/spec/controllers/folder_controller_spec.rb +7 -1
  88. data/test_support/spec/helpers/blacklight_helper_spec.rb +45 -34
  89. data/test_support/spec/helpers/facets_helper_spec.rb +68 -0
  90. data/test_support/spec/helpers/html_head_helper_spec.rb +37 -0
  91. data/test_support/spec/helpers/{render_constraints_helper_spec.rb → search_history_constraints_helper_spec.rb} +26 -7
  92. data/test_support/spec/lib/blacklight_configurable_spec.rb +92 -0
  93. data/test_support/spec/lib/blacklight_configuration_spec.rb +295 -0
  94. data/test_support/spec/lib/{configurable_spec.rb → global_configurable_spec.rb} +2 -2
  95. data/test_support/spec/lib/search_fields_spec.rb +26 -29
  96. data/test_support/spec/{helpers → lib}/solr_helper_spec.rb +268 -287
  97. data/test_support/spec/lib/tasks/solr_marc_task_spec.rb +1 -1
  98. data/test_support/spec/lib/utils_spec.rb +58 -0
  99. data/test_support/spec/models/solr_docment_spec.rb +4 -8
  100. data/test_support/spec/views/catalog/_facets.html.erb_spec.rb +27 -170
  101. data/test_support/spec/views/catalog/_index_default.erb_spec.rb +38 -20
  102. data/test_support/spec/views/catalog/_show_default.erb_spec.rb +38 -19
  103. data/test_support/spec/views/catalog/index.atom.builder_spec.rb +19 -1
  104. metadata +148 -145
  105. data/app/assets/stylesheets/blacklight/blacklight.css +0 -493
  106. data/app/assets/stylesheets/yui.css +0 -31
  107. data/app/views/catalog/opensearch.xml.erb +0 -11
  108. data/doc/Atom-Responses.md +0 -90
  109. data/doc/CUSTOMIZING.md +0 -121
  110. data/doc/Extending-blacklight-with-the-document-extension-framework.md +0 -1
  111. data/doc/Extending-or-Modifying-Blacklight-Search-Behavior.md +0 -131
  112. data/doc/Features.md +0 -147
  113. data/doc/Integration-with-Rails-Footnotes.md +0 -20
  114. data/doc/Pagination.md +0 -38
  115. data/doc/Quickstart.md +0 -97
  116. data/doc/Upgrading-Guide.md +0 -98
  117. data/doc/User-Authentication.md +0 -54
  118. data/doc/Using-a-custom-solr-uniquekey-field.md +0 -36
  119. data/lib/blacklight/comma_link_renderer.rb +0 -28
  120. data/lib/railties/jetty_solr_server.rb +0 -108
  121. data/test_support/spec/views/catalog/show.html.erb_spec.rb +0 -101
@@ -1,387 +1,943 @@
1
1
  <?xml version="1.0" encoding="UTF-8" ?>
2
- <!--
3
- For information on how to customize this file, please see
4
- http://wiki.apache.org/solr/SolrConfigXml. The page also has a link to
5
- an extensively commented version of this file.
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.
6
22
  -->
7
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
+ -->
8
42
  <abortOnConfigurationError>${solr.abortOnConfigurationError:true}</abortOnConfigurationError>
9
43
 
10
- <!-- lib directives can be used to instruct Solr to load an Jars identified
11
- and use them to resolve any "plugins" specified in your solrconfig.xml or
12
- schema.xml (ie: Analyzers, Request Handlers, etc...).
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_35</luceneMatchVersion>
13
51
 
14
- All directories and paths are resolved relative the instanceDir.
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...).
15
56
 
16
- If a "./lib" directory exists in your instanceDir, all files found in it
17
- are included as if you had used the following syntax...
57
+ All directories and paths are resolved relative to the
58
+ instanceDir.
18
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
+
19
64
  <lib dir="./lib" />
20
65
  -->
21
- <!-- A dir option by itself adds any files found in the directory to the
22
- classpath, this is useful for including all jars in a directory.
66
+
67
+ <!-- A dir option by itself adds any files found in the directory to
68
+ the classpath, this is useful for including all jars in a
69
+ directory.
23
70
  -->
24
- <!-- <lib dir="../../contrib/extraction/lib" /> -->
25
- <!-- When a regex is specified in addition to a directory, only the files in that
26
- directory which completely match the regex (anchored on both ends)
27
- will be included.
71
+ <lib dir="../../contrib/extraction/lib" />
72
+ <lib dir="../../contrib/clustering/lib/" />
73
+ <lib dir="../../contrib/velocity/lib" />
74
+
75
+ <lib dir="./contrib/analysis-extras/lib" />
76
+ <lib dir="./contrib/analysis-extras/lucene-libs" />
77
+ <lib dir="./contrib/velocity/lib" />
78
+
79
+ <!-- When a regex is specified in addition to a directory, only the
80
+ files in that directory which completely match the regex
81
+ (anchored on both ends) will be included.
28
82
  -->
29
- <!-- <lib dir="../../dist/" regex="apache-solr-cell-\d.*\.jar" /> -->
30
- <!-- <lib dir="../../dist/" regex="apache-solr-clustering-\d.*\.jar" /> -->
31
- <!-- If a dir option (with or without a regex) is used and nothing is found
32
- that matches, it will be ignored
83
+ <lib dir="../../dist/" regex="apache-solr-cell-\d.*\.jar" />
84
+ <lib dir="../../dist/" regex="apache-solr-clustering-\d.*\.jar" />
85
+ <lib dir="../../dist/" regex="apache-solr-dataimporthandler-\d.*\.jar" />
86
+ <lib dir="../../dist/" regex="apache-solr-langid-\d.*\.jar" />
87
+ <lib dir="../../dist/" regex="apache-solr-velocity-\d.*\.jar" />
88
+
89
+ <!-- If a dir option (with or without a regex) is used and nothing
90
+ is found that matches, it will be ignored
33
91
  -->
34
- <!-- <lib dir="../../contrib/clustering/lib/downloads/" /> -->
35
-
36
- <dataDir>${solr.data.dir:./solr/data}</dataDir>
92
+ <lib dir="../../contrib/clustering/lib/" />
93
+ <lib dir="/total/crap/dir/ignored" />
94
+
95
+ <!-- an exact path can be used to specify a specific file. This
96
+ will cause a serious error to be logged if it can't be loaded.
97
+ -->
98
+ <!--
99
+ <lib path="../a-jar-that-does-not-exist.jar" />
100
+ -->
37
101
 
38
- <!-- index time configurations -->
102
+ <!-- Data Directory
103
+
104
+ Used to specify an alternate directory to hold all index data
105
+ other than the default ./data under the Solr home. If
106
+ replication is in use, this should match the replication
107
+ configuration.
108
+ -->
109
+ <dataDir>${solr.data.dir:}</dataDir>
110
+
111
+
112
+ <!-- The DirectoryFactory to use for indexes.
113
+
114
+ solr.StandardDirectoryFactory, the default, is filesystem
115
+ based. solr.RAMDirectoryFactory is memory based, not
116
+ persistent, and doesn't work with replication.
117
+ -->
118
+ <directoryFactory name="DirectoryFactory"
119
+ class="${solr.directoryFactory:solr.StandardDirectoryFactory}"/>
120
+
121
+
122
+ <!-- Index Defaults
123
+
124
+ Values here affect all index writers and act as a default
125
+ unless overridden.
126
+
127
+ WARNING: See also the <mainIndex> section below for parameters
128
+ that overfor Solr's main Lucene index.
129
+ -->
39
130
  <indexDefaults>
131
+
40
132
  <useCompoundFile>false</useCompoundFile>
133
+
41
134
  <mergeFactor>10</mergeFactor>
42
135
  <!-- Sets the amount of RAM that may be used by Lucene indexing
43
136
  for buffering added documents and deletions before they are
44
137
  flushed to the Directory. -->
45
- <!-- If both ramBufferSizeMB and maxBufferedDocs is set, then Lucene will flush based on whichever limit is hit first. -->
46
138
  <ramBufferSizeMB>32</ramBufferSizeMB>
47
- <maxMergeDocs>2147483647</maxMergeDocs>
139
+ <!-- If both ramBufferSizeMB and maxBufferedDocs is set, then
140
+ Lucene will flush based on whichever limit is hit first.
141
+ -->
142
+ <!-- <maxBufferedDocs>1000</maxBufferedDocs> -->
143
+
48
144
  <maxFieldLength>10000</maxFieldLength>
49
145
  <writeLockTimeout>1000</writeLockTimeout>
50
- <commitLockTimeout>10000</commitLockTimeout>
51
146
 
52
- <!--
53
- This option specifies which Lucene LockFactory implementation to use.
147
+ <!-- Expert: Merge Policy
148
+
149
+ The Merge Policy in Lucene controls how merging is handled by
150
+ Lucene. The default in Solr 3.3 is TieredMergePolicy.
151
+
152
+ The default in 2.3 was the LogByteSizeMergePolicy,
153
+ previous versions used LogDocMergePolicy.
154
+
155
+ LogByteSizeMergePolicy chooses segments to merge based on
156
+ their size. The Lucene 2.2 default, LogDocMergePolicy chose
157
+ when to merge based on number of documents
158
+
159
+ Other implementations of MergePolicy must have a no-argument
160
+ constructor
161
+ -->
162
+ <!--
163
+ <mergePolicy class="org.apache.lucene.index.TieredMergePolicy"/>
164
+ -->
165
+
166
+ <!-- Expert: Merge Scheduler
54
167
 
55
- single = SingleInstanceLockFactory - suggested for a read-only index
56
- or when there is no possibility of another process trying
57
- to modify the index.
58
- native = NativeFSLockFactory - uses OS native file locking
59
- simple = SimpleFSLockFactory - uses a plain file for locking
168
+ The Merge Scheduler in Lucene controls how merges are
169
+ performed. The ConcurrentMergeScheduler (Lucene 2.3 default)
170
+ can perform merges in the background using separate threads.
171
+ The SerialMergeScheduler (Lucene 2.2 default) does not.
172
+ -->
173
+ <!--
174
+ <mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"/>
175
+ -->
176
+
177
+ <!-- LockFactory
60
178
 
61
- (For backwards compatibility with Solr 1.2, 'simple' is the default
62
- if not specified.)
179
+ This option specifies which Lucene LockFactory implementation
180
+ to use.
181
+
182
+ single = SingleInstanceLockFactory - suggested for a
183
+ read-only index or when there is no possibility of
184
+ another process trying to modify the index.
185
+ native = NativeFSLockFactory - uses OS native file locking.
186
+ Do not use when multiple solr webapps in the same
187
+ JVM are attempting to share a single index.
188
+ simple = SimpleFSLockFactory - uses a plain file for locking
189
+
190
+ (For backwards compatibility with Solr 1.2, 'simple' is the
191
+ default if not specified.)
192
+
193
+ More details on the nuances of each LockFactory...
194
+ http://wiki.apache.org/lucene-java/AvailableLockFactories
63
195
  -->
64
- <lockType>native</lockType>
196
+ <lockType>native</lockType>
197
+
198
+ <!-- Expert: Controls how often Lucene loads terms into memory
199
+ Default is 128 and is likely good for most everyone.
200
+ -->
201
+ <!-- <termIndexInterval>256</termIndexInterval> -->
65
202
  </indexDefaults>
203
+
204
+ <!-- Main Index
205
+
206
+ Values here override the values in the <indexDefaults> section
207
+ for the main on disk index.
208
+ -->
66
209
  <mainIndex>
210
+
67
211
  <useCompoundFile>false</useCompoundFile>
68
212
  <ramBufferSizeMB>32</ramBufferSizeMB>
69
213
  <mergeFactor>10</mergeFactor>
70
- <maxMergeDocs>2147483647</maxMergeDocs>
71
- <maxFieldLength>10000</maxFieldLength>
214
+
215
+ <!-- Unlock On Startup
216
+
217
+ If true, unlock any held write or commit locks on startup.
218
+ This defeats the locking mechanism that allows multiple
219
+ processes to safely access a lucene index, and should be used
220
+ with care.
221
+
222
+ This is not needed if lock type is 'none' or 'single'
223
+ -->
72
224
  <unlockOnStartup>false</unlockOnStartup>
225
+
226
+ <!-- If true, IndexReaders will be reopened (often more efficient)
227
+ instead of closed and then opened.
228
+ -->
229
+ <reopenReaders>true</reopenReaders>
230
+
231
+ <!-- Commit Deletion Policy
232
+
233
+ Custom deletion policies can specified here. The class must
234
+ implement org.apache.lucene.index.IndexDeletionPolicy.
235
+
236
+ http://lucene.apache.org/java/2_9_1/api/all/org/apache/lucene/index/IndexDeletionPolicy.html
237
+
238
+ The standard Solr IndexDeletionPolicy implementation supports
239
+ deleting index commit points on number of commits, age of
240
+ commit point and optimized status.
241
+
242
+ The latest commit point should always be preserved regardless
243
+ of the criteria.
244
+ -->
73
245
  <deletionPolicy class="solr.SolrDeletionPolicy">
74
- <str name="keepOptimizedOnly">false</str>
246
+ <!-- The number of commit points to be kept -->
75
247
  <str name="maxCommitsToKeep">1</str>
76
248
  <!-- The number of optimized commit points to be kept -->
77
- <str name="maxOptimizedCommitsToKeep">1</str>
249
+ <str name="maxOptimizedCommitsToKeep">0</str>
78
250
  <!--
79
251
  Delete all commit points once they have reached the given age.
80
252
  Supports DateMathParser syntax e.g.
81
-
82
- <str name="maxCommitAge">30MINUTES</str>
83
- <str name="maxCommitAge">1DAY</str>
253
+ -->
254
+ <!--
255
+ <str name="maxCommitAge">30MINUTES</str>
256
+ <str name="maxCommitAge">1DAY</str>
84
257
  -->
85
258
  </deletionPolicy>
259
+
260
+ <!-- Lucene Infostream
261
+
262
+ To aid in advanced debugging, Lucene provides an "InfoStream"
263
+ of detailed information when indexing.
264
+
265
+ Setting The value to true will instruct the underlying Lucene
266
+ IndexWriter to write its debugging info the specified file
267
+ -->
268
+ <infoStream file="INFOSTREAM.txt">false</infoStream>
269
+
86
270
  </mainIndex>
87
271
 
88
- <updateHandler class="solr.DirectUpdateHandler2" />
272
+ <!-- JMX
273
+
274
+ This example enables JMX if and only if an existing MBeanServer
275
+ is found, use this if you want to configure JMX through JVM
276
+ parameters. Remove this to disable exposing Solr configuration
277
+ and statistics to JMX.
278
+
279
+ For more details see http://wiki.apache.org/solr/SolrJmx
280
+ -->
281
+ <jmx />
282
+ <!-- If you want to connect to a particular server, specify the
283
+ agentId
284
+ -->
285
+ <!-- <jmx agentId="myAgent" /> -->
286
+ <!-- If you want to start a new MBeanServer, specify the serviceUrl -->
287
+ <!-- <jmx serviceUrl="service:jmx:rmi:///jndi/rmi://localhost:9999/solr"/>
288
+ -->
289
+
290
+ <!-- The default high-performance update handler -->
291
+ <updateHandler class="solr.DirectUpdateHandler2">
292
+
293
+ <!-- AutoCommit
294
+
295
+ Perform a <commit/> automatically under certain conditions.
296
+ Instead of enabling autoCommit, consider using "commitWithin"
297
+ when adding documents.
298
+
299
+ http://wiki.apache.org/solr/UpdateXmlMessages
300
+
301
+ maxDocs - Maximum number of documents to add since the last
302
+ commit before automatically triggering a new commit.
303
+
304
+ maxTime - Maximum amount of time that is allowed to pass
305
+ since a document was added before automaticly
306
+ triggering a new commit.
307
+ -->
308
+ <!--
309
+ <autoCommit>
310
+ <maxDocs>10000</maxDocs>
311
+ <maxTime>1000</maxTime>
312
+ </autoCommit>
313
+ -->
314
+
315
+ <!-- Update Related Event Listeners
316
+
317
+ Various IndexWriter related events can trigger Listeners to
318
+ take actions.
319
+
320
+ postCommit - fired after every commit or optimize command
321
+ postOptimize - fired after every optimize command
322
+ -->
323
+ <!-- The RunExecutableListener executes an external command from a
324
+ hook such as postCommit or postOptimize.
325
+
326
+ exe - the name of the executable to run
327
+ dir - dir to use as the current working directory. (default=".")
328
+ wait - the calling thread waits until the executable returns.
329
+ (default="true")
330
+ args - the arguments to pass to the program. (default is none)
331
+ env - environment variables to set. (default is none)
332
+ -->
333
+ <!-- This example shows how RunExecutableListener could be used
334
+ with the script based replication...
335
+ http://wiki.apache.org/solr/CollectionDistribution
336
+ -->
337
+ <!--
338
+ <listener event="postCommit" class="solr.RunExecutableListener">
339
+ <str name="exe">solr/bin/snapshooter</str>
340
+ <str name="dir">.</str>
341
+ <bool name="wait">true</bool>
342
+ <arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
343
+ <arr name="env"> <str>MYVAR=val1</str> </arr>
344
+ </listener>
345
+ -->
346
+ </updateHandler>
347
+
348
+ <!-- IndexReaderFactory
349
+
350
+ Use the following format to specify a custom IndexReaderFactory,
351
+ which allows for alternate IndexReader implementations.
352
+
353
+ ** Experimental Feature **
354
+
355
+ Please note - Using a custom IndexReaderFactory may prevent
356
+ certain other features from working. The API to
357
+ IndexReaderFactory may change without warning or may even be
358
+ removed from future releases if the problems cannot be
359
+ resolved.
360
+
361
+
362
+ ** Features that may not work with custom IndexReaderFactory **
363
+
364
+ The ReplicationHandler assumes a disk-resident index. Using a
365
+ custom IndexReader implementation may cause incompatibility
366
+ with ReplicationHandler and may cause replication to not work
367
+ correctly. See SOLR-1366 for details.
368
+
369
+ -->
370
+ <!--
371
+ <indexReaderFactory name="IndexReaderFactory" class="package.class">
372
+ <str name="someArg">Some Value</str>
373
+ </indexReaderFactory >
374
+ -->
375
+ <!-- By explicitly declaring the Factory, the termIndexDivisor can
376
+ be specified.
377
+ -->
378
+ <!--
379
+ <indexReaderFactory name="IndexReaderFactory"
380
+ class="solr.StandardIndexReaderFactory">
381
+ <int name="setTermIndexDivisor">12</int>
382
+ </indexReaderFactory >
383
+ -->
384
+
89
385
 
90
- <!-- query time configurations -->
91
386
  <query>
387
+ <!-- Max Boolean Clauses
388
+
389
+ Maximum number of clauses in each BooleanQuery, an exception
390
+ is thrown if exceeded.
391
+
392
+ ** WARNING **
393
+
394
+ This option actually modifies a global Lucene property that
395
+ will affect all SolrCores. If multiple solrconfig.xml files
396
+ disagree on this property, the value at any given moment will
397
+ be based on the last SolrCore to be initialized.
398
+
399
+ -->
92
400
  <maxBooleanClauses>1024</maxBooleanClauses>
401
+
402
+
403
+ <!-- Solr Internal Query Caches
404
+
405
+ There are two implementations of cache available for Solr,
406
+ LRUCache, based on a synchronized LinkedHashMap, and
407
+ FastLRUCache, based on a ConcurrentHashMap.
408
+
409
+ FastLRUCache has faster gets and slower puts in single
410
+ threaded operation and thus is generally faster than LRUCache
411
+ when the hit ratio of the cache is high (> 75%), and may be
412
+ faster under other scenarios on multi-cpu systems.
413
+ -->
414
+
415
+ <!-- Filter Cache
416
+
417
+ Cache used by SolrIndexSearcher for filters (DocSets),
418
+ unordered sets of *all* documents that match a query. When a
419
+ new searcher is opened, its caches may be prepopulated or
420
+ "autowarmed" using data from caches in the old searcher.
421
+ autowarmCount is the number of items to prepopulate. For
422
+ LRUCache, the autowarmed items will be the most recently
423
+ accessed items.
424
+
425
+ Parameters:
426
+ class - the SolrCache implementation LRUCache or
427
+ (LRUCache or FastLRUCache)
428
+ size - the maximum number of entries in the cache
429
+ initialSize - the initial capacity (number of entries) of
430
+ the cache. (see java.util.HashMap)
431
+ autowarmCount - the number of entries to prepopulate from
432
+ and old cache.
433
+ -->
93
434
  <filterCache class="solr.FastLRUCache"
94
- size="512" initialSize="512" autowarmCount="128"/>
435
+ size="512"
436
+ initialSize="512"
437
+ autowarmCount="0"/>
438
+
439
+ <!-- Query Result Cache
440
+
441
+ Caches results of searches - ordered lists of document ids
442
+ (DocList) based on a query, a sort, and the range of documents requested.
443
+ -->
95
444
  <queryResultCache class="solr.LRUCache"
96
- size="512" initialSize="512" autowarmCount="32"/>
445
+ size="512"
446
+ initialSize="512"
447
+ autowarmCount="0"/>
448
+
449
+ <!-- Document Cache
450
+
451
+ Caches Lucene Document objects (the stored fields for each
452
+ document). Since Lucene internal document ids are transient,
453
+ this cache will not be autowarmed.
454
+ -->
97
455
  <documentCache class="solr.LRUCache"
98
- size="512" initialSize="512" autowarmCount="0"/>
99
- <enableLazyFieldLoading>true</enableLazyFieldLoading>
100
- <queryResultWindowSize>50</queryResultWindowSize>
101
- <queryResultMaxDocsCached>200</queryResultMaxDocsCached>
102
- <HashDocSet maxSize="3000" loadFactor="0.75"/>
456
+ size="512"
457
+ initialSize="512"
458
+ autowarmCount="0"/>
459
+
460
+ <!-- Field Value Cache
461
+
462
+ Cache used to hold field values that are quickly accessible
463
+ by document id. The fieldValueCache is created by default
464
+ even if not configured here.
465
+ -->
466
+ <!--
467
+ <fieldValueCache class="solr.FastLRUCache"
468
+ size="512"
469
+ autowarmCount="128"
470
+ showItems="32" />
471
+ -->
472
+
473
+ <!-- Custom Cache
474
+
475
+ Example of a generic cache. These caches may be accessed by
476
+ name through SolrIndexSearcher.getCache(),cacheLookup(), and
477
+ cacheInsert(). The purpose is to enable easy caching of
478
+ user/application level data. The regenerator argument should
479
+ be specified as an implementation of solr.CacheRegenerator
480
+ if autowarming is desired.
481
+ -->
482
+ <!--
483
+ <cache name="myUserCache"
484
+ class="solr.LRUCache"
485
+ size="4096"
486
+ initialSize="1024"
487
+ autowarmCount="1024"
488
+ regenerator="com.mycompany.MyRegenerator"
489
+ />
490
+ -->
491
+
492
+
493
+ <!-- Lazy Field Loading
103
494
 
104
- <!-- a newSearcher event is fired whenever a new searcher is being prepared
105
- and there is a current searcher handling requests (aka registered).
106
- It can be used to prime certain caches to prevent long request times for
107
- certain requests.
495
+ If true, stored fields that are not requested will be loaded
496
+ lazily. This can result in a significant speed improvement
497
+ if the usual case is to not load all stored fields,
498
+ especially if the skipped fields are large compressed text
499
+ fields.
108
500
  -->
501
+ <enableLazyFieldLoading>true</enableLazyFieldLoading>
502
+
503
+ <!-- Use Filter For Sorted Query
504
+
505
+ A possible optimization that attempts to use a filter to
506
+ satisfy a search. If the requested sort does not include
507
+ score, then the filterCache will be checked for a filter
508
+ matching the query. If found, the filter will be used as the
509
+ source of document ids, and then the sort will be applied to
510
+ that.
511
+
512
+ For most situations, this will not be useful unless you
513
+ frequently get the same search repeatedly with different sort
514
+ options, and none of them ever use "score"
515
+ -->
516
+ <!--
517
+ <useFilterForSortedQuery>true</useFilterForSortedQuery>
518
+ -->
519
+
520
+ <!-- Result Window Size
521
+
522
+ An optimization for use with the queryResultCache. When a search
523
+ is requested, a superset of the requested number of document ids
524
+ are collected. For example, if a search for a particular query
525
+ requests matching documents 10 through 19, and queryWindowSize is 50,
526
+ then documents 0 through 49 will be collected and cached. Any further
527
+ requests in that range can be satisfied via the cache.
528
+ -->
529
+ <queryResultWindowSize>20</queryResultWindowSize>
530
+
531
+ <!-- Maximum number of documents to cache for any entry in the
532
+ queryResultCache.
533
+ -->
534
+ <queryResultMaxDocsCached>200</queryResultMaxDocsCached>
535
+
536
+ <!-- Query Related Event Listeners
537
+
538
+ Various IndexSearcher related events can trigger Listeners to
539
+ take actions.
540
+
541
+ newSearcher - fired whenever a new searcher is being prepared
542
+ and there is a current searcher handling requests (aka
543
+ registered). It can be used to prime certain caches to
544
+ prevent long request times for certain requests.
545
+
546
+ firstSearcher - fired whenever a new searcher is being
547
+ prepared but there is no current registered searcher to handle
548
+ requests or to gain autowarming data from.
549
+
550
+
551
+ -->
109
552
  <!-- QuerySenderListener takes an array of NamedList and executes a
110
- local query request for each NamedList in sequence. -->
553
+ local query request for each NamedList in sequence.
554
+ -->
111
555
  <listener event="newSearcher" class="solr.QuerySenderListener">
112
556
  <arr name="queries">
113
- <!-- query for all objects (default query) for home page facets -->
114
- <lst>
115
- <str name="rows">0</str>
116
- <str name="fl">score</str>
117
- <str name="facet">true</str>
118
- <str name="facet.mincount">1</str>
119
- <str name="facet.limit">10</str>
120
- <str name="facet.field">format</str>
121
- <str name="facet.field">lc_1letter_facet</str>
122
- <str name="f.lc_1letter_facet.facet.sort">false</str>
123
- <str name="facet.field">lc_alpha_facet</str>
124
- <str name="facet.field">lc_b4cutter_facet</str>
125
- <str name="facet.field">language_facet</str>
126
- <str name="facet.field">pub_date</str>
127
- <str name="facet.field">subject_era_facet</str>
128
- <str name="facet.field">subject_geo_facet</str>
129
- <str name="facet.field">subject_topic_facet</str>
130
- </lst>
131
- <!-- query for single document to populate filter cache -->
132
- <lst>
133
- <str name="q">id:00282214</str>
134
- <str name="qt">standard</str>
135
- <str name="rows">0</str>
136
- <str name="fl">score</str>
137
- <str name="facet">true</str>
138
- <str name="facet.mincount">1</str>
139
- <str name="facet.limit">10</str>
140
- <str name="facet.field">format</str>
141
- <str name="facet.field">lc_1letter_facet</str>
142
- <str name="f.lc_1letter_facet.facet.sort">false</str>
143
- <str name="facet.field">lc_alpha_facet</str>
144
- <str name="facet.field">lc_b4cutter_facet</str>
145
- <str name="facet.field">language_facet</str>
146
- <str name="facet.field">pub_date</str>
147
- <str name="facet.field">subject_era_facet</str>
148
- <str name="facet.field">subject_geo_facet</str>
149
- <str name="facet.field">subject_topic_facet</str>
150
- </lst>
557
+ <!--
558
+ <lst><str name="q">solr</str><str name="sort">price asc</str></lst>
559
+ <lst><str name="q">rocks</str><str name="sort">weight asc</str></lst>
560
+ -->
151
561
  </arr>
152
562
  </listener>
153
-
154
- <!-- a firstSearcher event is fired whenever a new searcher is being
155
- prepared but there is no current registered searcher to handle
156
- requests or to gain autowarming data from. -->
157
563
  <listener event="firstSearcher" class="solr.QuerySenderListener">
158
564
  <arr name="queries">
159
- <!-- query for all objects (default query) for home page facets -->
160
- <lst>
161
- <str name="rows">0</str>
162
- <str name="fl">score</str>
163
- <str name="facet">true</str>
164
- <str name="facet.mincount">1</str>
165
- <str name="facet.limit">10</str>
166
- <str name="facet.field">format</str>
167
- <str name="facet.field">lc_1letter_facet</str>
168
- <str name="f.lc_1letter_facet.facet.sort">false</str>
169
- <str name="facet.field">lc_alpha_facet</str>
170
- <str name="facet.field">lc_b4cutter_facet</str>
171
- <str name="facet.field">language_facet</str>
172
- <str name="facet.field">pub_date</str>
173
- <str name="facet.field">subject_era_facet</str>
174
- <str name="facet.field">subject_geo_facet</str>
175
- <str name="facet.field">subject_topic_facet</str>
176
- </lst>
177
- <!-- query for single document to populate filter cache -->
178
565
  <lst>
179
- <str name="q">id:00282214</str>
180
- <str name="qt">standard</str>
181
- <str name="rows">0</str>
182
- <str name="fl">score</str>
183
- <str name="facet">true</str>
184
- <str name="facet.mincount">1</str>
185
- <str name="facet.limit">10</str>
186
- <str name="facet.field">format</str>
187
- <str name="facet.field">lc_1letter_facet</str>
188
- <str name="f.lc_1letter_facet.facet.sort">false</str>
189
- <str name="facet.field">lc_alpha_facet</str>
190
- <str name="facet.field">lc_b4cutter_facet</str>
191
- <str name="facet.field">language_facet</str>
192
- <str name="facet.field">pub_date</str>
193
- <str name="facet.field">subject_era_facet</str>
194
- <str name="facet.field">subject_geo_facet</str>
195
- <str name="facet.field">subject_topic_facet</str>
566
+ <str name="q">static firstSearcher warming in solrconfig.xml</str>
196
567
  </lst>
197
568
  </arr>
198
569
  </listener>
199
570
 
571
+ <!-- Use Cold Searcher
572
+
573
+ If a search request comes in and there is no current
574
+ registered searcher, then immediately register the still
575
+ warming searcher and use it. If "false" then all requests
576
+ will block until the first searcher is done warming.
577
+ -->
200
578
  <useColdSearcher>false</useColdSearcher>
579
+
580
+ <!-- Max Warming Searchers
581
+
582
+ Maximum number of searchers that may be warming in the
583
+ background concurrently. An error is returned if this limit
584
+ is exceeded.
585
+
586
+ Recommend values of 1-2 for read-only slaves, higher for
587
+ masters w/o cache warming.
588
+ -->
201
589
  <maxWarmingSearchers>2</maxWarmingSearchers>
590
+
202
591
  </query>
203
592
 
593
+
594
+ <!-- Request Dispatcher
595
+
596
+ This section contains instructions for how the SolrDispatchFilter
597
+ should behave when processing requests for this SolrCore.
598
+
599
+ handleSelect affects the behavior of requests such as /select?qt=XXX
600
+
601
+ handleSelect="true" will cause the SolrDispatchFilter to process
602
+ the request and will result in consistent error handling and
603
+ formatting for all types of requests.
604
+
605
+ handleSelect="false" will cause the SolrDispatchFilter to
606
+ ignore "/select" requests and fallback to using the legacy
607
+ SolrServlet and it's Solr 1.1 style error formatting
608
+ -->
204
609
  <requestDispatcher handleSelect="true" >
205
- <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="2048" />
206
- <httpCaching lastModifiedFrom="openTime" etagSeed="Solr" />
610
+ <!-- Request Parsing
611
+
612
+ These settings indicate how Solr Requests may be parsed, and
613
+ what restrictions may be placed on the ContentStreams from
614
+ those requests
615
+
616
+ enableRemoteStreaming - enables use of the stream.file
617
+ and stream.url parameters for specifying remote streams.
618
+
619
+ multipartUploadLimitInKB - specifies the max size of
620
+ Multipart File Uploads that Solr will allow in a Request.
621
+
622
+ *** WARNING ***
623
+ The settings below authorize Solr to fetch remote files, You
624
+ should make sure your system has some authentication before
625
+ using enableRemoteStreaming="true"
626
+
627
+ -->
628
+ <requestParsers enableRemoteStreaming="true"
629
+ multipartUploadLimitInKB="2048000" />
630
+
631
+ <!-- HTTP Caching
632
+
633
+ Set HTTP caching related parameters (for proxy caches and clients).
634
+
635
+ The options below instruct Solr not to output any HTTP Caching
636
+ related headers
637
+ -->
638
+ <httpCaching never304="true" />
639
+ <!-- If you include a <cacheControl> directive, it will be used to
640
+ generate a Cache-Control header (as well as an Expires header
641
+ if the value contains "max-age=")
642
+
643
+ By default, no Cache-Control header is generated.
644
+
645
+ You can use the <cacheControl> option even if you have set
646
+ never304="true"
647
+ -->
648
+ <!--
649
+ <httpCaching never304="true" >
650
+ <cacheControl>max-age=30, public</cacheControl>
651
+ </httpCaching>
652
+ -->
653
+ <!-- To enable Solr to respond with automatically generated HTTP
654
+ Caching headers, and to response to Cache Validation requests
655
+ correctly, set the value of never304="false"
656
+
657
+ This will cause Solr to generate Last-Modified and ETag
658
+ headers based on the properties of the Index.
659
+
660
+ The following options can also be specified to affect the
661
+ values of these headers...
662
+
663
+ lastModFrom - the default value is "openTime" which means the
664
+ Last-Modified value (and validation against If-Modified-Since
665
+ requests) will all be relative to when the current Searcher
666
+ was opened. You can change it to lastModFrom="dirLastMod" if
667
+ you want the value to exactly correspond to when the physical
668
+ index was last modified.
669
+
670
+ etagSeed="..." is an option you can change to force the ETag
671
+ header (and validation against If-None-Match requests) to be
672
+ different even if the index has not changed (ie: when making
673
+ significant changes to your config file)
674
+
675
+ (lastModifiedFrom and etagSeed are both ignored if you use
676
+ the never304="true" option)
677
+ -->
678
+ <!--
679
+ <httpCaching lastModifiedFrom="openTime"
680
+ etagSeed="Solr">
681
+ <cacheControl>max-age=30, public</cacheControl>
682
+ </httpCaching>
683
+ -->
207
684
  </requestDispatcher>
208
685
 
209
- <!-- blacklight does not use the standard request handler -->
210
- <requestHandler name="standard" class="solr.SearchHandler">
211
- <lst name="defaults">
212
- <str name="echoParams">all</str>
213
- <str name="q.op">AND</str>
214
- </lst>
215
- </requestHandler>
686
+ <!-- Request Handlers
216
687
 
217
- <!-- Searching ("All Fields") -->
218
- <requestHandler name="search" class="solr.SearchHandler" default="true" >
219
- <lst name="defaults">
220
- <str name="defType">dismax</str>
221
- <str name="echoParams">explicit</str>
222
- <str name="q.alt">*:*</str>
223
- <str name="mm">2&lt;-1 5&lt;-2 6&lt;90%</str>
224
- <!-- this qf and pf are used by default, if not otherwise specified by
225
- client. The default blacklight_config will use these for the
226
- "keywords" search. See the author_qf/author_pf, title_qf, etc
227
- below, which the default blacklight_config will specify for
228
- those searches. You may also be interested in:
229
- http://wiki.apache.org/solr/LocalParams
230
- -->
231
- <str name="qf">
232
- title_unstem_search^100000
233
- subtitle_unstem_search^50000
234
- title_t^25000
235
- subtitle_t^10000
236
- title_addl_unstem_search^5000
237
- title_addl_t^2500
238
- title_added_entry_unstem_search^1500
239
- title_added_entry_t^1250
240
- subject_topic_unstem_search^1000
241
- subject_unstem_search^750
242
- subject_topic_facet^625
243
- subject_t^500
244
- author_unstem_search^250
245
- author_addl_unstem_search^250
246
- author_t^100
247
- author_addl_t^50
248
- subject_addl_unstem_search^250
249
- subject_addl_t^50
250
- title_series_unstem_search^25
251
- title_series_t^10
252
- isbn_t
253
- text
254
- </str>
255
- <str name="pf">
256
- title_unstem_search^1000000
257
- subtitle_unstem_search^500000
258
- title_t^250000
259
- subtitle_t^100000
260
- title_addl_unstem_search^50000
261
- title_addl_t^25000
262
- title_added_entry_unstem_search^15000
263
- title_added_entry_t^12500
264
- subject_topic_unstem_search^10000
265
- subject_unstem_search^7500
266
- subject_topic_facet^6250
267
- subject_t^5000
268
- author_unstem_search^2500
269
- author_addl_unstem_search^2500
270
- author_t^1000
271
- author_addl_t^500
272
- subject_addl_unstem_search^2500
273
- subject_addl_t^500
274
- title_series_unstem_search^250
275
- title_series_t^100
276
- text^10
277
- </str>
278
- <str name="author_qf">
279
- author_unstem_search^200
280
- author_addl_unstem_search^50
281
- author_t^20
282
- author_addl_t
283
- </str>
284
- <str name="author_pf">
285
- author_unstem_search^2000
286
- author_addl_unstem_search^500
287
- author_t^200
288
- author_addl_t^10
289
- </str>
290
- <str name="title_qf">
291
- title_unstem_search^50000
292
- subtitle_unstem_search^25000
293
- title_addl_unstem_search^10000
294
- title_t^5000
295
- subtitle_t^2500
296
- title_addl_t^100
297
- title_added_entry_unstem_search^50
298
- title_added_entry_t^10
299
- title_series_unstem_search^5
300
- title_series_t
301
- </str>
302
- <str name="title_pf">
303
- title_unstem_search^500000
304
- subtitle_unstem_search^250000
305
- title_addl_unstem_search^100000
306
- title_t^50000
307
- subtitle_t^25000
308
- title_addl_t^1000
309
- title_added_entry_unstem_search^500
310
- title_added_entry_t^100
311
- title_series_t^50
312
- title_series_unstem_search^10
313
- </str>
314
- <str name="subject_qf">
315
- subject_topic_unstem_search^200
316
- subject_unstem_search^125
317
- subject_topic_facet^100
318
- subject_t^50
319
- subject_addl_unstem_search^10
320
- subject_addl_t
321
- </str>
322
- <str name="subject_pf">
323
- subject_topic_unstem_search^2000
324
- subject_unstem_search^1250
325
- subject_t^1000
326
- subject_topic_facet^500
327
- subject_addl_unstem_search^100
328
- subject_addl_t^10
329
- </str>
330
-
331
-
332
- <int name="ps">3</int>
333
- <float name="tie">0.01</float>
688
+ http://wiki.apache.org/solr/SolrRequestHandler
334
689
 
335
- <!-- NOT using marc_display because it is large and will slow things down for search results -->
336
- <str name="fl">
337
- id,
338
- score,
339
- author_display,
340
- author_vern_display,
341
- format,
342
- isbn_t,
343
- language_facet,
344
- lc_callnum_display,
345
- material_type_display,
346
- published_display,
347
- published_vern_display,
348
- pub_date,
349
- title_display,
350
- title_vern_display,
351
- subject_topic_facet,
352
- subject_geo_facet,
353
- subject_era_facet,
354
- subtitle_display,
355
- subtitle_vern_display,
356
- url_fulltext_display,
357
- url_suppl_display,
358
- </str>
359
-
360
- <str name="facet">true</str>
361
- <str name="facet.mincount">1</str>
362
- <str name="facet.limit">10</str>
363
- <str name="facet.field">format</str>
364
- <str name="facet.field">lc_1letter_facet</str>
365
- <str name="facet.field">lc_alpha_facet</str>
366
- <str name="facet.field">lc_b4cutter_facet</str>
367
- <str name="facet.field">language_facet</str>
368
- <str name="facet.field">pub_date</str>
369
- <str name="facet.field">subject_era_facet</str>
370
- <str name="facet.field">subject_geo_facet</str>
371
- <str name="facet.field">subject_topic_facet</str>
372
-
373
- <str name="spellcheck">true</str>
374
- <str name="spellcheck.dictionary">default</str>
375
- <str name="spellcheck.onlyMorePopular">true</str>
376
- <str name="spellcheck.extendedResults">true</str>
377
- <str name="spellcheck.collate">false</str>
378
- <str name="spellcheck.count">5</str>
379
- </lst>
690
+ incoming queries will be dispatched to the correct handler
691
+ based on the path or the qt (query type) param.
692
+
693
+ Names starting with a '/' are accessed with the a path equal to
694
+ the registered name. Names without a leading '/' are accessed
695
+ with: http://host/app/[core/]select?qt=name
696
+
697
+ If a /select request is processed with out a qt param
698
+ specified, the requestHandler that declares default="true" will
699
+ be used.
700
+
701
+ If a Request Handler is declared with startup="lazy", then it will
702
+ not be initialized until the first request that uses it.
703
+
704
+ -->
705
+ <!-- SearchHandler
706
+
707
+ http://wiki.apache.org/solr/SearchHandler
708
+
709
+ For processing Search Queries, the primary Request Handler
710
+ provided with Solr is "SearchHandler" It delegates to a sequent
711
+ of SearchComponents (see below) and supports distributed
712
+ queries across multiple shards
713
+ -->
714
+ <requestHandler name="search" class="solr.SearchHandler" default="true">
715
+ <!-- default values for query parameters can be specified, these
716
+ will be overridden by parameters in the request
717
+ -->
718
+ <lst name="defaults">
719
+ <str name="defType">dismax</str>
720
+ <str name="echoParams">explicit</str>
721
+ <int name="rows">10</int>
722
+
723
+ <str name="q.alt">*:*</str>
724
+ <str name="mm">2&lt;-1 5&lt;-2 6&lt;90%</str>
725
+
726
+ <!-- this qf and pf are used by default, if not otherwise specified by
727
+ client. The default blacklight_config will use these for the
728
+ "keywords" search. See the author_qf/author_pf, title_qf, etc
729
+ below, which the default blacklight_config will specify for
730
+ those searches. You may also be interested in:
731
+ http://wiki.apache.org/solr/LocalParams
732
+ -->
733
+
734
+ <str name="qf">
735
+ title_unstem_search^100000
736
+ subtitle_unstem_search^50000
737
+ title_t^25000
738
+ subtitle_t^10000
739
+ title_addl_unstem_search^5000
740
+ title_addl_t^2500
741
+ title_added_entry_unstem_search^1500
742
+ title_added_entry_t^1250
743
+ subject_topic_unstem_search^1000
744
+ subject_unstem_search^750
745
+ subject_topic_facet^625
746
+ subject_t^500
747
+ author_unstem_search^250
748
+ author_addl_unstem_search^250
749
+ author_t^100
750
+ author_addl_t^50
751
+ subject_addl_unstem_search^250
752
+ subject_addl_t^50
753
+ title_series_unstem_search^25
754
+ title_series_t^10
755
+ isbn_t
756
+ text
757
+ </str>
758
+ <str name="pf">
759
+ title_unstem_search^1000000
760
+ subtitle_unstem_search^500000
761
+ title_t^250000
762
+ subtitle_t^100000
763
+ title_addl_unstem_search^50000
764
+ title_addl_t^25000
765
+ title_added_entry_unstem_search^15000
766
+ title_added_entry_t^12500
767
+ subject_topic_unstem_search^10000
768
+ subject_unstem_search^7500
769
+ subject_topic_facet^6250
770
+ subject_t^5000
771
+ author_unstem_search^2500
772
+ author_addl_unstem_search^2500
773
+ author_t^1000
774
+ author_addl_t^500
775
+ subject_addl_unstem_search^2500
776
+ subject_addl_t^500
777
+ title_series_unstem_search^250
778
+ title_series_t^100
779
+ text^10
780
+ </str>
781
+ <str name="author_qf">
782
+ author_unstem_search^200
783
+ author_addl_unstem_search^50
784
+ author_t^20
785
+ author_addl_t
786
+ </str>
787
+ <str name="author_pf">
788
+ author_unstem_search^2000
789
+ author_addl_unstem_search^500
790
+ author_t^200
791
+ author_addl_t^10
792
+ </str>
793
+ <str name="title_qf">
794
+ title_unstem_search^50000
795
+ subtitle_unstem_search^25000
796
+ title_addl_unstem_search^10000
797
+ title_t^5000
798
+ subtitle_t^2500
799
+ title_addl_t^100
800
+ title_added_entry_unstem_search^50
801
+ title_added_entry_t^10
802
+ title_series_unstem_search^5
803
+ title_series_t
804
+ </str>
805
+ <str name="title_pf">
806
+ title_unstem_search^500000
807
+ subtitle_unstem_search^250000
808
+ title_addl_unstem_search^100000
809
+ title_t^50000
810
+ subtitle_t^25000
811
+ title_addl_t^1000
812
+ title_added_entry_unstem_search^500
813
+ title_added_entry_t^100
814
+ title_series_t^50
815
+ title_series_unstem_search^10
816
+ </str>
817
+ <str name="subject_qf">
818
+ subject_topic_unstem_search^200
819
+ subject_unstem_search^125
820
+ subject_topic_facet^100
821
+ subject_t^50
822
+ subject_addl_unstem_search^10
823
+ subject_addl_t
824
+ </str>
825
+ <str name="subject_pf">
826
+ subject_topic_unstem_search^2000
827
+ subject_unstem_search^1250
828
+ subject_t^1000
829
+ subject_topic_facet^500
830
+ subject_addl_unstem_search^100
831
+ subject_addl_t^10
832
+ </str>
833
+
834
+ <int name="ps">3</int>
835
+ <float name="tie">0.01</float>
836
+
837
+ <!-- NOT using marc_display because it is large and will slow things down for search results -->
838
+ <str name="fl">
839
+ id,
840
+ score,
841
+ author_display,
842
+ author_vern_display,
843
+ format,
844
+ isbn_t,
845
+ language_facet,
846
+ lc_callnum_display,
847
+ material_type_display,
848
+ published_display,
849
+ published_vern_display,
850
+ pub_date,
851
+ title_display,
852
+ title_vern_display,
853
+ subject_topic_facet,
854
+ subject_geo_facet,
855
+ subject_era_facet,
856
+ subtitle_display,
857
+ subtitle_vern_display,
858
+ url_fulltext_display,
859
+ url_suppl_display,
860
+ </str>
861
+
862
+ <str name="facet">true</str>
863
+ <str name="facet.mincount">1</str>
864
+ <str name="facet.limit">10</str>
865
+ <str name="facet.field">format</str>
866
+ <str name="facet.field">lc_1letter_facet</str>
867
+ <str name="facet.field">lc_alpha_facet</str>
868
+ <str name="facet.field">lc_b4cutter_facet</str>
869
+ <str name="facet.field">language_facet</str>
870
+ <str name="facet.field">pub_date</str>
871
+ <str name="facet.field">subject_era_facet</str>
872
+ <str name="facet.field">subject_geo_facet</str>
873
+ <str name="facet.field">subject_topic_facet</str>
874
+
875
+ <str name="spellcheck">true</str>
876
+ <str name="spellcheck.dictionary">default</str>
877
+ <str name="spellcheck.onlyMorePopular">true</str>
878
+ <str name="spellcheck.extendedResults">true</str>
879
+ <str name="spellcheck.collate">false</str>
880
+ <str name="spellcheck.count">5</str>
881
+
882
+ </lst>
883
+ <!-- In addition to defaults, "appends" params can be specified
884
+ to identify values which should be appended to the list of
885
+ multi-val params from the query (or the existing "defaults").
886
+ -->
887
+ <!-- In this example, the param "fq=instock:true" would be appended to
888
+ any query time fq params the user may specify, as a mechanism for
889
+ partitioning the index, independent of any user selected filtering
890
+ that may also be desired (perhaps as a result of faceted searching).
891
+
892
+ NOTE: there is *absolutely* nothing a client can do to prevent these
893
+ "appends" values from being used, so don't use this mechanism
894
+ unless you are sure you always want it.
895
+ -->
896
+ <!--
897
+ <lst name="appends">
898
+ <str name="fq">inStock:true</str>
899
+ </lst>
900
+ -->
901
+ <!-- "invariants" are a way of letting the Solr maintainer lock down
902
+ the options available to Solr clients. Any params values
903
+ specified here are used regardless of what values may be specified
904
+ in either the query, the "defaults", or the "appends" params.
905
+
906
+ In this example, the facet.field and facet.query params would
907
+ be fixed, limiting the facets clients can use. Faceting is
908
+ not turned on by default - but if the client does specify
909
+ facet=true in the request, these are the only facets they
910
+ will be able to see counts for; regardless of what other
911
+ facet.field or facet.query params they may specify.
912
+
913
+ NOTE: there is *absolutely* nothing a client can do to prevent these
914
+ "invariants" values from being used, so don't use this mechanism
915
+ unless you are sure you always want it.
916
+ -->
917
+ <!--
918
+ <lst name="invariants">
919
+ <str name="facet.field">cat</str>
920
+ <str name="facet.field">manu_exact</str>
921
+ <str name="facet.query">price:[* TO 500]</str>
922
+ <str name="facet.query">price:[500 TO *]</str>
923
+ </lst>
924
+ -->
925
+ <!-- If the default list of SearchComponents is not desired, that
926
+ list can either be overridden completely, or components can be
927
+ prepended or appended to the default list. (see below)
928
+ -->
929
+ <!--
930
+ <arr name="components">
931
+ <str>nameOfCustomComponent1</str>
932
+ <str>nameOfCustomComponent2</str>
933
+ </arr>
934
+ -->
380
935
  <arr name="last-components">
381
936
  <str>spellcheck</str>
382
937
  </arr>
938
+
383
939
  </requestHandler>
384
-
940
+
385
941
  <!-- for requests to get a single document; use id=666 instead of q=id:666 -->
386
942
  <requestHandler name="document" class="solr.SearchHandler" >
387
943
  <lst name="defaults">
@@ -391,7 +947,7 @@
391
947
  <str name="q">{!raw f=id v=$id}</str> <!-- use id=666 instead of q=id:666 -->
392
948
  </lst>
393
949
  </requestHandler>
394
-
950
+
395
951
  <!-- For Advanced Search -->
396
952
  <requestHandler name="advanced" class="solr.SearchHandler" >
397
953
  <lst name="defaults">
@@ -521,9 +1077,262 @@
521
1077
  <str>spellcheck</str>
522
1078
  </arr>
523
1079
  </requestHandler>
1080
+
1081
+
1082
+ <!-- XML Update Request Handler.
1083
+
1084
+ http://wiki.apache.org/solr/UpdateXmlMessages
1085
+
1086
+ The canonical Request Handler for Modifying the Index through
1087
+ commands specified using XML.
1088
+
1089
+ Note: Since solr1.1 requestHandlers requires a valid content
1090
+ type header if posted in the body. For example, curl now
1091
+ requires: -H 'Content-type:text/xml; charset=utf-8'
1092
+ -->
1093
+ <requestHandler name="/update"
1094
+ class="solr.XmlUpdateRequestHandler">
1095
+ <!-- See below for information on defining
1096
+ updateRequestProcessorChains that can be used by name
1097
+ on each Update Request
1098
+ -->
1099
+ <!--
1100
+ <lst name="defaults">
1101
+ <str name="update.chain">dedupe</str>
1102
+ </lst>
1103
+ -->
1104
+ </requestHandler>
1105
+ <!-- Binary Update Request Handler
1106
+ http://wiki.apache.org/solr/javabin
1107
+ -->
1108
+ <requestHandler name="/update/javabin"
1109
+ class="solr.BinaryUpdateRequestHandler" />
1110
+
1111
+ <!-- CSV Update Request Handler
1112
+ http://wiki.apache.org/solr/UpdateCSV
1113
+ -->
1114
+ <requestHandler name="/update/csv"
1115
+ class="solr.CSVRequestHandler"
1116
+ startup="lazy" />
1117
+
1118
+ <!-- JSON Update Request Handler
1119
+ http://wiki.apache.org/solr/UpdateJSON
1120
+ -->
1121
+ <requestHandler name="/update/json"
1122
+ class="solr.JsonUpdateRequestHandler"
1123
+ startup="lazy" />
1124
+
1125
+ <!-- Solr Cell Update Request Handler
1126
+
1127
+ http://wiki.apache.org/solr/ExtractingRequestHandler
1128
+
1129
+ -->
1130
+ <requestHandler name="/update/extract"
1131
+ startup="lazy"
1132
+ class="solr.extraction.ExtractingRequestHandler" >
1133
+ <lst name="defaults">
1134
+ <!-- All the main content goes into "text"... if you need to return
1135
+ the extracted text or do highlighting, use a stored field. -->
1136
+ <str name="fmap.content">text</str>
1137
+ <str name="lowernames">true</str>
1138
+ <str name="uprefix">ignored_</str>
1139
+
1140
+ <!-- capture link hrefs but ignore div attributes -->
1141
+ <str name="captureAttr">true</str>
1142
+ <str name="fmap.a">links</str>
1143
+ <str name="fmap.div">ignored_</str>
1144
+ </lst>
1145
+ </requestHandler>
1146
+
1147
+ <!-- Field Analysis Request Handler
1148
+
1149
+ RequestHandler that provides much the same functionality as
1150
+ analysis.jsp. Provides the ability to specify multiple field
1151
+ types and field names in the same request and outputs
1152
+ index-time and query-time analysis for each of them.
1153
+
1154
+ Request parameters are:
1155
+ analysis.fieldname - field name whose analyzers are to be used
1156
+
1157
+ analysis.fieldtype - field type whose analyzers are to be used
1158
+ analysis.fieldvalue - text for index-time analysis
1159
+ q (or analysis.q) - text for query time analysis
1160
+ analysis.showmatch (true|false) - When set to true and when
1161
+ query analysis is performed, the produced tokens of the
1162
+ field value analysis will be marked as "matched" for every
1163
+ token that is produces by the query analysis
1164
+ -->
1165
+ <requestHandler name="/analysis/field"
1166
+ startup="lazy"
1167
+ class="solr.FieldAnalysisRequestHandler" />
1168
+
1169
+
1170
+ <!-- Document Analysis Handler
1171
+
1172
+ http://wiki.apache.org/solr/AnalysisRequestHandler
1173
+
1174
+ An analysis handler that provides a breakdown of the analysis
1175
+ process of provided docuemnts. This handler expects a (single)
1176
+ content stream with the following format:
1177
+
1178
+ <docs>
1179
+ <doc>
1180
+ <field name="id">1</field>
1181
+ <field name="name">The Name</field>
1182
+ <field name="text">The Text Value</field>
1183
+ </doc>
1184
+ <doc>...</doc>
1185
+ <doc>...</doc>
1186
+ ...
1187
+ </docs>
1188
+
1189
+ Note: Each document must contain a field which serves as the
1190
+ unique key. This key is used in the returned response to associate
1191
+ an analysis breakdown to the analyzed document.
1192
+
1193
+ Like the FieldAnalysisRequestHandler, this handler also supports
1194
+ query analysis by sending either an "analysis.query" or "q"
1195
+ request parameter that holds the query text to be analyzed. It
1196
+ also supports the "analysis.showmatch" parameter which when set to
1197
+ true, all field tokens that match the query tokens will be marked
1198
+ as a "match".
1199
+ -->
1200
+ <requestHandler name="/analysis/document"
1201
+ class="solr.DocumentAnalysisRequestHandler"
1202
+ startup="lazy" />
1203
+
1204
+ <!-- Admin Handlers
1205
+
1206
+ Admin Handlers - This will register all the standard admin
1207
+ RequestHandlers.
1208
+ -->
1209
+ <requestHandler name="/admin/"
1210
+ class="solr.admin.AdminHandlers" />
1211
+ <!-- This single handler is equivalent to the following... -->
1212
+ <!--
1213
+ <requestHandler name="/admin/luke" class="solr.admin.LukeRequestHandler" />
1214
+ <requestHandler name="/admin/system" class="solr.admin.SystemInfoHandler" />
1215
+ <requestHandler name="/admin/plugins" class="solr.admin.PluginInfoHandler" />
1216
+ <requestHandler name="/admin/threads" class="solr.admin.ThreadDumpHandler" />
1217
+ <requestHandler name="/admin/properties" class="solr.admin.PropertiesRequestHandler" />
1218
+ <requestHandler name="/admin/file" class="solr.admin.ShowFileRequestHandler" >
1219
+ -->
1220
+ <!-- If you wish to hide files under ${solr.home}/conf, explicitly
1221
+ register the ShowFileRequestHandler using:
1222
+ -->
1223
+ <!--
1224
+ <requestHandler name="/admin/file"
1225
+ class="solr.admin.ShowFileRequestHandler" >
1226
+ <lst name="invariants">
1227
+ <str name="hidden">synonyms.txt</str>
1228
+ <str name="hidden">anotherfile.txt</str>
1229
+ </lst>
1230
+ </requestHandler>
1231
+ -->
1232
+
1233
+ <!-- ping/healthcheck -->
1234
+ <requestHandler name="/admin/ping" class="solr.PingRequestHandler">
1235
+ <lst name="defaults">
1236
+ <str name="qt">search</str>
1237
+ <str name="q">solrpingquery</str>
1238
+ <str name="echoParams">all</str>
1239
+ </lst>
1240
+ </requestHandler>
1241
+
1242
+ <!-- Echo the request contents back to the client -->
1243
+ <requestHandler name="/debug/dump" class="solr.DumpRequestHandler" >
1244
+ <lst name="defaults">
1245
+ <str name="echoParams">explicit</str>
1246
+ <str name="echoHandler">true</str>
1247
+ </lst>
1248
+ </requestHandler>
524
1249
 
1250
+ <!-- Solr Replication
1251
+
1252
+ The SolrReplicationHandler supports replicating indexes from a
1253
+ "master" used for indexing and "salves" used for queries.
1254
+
1255
+ http://wiki.apache.org/solr/SolrReplication
1256
+
1257
+ In the example below, remove the <lst name="master"> section if
1258
+ this is just a slave and remove the <lst name="slave"> section
1259
+ if this is just a master.
1260
+ -->
1261
+ <!--
1262
+ <requestHandler name="/replication" class="solr.ReplicationHandler" >
1263
+ <lst name="master">
1264
+ <str name="replicateAfter">commit</str>
1265
+ <str name="replicateAfter">startup</str>
1266
+ <str name="confFiles">schema.xml,stopwords.txt</str>
1267
+ </lst>
1268
+ <lst name="slave">
1269
+ <str name="masterUrl">http://localhost:8983/solr/replication</str>
1270
+ <str name="pollInterval">00:00:60</str>
1271
+ </lst>
1272
+ </requestHandler>
1273
+ -->
1274
+
1275
+ <!-- Search Components
1276
+
1277
+ Search components are registered to SolrCore and used by
1278
+ instances of SearchHandler (which can access them by name)
1279
+
1280
+ By default, the following components are available:
1281
+
1282
+ <searchComponent name="query" class="solr.QueryComponent" />
1283
+ <searchComponent name="facet" class="solr.FacetComponent" />
1284
+ <searchComponent name="mlt" class="solr.MoreLikeThisComponent" />
1285
+ <searchComponent name="highlight" class="solr.HighlightComponent" />
1286
+ <searchComponent name="stats" class="solr.StatsComponent" />
1287
+ <searchComponent name="debug" class="solr.DebugComponent" />
1288
+
1289
+ Default configuration in a requestHandler would look like:
1290
+
1291
+ <arr name="components">
1292
+ <str>query</str>
1293
+ <str>facet</str>
1294
+ <str>mlt</str>
1295
+ <str>highlight</str>
1296
+ <str>stats</str>
1297
+ <str>debug</str>
1298
+ </arr>
1299
+
1300
+ If you register a searchComponent to one of the standard names,
1301
+ that will be used instead of the default.
1302
+
1303
+ To insert components before or after the 'standard' components, use:
1304
+
1305
+ <arr name="first-components">
1306
+ <str>myFirstComponentName</str>
1307
+ </arr>
1308
+
1309
+ <arr name="last-components">
1310
+ <str>myLastComponentName</str>
1311
+ </arr>
1312
+
1313
+ NOTE: The component registered with the name "debug" will
1314
+ always be executed after the "last-components"
1315
+
1316
+ -->
1317
+
1318
+ <!-- Spell Check
1319
+
1320
+ The spell check component can return a list of alternative spelling
1321
+ suggestions.
1322
+
1323
+ http://wiki.apache.org/solr/SpellCheckComponent
1324
+ -->
525
1325
  <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
1326
+
526
1327
  <str name="queryAnalyzerFieldType">textSpell</str>
1328
+
1329
+ <!-- Multiple "Spell Checkers" can be declared and used by this
1330
+ component
1331
+ -->
1332
+
1333
+ <!-- a spellchecker built from a field of the main index, and
1334
+ written to disk
1335
+ -->
527
1336
  <lst name="spellchecker">
528
1337
  <str name="name">default</str>
529
1338
  <str name="field">spell</str>
@@ -551,28 +1360,487 @@
551
1360
  <str name="accuracy">0.7</str>
552
1361
  <str name="buildOnOptimize">true</str>
553
1362
  </lst>
1363
+
1364
+ <!-- a spellchecker that uses a different distance measure -->
1365
+ <!--
1366
+ <lst name="spellchecker">
1367
+ <str name="name">jarowinkler</str>
1368
+ <str name="field">spell</str>
1369
+ <str name="distanceMeasure">
1370
+ org.apache.lucene.search.spell.JaroWinklerDistance
1371
+ </str>
1372
+ <str name="spellcheckIndexDir">spellcheckerJaro</str>
1373
+ </lst>
1374
+ -->
1375
+
1376
+ <!-- a spellchecker that use an alternate comparator
1377
+
1378
+ comparatorClass be one of:
1379
+ 1. score (default)
1380
+ 2. freq (Frequency first, then score)
1381
+ 3. A fully qualified class name
1382
+ -->
1383
+ <!--
1384
+ <lst name="spellchecker">
1385
+ <str name="name">freq</str>
1386
+ <str name="field">lowerfilt</str>
1387
+ <str name="spellcheckIndexDir">spellcheckerFreq</str>
1388
+ <str name="comparatorClass">freq</str>
1389
+ <str name="buildOnCommit">true</str>
1390
+ -->
1391
+
1392
+ <!-- A spellchecker that reads the list of words from a file -->
1393
+ <!--
1394
+ <lst name="spellchecker">
1395
+ <str name="classname">solr.FileBasedSpellChecker</str>
1396
+ <str name="name">file</str>
1397
+ <str name="sourceLocation">spellings.txt</str>
1398
+ <str name="characterEncoding">UTF-8</str>
1399
+ <str name="spellcheckIndexDir">spellcheckerFile</str>
1400
+ </lst>
1401
+ -->
554
1402
  </searchComponent>
555
1403
 
556
- <requestHandler name="/update" class="solr.XmlUpdateRequestHandler" />
557
- <requestHandler name="/update/javabin" class="solr.BinaryUpdateRequestHandler" />
558
- <requestHandler name="/analysis" class="solr.AnalysisRequestHandler" />
559
- <requestHandler name="/admin/" class="org.apache.solr.handler.admin.AdminHandlers" />
560
- <requestHandler name="/admin/ping" class="PingRequestHandler">
1404
+ <!-- A request handler for demonstrating the spellcheck component.
1405
+
1406
+ NOTE: This is purely as an example. The whole purpose of the
1407
+ SpellCheckComponent is to hook it into the request handler that
1408
+ handles your normal user queries so that a separate request is
1409
+ not needed to get suggestions.
1410
+
1411
+ IN OTHER WORDS, THERE IS REALLY GOOD CHANCE THE SETUP BELOW IS
1412
+ NOT WHAT YOU WANT FOR YOUR PRODUCTION SYSTEM!
1413
+
1414
+ See http://wiki.apache.org/solr/SpellCheckComponent for details
1415
+ on the request parameters.
1416
+ -->
1417
+ <requestHandler name="/spell" class="solr.SearchHandler" startup="lazy">
561
1418
  <lst name="defaults">
562
- <str name="qt">search</str>
563
- <str name="q">book</str>
564
- <str name="echoParams">all</str>
1419
+ <str name="spellcheck.onlyMorePopular">false</str>
1420
+ <str name="spellcheck.extendedResults">false</str>
1421
+ <str name="spellcheck.count">1</str>
565
1422
  </lst>
1423
+ <arr name="last-components">
1424
+ <str>spellcheck</str>
1425
+ </arr>
566
1426
  </requestHandler>
567
- <admin>
568
- <defaultQuery>book</defaultQuery>
569
- </admin>
570
1427
 
571
- <requestHandler name="/debug/dump" class="solr.DumpRequestHandler" >
1428
+ <!-- Term Vector Component
1429
+
1430
+ http://wiki.apache.org/solr/TermVectorComponent
1431
+ -->
1432
+ <searchComponent name="tvComponent" class="solr.TermVectorComponent"/>
1433
+
1434
+ <!-- A request handler for demonstrating the term vector component
1435
+
1436
+ This is purely as an example.
1437
+
1438
+ In reality you will likely want to add the component to your
1439
+ already specified request handlers.
1440
+ -->
1441
+ <requestHandler name="tvrh" class="solr.SearchHandler" startup="lazy">
572
1442
  <lst name="defaults">
573
- <str name="echoParams">explicit</str>
574
- <str name="echoHandler">true</str>
1443
+ <bool name="tv">true</bool>
575
1444
  </lst>
1445
+ <arr name="last-components">
1446
+ <str>tvComponent</str>
1447
+ </arr>
576
1448
  </requestHandler>
577
1449
 
1450
+ <!-- Clustering Component
1451
+
1452
+ http://wiki.apache.org/solr/ClusteringComponent
1453
+
1454
+ This relies on third party jars which are notincluded in the
1455
+ release. To use this component (and the "/clustering" handler)
1456
+ Those jars will need to be downloaded, and you'll need to set
1457
+ the solr.cluster.enabled system property when running solr...
1458
+
1459
+ java -Dsolr.clustering.enabled=true -jar start.jar
1460
+ -->
1461
+ <searchComponent name="clustering"
1462
+ enable="${solr.clustering.enabled:false}"
1463
+ class="solr.clustering.ClusteringComponent" >
1464
+ <!-- Declare an engine -->
1465
+ <lst name="engine">
1466
+ <!-- The name, only one can be named "default" -->
1467
+ <str name="name">default</str>
1468
+
1469
+ <!-- Class name of Carrot2 clustering algorithm.
1470
+
1471
+ Currently available algorithms are:
1472
+
1473
+ * org.carrot2.clustering.lingo.LingoClusteringAlgorithm
1474
+ * org.carrot2.clustering.stc.STCClusteringAlgorithm
1475
+ * org.carrot2.clustering.kmeans.BisectingKMeansClusteringAlgorithm
1476
+
1477
+ See http://project.carrot2.org/algorithms.html for the
1478
+ algorithm's characteristics.
1479
+ -->
1480
+ <str name="carrot.algorithm">org.carrot2.clustering.lingo.LingoClusteringAlgorithm</str>
1481
+
1482
+ <!-- Overriding values for Carrot2 default algorithm attributes.
1483
+
1484
+ For a description of all available attributes, see:
1485
+ http://download.carrot2.org/stable/manual/#chapter.components.
1486
+ Use attribute key as name attribute of str elements
1487
+ below. These can be further overridden for individual
1488
+ requests by specifying attribute key as request parameter
1489
+ name and attribute value as parameter value.
1490
+ -->
1491
+ <str name="LingoClusteringAlgorithm.desiredClusterCountBase">20</str>
1492
+
1493
+ <!-- Location of Carrot2 lexical resources.
1494
+
1495
+ A directory from which to load Carrot2-specific stop words
1496
+ and stop labels. Absolute or relative to Solr config directory.
1497
+ If a specific resource (e.g. stopwords.en) is present in the
1498
+ specified dir, it will completely override the corresponding
1499
+ default one that ships with Carrot2.
1500
+
1501
+ For an overview of Carrot2 lexical resources, see:
1502
+ http://download.carrot2.org/head/manual/#chapter.lexical-resources
1503
+ -->
1504
+ <str name="carrot.lexicalResourcesDir">clustering/carrot2</str>
1505
+
1506
+ <!-- The language to assume for the documents.
1507
+
1508
+ For a list of allowed values, see:
1509
+ http://download.carrot2.org/stable/manual/#section.attribute.lingo.MultilingualClustering.defaultLanguage
1510
+ -->
1511
+ <str name="MultilingualClustering.defaultLanguage">ENGLISH</str>
1512
+ </lst>
1513
+ <lst name="engine">
1514
+ <str name="name">stc</str>
1515
+ <str name="carrot.algorithm">org.carrot2.clustering.stc.STCClusteringAlgorithm</str>
1516
+ </lst>
1517
+ </searchComponent>
1518
+
1519
+ <!-- A request handler for demonstrating the clustering component
1520
+
1521
+ This is purely as an example.
1522
+
1523
+ In reality you will likely want to add the component to your
1524
+ already specified request handlers.
1525
+ -->
1526
+ <requestHandler name="/clustering"
1527
+ startup="lazy"
1528
+ enable="${solr.clustering.enabled:false}"
1529
+ class="solr.SearchHandler">
1530
+ <lst name="defaults">
1531
+ <bool name="clustering">true</bool>
1532
+ <str name="clustering.engine">default</str>
1533
+ <bool name="clustering.results">true</bool>
1534
+ <!-- The title field -->
1535
+ <str name="carrot.title">name</str>
1536
+ <str name="carrot.url">id</str>
1537
+ <!-- The field to cluster on -->
1538
+ <str name="carrot.snippet">features</str>
1539
+ <!-- produce summaries -->
1540
+ <bool name="carrot.produceSummary">true</bool>
1541
+ <!-- the maximum number of labels per cluster -->
1542
+ <!--<int name="carrot.numDescriptions">5</int>-->
1543
+ <!-- produce sub clusters -->
1544
+ <bool name="carrot.outputSubClusters">false</bool>
1545
+
1546
+ <str name="defType">edismax</str>
1547
+ <str name="qf">
1548
+ text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
1549
+ </str>
1550
+ <str name="q.alt">*:*</str>
1551
+ <str name="rows">10</str>
1552
+ <str name="fl">*,score</str>
1553
+ </lst>
1554
+ <arr name="last-components">
1555
+ <str>clustering</str>
1556
+ </arr>
1557
+ </requestHandler>
1558
+
1559
+ <!-- Terms Component
1560
+
1561
+ http://wiki.apache.org/solr/TermsComponent
1562
+
1563
+ A component to return terms and document frequency of those
1564
+ terms
1565
+ -->
1566
+ <searchComponent name="terms" class="solr.TermsComponent"/>
1567
+
1568
+ <!-- A request handler for demonstrating the terms component -->
1569
+ <requestHandler name="/terms" class="solr.SearchHandler" startup="lazy">
1570
+ <lst name="defaults">
1571
+ <bool name="terms">true</bool>
1572
+ </lst>
1573
+ <arr name="components">
1574
+ <str>terms</str>
1575
+ </arr>
1576
+ </requestHandler>
1577
+
1578
+
1579
+ <!-- Query Elevation Component
1580
+
1581
+ http://wiki.apache.org/solr/QueryElevationComponent
1582
+
1583
+ a search component that enables you to configure the top
1584
+ results for a given query regardless of the normal lucene
1585
+ scoring.
1586
+ -->
1587
+ <searchComponent name="elevator" class="solr.QueryElevationComponent" >
1588
+ <!-- pick a fieldType to analyze queries -->
1589
+ <str name="queryFieldType">string</str>
1590
+ <str name="config-file">elevate.xml</str>
1591
+ </searchComponent>
1592
+
1593
+ <!-- A request handler for demonstrating the elevator component -->
1594
+ <requestHandler name="/elevate" class="solr.SearchHandler" startup="lazy">
1595
+ <lst name="defaults">
1596
+ <str name="echoParams">explicit</str>
1597
+ </lst>
1598
+ <arr name="last-components">
1599
+ <str>elevator</str>
1600
+ </arr>
1601
+ </requestHandler>
1602
+
1603
+ <!-- Highlighting Component
1604
+
1605
+ http://wiki.apache.org/solr/HighlightingParameters
1606
+ -->
1607
+ <searchComponent class="solr.HighlightComponent" name="highlight">
1608
+ <highlighting>
1609
+ <!-- Configure the standard fragmenter -->
1610
+ <!-- This could most likely be commented out in the "default" case -->
1611
+ <fragmenter name="gap"
1612
+ default="true"
1613
+ class="solr.highlight.GapFragmenter">
1614
+ <lst name="defaults">
1615
+ <int name="hl.fragsize">100</int>
1616
+ </lst>
1617
+ </fragmenter>
1618
+
1619
+ <!-- A regular-expression-based fragmenter
1620
+ (for sentence extraction)
1621
+ -->
1622
+ <fragmenter name="regex"
1623
+ class="solr.highlight.RegexFragmenter">
1624
+ <lst name="defaults">
1625
+ <!-- slightly smaller fragsizes work better because of slop -->
1626
+ <int name="hl.fragsize">70</int>
1627
+ <!-- allow 50% slop on fragment sizes -->
1628
+ <float name="hl.regex.slop">0.5</float>
1629
+ <!-- a basic sentence pattern -->
1630
+ <str name="hl.regex.pattern">[-\w ,/\n\&quot;&apos;]{20,200}</str>
1631
+ </lst>
1632
+ </fragmenter>
1633
+
1634
+ <!-- Configure the standard formatter -->
1635
+ <formatter name="html"
1636
+ default="true"
1637
+ class="solr.highlight.HtmlFormatter">
1638
+ <lst name="defaults">
1639
+ <str name="hl.simple.pre"><![CDATA[<em>]]></str>
1640
+ <str name="hl.simple.post"><![CDATA[</em>]]></str>
1641
+ </lst>
1642
+ </formatter>
1643
+
1644
+ <!-- Configure the standard encoder -->
1645
+ <encoder name="html"
1646
+ class="solr.highlight.HtmlEncoder" />
1647
+
1648
+ <!-- Configure the standard fragListBuilder -->
1649
+ <fragListBuilder name="simple"
1650
+ default="true"
1651
+ class="solr.highlight.SimpleFragListBuilder"/>
1652
+
1653
+ <!-- Configure the single fragListBuilder -->
1654
+ <fragListBuilder name="single"
1655
+ class="solr.highlight.SingleFragListBuilder"/>
1656
+
1657
+ <!-- default tag FragmentsBuilder -->
1658
+ <fragmentsBuilder name="default"
1659
+ default="true"
1660
+ class="solr.highlight.ScoreOrderFragmentsBuilder">
1661
+ <!--
1662
+ <lst name="defaults">
1663
+ <str name="hl.multiValuedSeparatorChar">/</str>
1664
+ </lst>
1665
+ -->
1666
+ </fragmentsBuilder>
1667
+
1668
+ <!-- multi-colored tag FragmentsBuilder -->
1669
+ <fragmentsBuilder name="colored"
1670
+ class="solr.highlight.ScoreOrderFragmentsBuilder">
1671
+ <lst name="defaults">
1672
+ <str name="hl.tag.pre"><![CDATA[
1673
+ <b style="background:yellow">,<b style="background:lawgreen">,
1674
+ <b style="background:aquamarine">,<b style="background:magenta">,
1675
+ <b style="background:palegreen">,<b style="background:coral">,
1676
+ <b style="background:wheat">,<b style="background:khaki">,
1677
+ <b style="background:lime">,<b style="background:deepskyblue">]]></str>
1678
+ <str name="hl.tag.post"><![CDATA[</b>]]></str>
1679
+ </lst>
1680
+ </fragmentsBuilder>
1681
+
1682
+ <boundaryScanner name="default"
1683
+ default="true"
1684
+ class="solr.highlight.SimpleBoundaryScanner">
1685
+ <lst name="defaults">
1686
+ <str name="hl.bs.maxScan">10</str>
1687
+ <str name="hl.bs.chars">.,!? &#9;&#10;&#13;</str>
1688
+ </lst>
1689
+ </boundaryScanner>
1690
+
1691
+ <boundaryScanner name="breakIterator"
1692
+ class="solr.highlight.BreakIteratorBoundaryScanner">
1693
+ <lst name="defaults">
1694
+ <!-- type should be one of CHARACTER, WORD(default), LINE and SENTENCE -->
1695
+ <str name="hl.bs.type">WORD</str>
1696
+ <!-- language and country are used when constructing Locale object. -->
1697
+ <!-- And the Locale object will be used when getting instance of BreakIterator -->
1698
+ <str name="hl.bs.language">en</str>
1699
+ <str name="hl.bs.country">US</str>
1700
+ </lst>
1701
+ </boundaryScanner>
1702
+ </highlighting>
1703
+ </searchComponent>
1704
+
1705
+ <!-- Update Processors
1706
+
1707
+ Chains of Update Processor Factories for dealing with Update
1708
+ Requests can be declared, and then used by name in Update
1709
+ Request Processors
1710
+
1711
+ http://wiki.apache.org/solr/UpdateRequestProcessor
1712
+
1713
+ -->
1714
+ <!-- Deduplication
1715
+
1716
+ An example dedup update processor that creates the "id" field
1717
+ on the fly based on the hash code of some other fields. This
1718
+ example has overwriteDupes set to false since we are using the
1719
+ id field as the signatureField and Solr will maintain
1720
+ uniqueness based on that anyway.
1721
+
1722
+ -->
1723
+ <!--
1724
+ <updateRequestProcessorChain name="dedupe">
1725
+ <processor class="solr.processor.SignatureUpdateProcessorFactory">
1726
+ <bool name="enabled">true</bool>
1727
+ <str name="signatureField">id</str>
1728
+ <bool name="overwriteDupes">false</bool>
1729
+ <str name="fields">name,features,cat</str>
1730
+ <str name="signatureClass">solr.processor.Lookup3Signature</str>
1731
+ </processor>
1732
+ <processor class="solr.LogUpdateProcessorFactory" />
1733
+ <processor class="solr.RunUpdateProcessorFactory" />
1734
+ </updateRequestProcessorChain>
1735
+ -->
1736
+
1737
+ <!--
1738
+ This example update chain identifies the language of the incoming
1739
+ documents using the langid contrib. The detected language is
1740
+ written to field language_s. No field name mapping is done.
1741
+ The fields used for detection are text, title, subject and description,
1742
+ making this example suitable for detecting languages form full-text
1743
+ rich documents injected via ExtractingRequestHandler.
1744
+ See more about langId at http://wiki.apache.org/solr/LanguageDetection
1745
+ -->
1746
+ <!--
1747
+ <updateRequestProcessorChain name="langid">
1748
+ <processor class="org.apache.solr.update.processor.TikaLanguageIdentifierUpdateProcessorFactory">
1749
+ <str name="langid.fl">text,title,subject,description</str>
1750
+ <str name="langid.langField">language_s</str>
1751
+ <str name="langid.fallback">en</str>
1752
+ </processor>
1753
+ <processor class="solr.LogUpdateProcessorFactory" />
1754
+ <processor class="solr.RunUpdateProcessorFactory" />
1755
+ </updateRequestProcessorChain>
1756
+ -->
1757
+
1758
+ <!-- Response Writers
1759
+
1760
+ http://wiki.apache.org/solr/QueryResponseWriter
1761
+
1762
+ Request responses will be written using the writer specified by
1763
+ the 'wt' request parameter matching the name of a registered
1764
+ writer.
1765
+
1766
+ The "default" writer is the default and will be used if 'wt' is
1767
+ not specified in the request.
1768
+ -->
1769
+ <!-- The following response writers are implicitly configured unless
1770
+ overridden...
1771
+ -->
1772
+ <!--
1773
+ <queryResponseWriter name="xml"
1774
+ default="true"
1775
+ class="solr.XMLResponseWriter" />
1776
+ <queryResponseWriter name="json" class="solr.JSONResponseWriter"/>
1777
+ <queryResponseWriter name="python" class="solr.PythonResponseWriter"/>
1778
+ <queryResponseWriter name="ruby" class="solr.RubyResponseWriter"/>
1779
+ <queryResponseWriter name="php" class="solr.PHPResponseWriter"/>
1780
+ <queryResponseWriter name="phps" class="solr.PHPSerializedResponseWriter"/>
1781
+ <queryResponseWriter name="csv" class="solr.CSVResponseWriter"/>
1782
+ -->
1783
+
1784
+ <queryResponseWriter name="json" class="solr.JSONResponseWriter">
1785
+ <!-- For the purposes of the tutorial, JSON responses are written as
1786
+ plain text so that they are easy to read in *any* browser.
1787
+ If you expect a MIME type of "application/json" just remove this override.
1788
+ -->
1789
+ <str name="content-type">text/plain; charset=UTF-8</str>
1790
+ </queryResponseWriter>
1791
+
1792
+ <!--
1793
+ Custom response writers can be declared as needed...
1794
+ -->
1795
+ <!-- The solr.velocity.enabled flag is used by Solr's test cases so that this response writer is not
1796
+ loaded (causing an error if contrib/velocity has not been built fully) -->
1797
+ <queryResponseWriter name="velocity" class="solr.VelocityResponseWriter" enable="${solr.velocity.enabled:true}"/>
1798
+
1799
+
1800
+ <!-- XSLT response writer transforms the XML output by any xslt file found
1801
+ in Solr's conf/xslt directory. Changes to xslt files are checked for
1802
+ every xsltCacheLifetimeSeconds.
1803
+ -->
1804
+ <queryResponseWriter name="xslt" class="solr.XSLTResponseWriter">
1805
+ <int name="xsltCacheLifetimeSeconds">5</int>
1806
+ </queryResponseWriter>
1807
+
1808
+ <!-- Query Parsers
1809
+
1810
+ http://wiki.apache.org/solr/SolrQuerySyntax
1811
+
1812
+ Multiple QParserPlugins can be registered by name, and then
1813
+ used in either the "defType" param for the QueryComponent (used
1814
+ by SearchHandler) or in LocalParams
1815
+ -->
1816
+ <!-- example of registering a query parser -->
1817
+ <!--
1818
+ <queryParser name="myparser" class="com.mycompany.MyQParserPlugin"/>
1819
+ -->
1820
+
1821
+ <!-- Function Parsers
1822
+
1823
+ http://wiki.apache.org/solr/FunctionQuery
1824
+
1825
+ Multiple ValueSourceParsers can be registered by name, and then
1826
+ used as function names when using the "func" QParser.
1827
+ -->
1828
+ <!-- example of registering a custom function parser -->
1829
+ <!--
1830
+ <valueSourceParser name="myfunc"
1831
+ class="com.mycompany.MyValueSourceParser" />
1832
+ -->
1833
+
1834
+ <!-- Legacy config for the admin interface -->
1835
+ <admin>
1836
+ <defaultQuery>*:*</defaultQuery>
1837
+
1838
+ <!-- configure a healthcheck file for servers behind a
1839
+ loadbalancer
1840
+ -->
1841
+ <!--
1842
+ <healthcheck type="file">server-enabled</healthcheck>
1843
+ -->
1844
+ </admin>
1845
+
578
1846
  </config>