datastax_rails 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.rdoc +62 -0
  3. data/Rakefile +34 -0
  4. data/config/schema.xml +266 -0
  5. data/config/schema.xml.erb +70 -0
  6. data/config/solrconfig.xml +1564 -0
  7. data/config/stopwords.txt +58 -0
  8. data/lib/datastax_rails/associations/association.rb +224 -0
  9. data/lib/datastax_rails/associations/association_scope.rb +25 -0
  10. data/lib/datastax_rails/associations/belongs_to_association.rb +64 -0
  11. data/lib/datastax_rails/associations/builder/association.rb +56 -0
  12. data/lib/datastax_rails/associations/builder/belongs_to.rb +30 -0
  13. data/lib/datastax_rails/associations/builder/collection_association.rb +48 -0
  14. data/lib/datastax_rails/associations/builder/has_and_belongs_to_many.rb +36 -0
  15. data/lib/datastax_rails/associations/builder/has_many.rb +54 -0
  16. data/lib/datastax_rails/associations/builder/has_one.rb +52 -0
  17. data/lib/datastax_rails/associations/builder/singular_association.rb +56 -0
  18. data/lib/datastax_rails/associations/collection_association.rb +274 -0
  19. data/lib/datastax_rails/associations/collection_proxy.rb +118 -0
  20. data/lib/datastax_rails/associations/has_and_belongs_to_many_association.rb +44 -0
  21. data/lib/datastax_rails/associations/has_many_association.rb +58 -0
  22. data/lib/datastax_rails/associations/has_one_association.rb +68 -0
  23. data/lib/datastax_rails/associations/singular_association.rb +58 -0
  24. data/lib/datastax_rails/associations.rb +86 -0
  25. data/lib/datastax_rails/attribute_methods/definition.rb +20 -0
  26. data/lib/datastax_rails/attribute_methods/dirty.rb +43 -0
  27. data/lib/datastax_rails/attribute_methods/typecasting.rb +50 -0
  28. data/lib/datastax_rails/attribute_methods.rb +104 -0
  29. data/lib/datastax_rails/base.rb +587 -0
  30. data/lib/datastax_rails/batches.rb +35 -0
  31. data/lib/datastax_rails/callbacks.rb +37 -0
  32. data/lib/datastax_rails/collection.rb +9 -0
  33. data/lib/datastax_rails/connection.rb +21 -0
  34. data/lib/datastax_rails/consistency.rb +33 -0
  35. data/lib/datastax_rails/cql/base.rb +15 -0
  36. data/lib/datastax_rails/cql/column_family.rb +38 -0
  37. data/lib/datastax_rails/cql/consistency.rb +13 -0
  38. data/lib/datastax_rails/cql/create_column_family.rb +63 -0
  39. data/lib/datastax_rails/cql/create_keyspace.rb +30 -0
  40. data/lib/datastax_rails/cql/delete.rb +41 -0
  41. data/lib/datastax_rails/cql/drop_column_family.rb +13 -0
  42. data/lib/datastax_rails/cql/drop_keyspace.rb +13 -0
  43. data/lib/datastax_rails/cql/insert.rb +53 -0
  44. data/lib/datastax_rails/cql/select.rb +51 -0
  45. data/lib/datastax_rails/cql/truncate.rb +13 -0
  46. data/lib/datastax_rails/cql/update.rb +68 -0
  47. data/lib/datastax_rails/cql/use_keyspace.rb +13 -0
  48. data/lib/datastax_rails/cql.rb +25 -0
  49. data/lib/datastax_rails/cursor.rb +90 -0
  50. data/lib/datastax_rails/errors.rb +16 -0
  51. data/lib/datastax_rails/identity/abstract_key_factory.rb +26 -0
  52. data/lib/datastax_rails/identity/custom_key_factory.rb +36 -0
  53. data/lib/datastax_rails/identity/hashed_natural_key_factory.rb +10 -0
  54. data/lib/datastax_rails/identity/natural_key_factory.rb +37 -0
  55. data/lib/datastax_rails/identity/uuid_key_factory.rb +23 -0
  56. data/lib/datastax_rails/identity.rb +53 -0
  57. data/lib/datastax_rails/log_subscriber.rb +37 -0
  58. data/lib/datastax_rails/migrations/migration.rb +15 -0
  59. data/lib/datastax_rails/migrations.rb +36 -0
  60. data/lib/datastax_rails/mocking.rb +15 -0
  61. data/lib/datastax_rails/persistence.rb +133 -0
  62. data/lib/datastax_rails/railtie.rb +20 -0
  63. data/lib/datastax_rails/reflection.rb +472 -0
  64. data/lib/datastax_rails/relation/finder_methods.rb +184 -0
  65. data/lib/datastax_rails/relation/modification_methods.rb +80 -0
  66. data/lib/datastax_rails/relation/search_methods.rb +349 -0
  67. data/lib/datastax_rails/relation/spawn_methods.rb +107 -0
  68. data/lib/datastax_rails/relation.rb +393 -0
  69. data/lib/datastax_rails/schema/migration.rb +106 -0
  70. data/lib/datastax_rails/schema/migration_proxy.rb +25 -0
  71. data/lib/datastax_rails/schema/migrator.rb +212 -0
  72. data/lib/datastax_rails/schema.rb +37 -0
  73. data/lib/datastax_rails/scoping.rb +394 -0
  74. data/lib/datastax_rails/serialization.rb +6 -0
  75. data/lib/datastax_rails/tasks/column_family.rb +162 -0
  76. data/lib/datastax_rails/tasks/ds.rake +63 -0
  77. data/lib/datastax_rails/tasks/keyspace.rb +57 -0
  78. data/lib/datastax_rails/timestamps.rb +19 -0
  79. data/lib/datastax_rails/type.rb +16 -0
  80. data/lib/datastax_rails/types/array_type.rb +77 -0
  81. data/lib/datastax_rails/types/base_type.rb +26 -0
  82. data/lib/datastax_rails/types/binary_type.rb +15 -0
  83. data/lib/datastax_rails/types/boolean_type.rb +22 -0
  84. data/lib/datastax_rails/types/date_type.rb +17 -0
  85. data/lib/datastax_rails/types/float_type.rb +18 -0
  86. data/lib/datastax_rails/types/integer_type.rb +18 -0
  87. data/lib/datastax_rails/types/string_type.rb +16 -0
  88. data/lib/datastax_rails/types/text_type.rb +16 -0
  89. data/lib/datastax_rails/types/time_type.rb +17 -0
  90. data/lib/datastax_rails/types.rb +9 -0
  91. data/lib/datastax_rails/validations/uniqueness.rb +119 -0
  92. data/lib/datastax_rails/validations.rb +48 -0
  93. data/lib/datastax_rails/version.rb +3 -0
  94. data/lib/datastax_rails.rb +87 -0
  95. data/lib/solr_no_escape.rb +28 -0
  96. data/spec/datastax_rails/associations/belongs_to_association_spec.rb +7 -0
  97. data/spec/datastax_rails/associations/has_many_association_spec.rb +37 -0
  98. data/spec/datastax_rails/associations_spec.rb +22 -0
  99. data/spec/datastax_rails/attribute_methods_spec.rb +23 -0
  100. data/spec/datastax_rails/base_spec.rb +15 -0
  101. data/spec/datastax_rails/cql/select_spec.rb +12 -0
  102. data/spec/datastax_rails/cql/update_spec.rb +0 -0
  103. data/spec/datastax_rails/relation/finder_methods_spec.rb +54 -0
  104. data/spec/datastax_rails/relation/modification_methods_spec.rb +41 -0
  105. data/spec/datastax_rails/relation/search_methods_spec.rb +117 -0
  106. data/spec/datastax_rails/relation/spawn_methods_spec.rb +28 -0
  107. data/spec/datastax_rails/relation_spec.rb +130 -0
  108. data/spec/datastax_rails/validations/uniqueness_spec.rb +41 -0
  109. data/spec/datastax_rails_spec.rb +5 -0
  110. data/spec/dummy/Rakefile +8 -0
  111. data/spec/dummy/app/assets/javascripts/application.js +9 -0
  112. data/spec/dummy/app/assets/stylesheets/application.css +7 -0
  113. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  114. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  115. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  116. data/spec/dummy/config/application.rb +47 -0
  117. data/spec/dummy/config/boot.rb +10 -0
  118. data/spec/dummy/config/database.yml +25 -0
  119. data/spec/dummy/config/datastax.yml +18 -0
  120. data/spec/dummy/config/environment.rb +5 -0
  121. data/spec/dummy/config/environments/development.rb +30 -0
  122. data/spec/dummy/config/environments/production.rb +60 -0
  123. data/spec/dummy/config/environments/test.rb +39 -0
  124. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  125. data/spec/dummy/config/initializers/inflections.rb +10 -0
  126. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  127. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  128. data/spec/dummy/config/initializers/session_store.rb +8 -0
  129. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  130. data/spec/dummy/config/locales/en.yml +5 -0
  131. data/spec/dummy/config/routes.rb +58 -0
  132. data/spec/dummy/config/sunspot.yml +17 -0
  133. data/spec/dummy/config.ru +4 -0
  134. data/spec/dummy/ks/migrate/20111117224534_models.rb +20 -0
  135. data/spec/dummy/ks/schema.json +180 -0
  136. data/spec/dummy/log/development.log +298 -0
  137. data/spec/dummy/log/production.log +0 -0
  138. data/spec/dummy/log/test.log +20307 -0
  139. data/spec/dummy/public/404.html +26 -0
  140. data/spec/dummy/public/422.html +26 -0
  141. data/spec/dummy/public/500.html +26 -0
  142. data/spec/dummy/public/favicon.ico +0 -0
  143. data/spec/dummy/script/rails +6 -0
  144. data/spec/spec.opts +5 -0
  145. data/spec/spec_helper.rb +29 -0
  146. data/spec/support/datastax_test_hook.rb +14 -0
  147. data/spec/support/models.rb +72 -0
  148. metadata +353 -0
@@ -0,0 +1,1564 @@
1
+ <?xml version="1.0" encoding="UTF-8" ?>
2
+ <!--
3
+ Licensed to the Apache Software Foundation (ASF) under one or more
4
+ contributor license agreements. See the NOTICE file distributed with
5
+ this work for additional information regarding copyright ownership.
6
+ The ASF licenses this file to You under the Apache License, Version 2.0
7
+ (the "License"); you may not use this file except in compliance with
8
+ the License. You may obtain a copy of the License at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Unless required by applicable law or agreed to in writing, software
13
+ distributed under the License is distributed on an "AS IS" BASIS,
14
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ See the License for the specific language governing permissions and
16
+ limitations under the License.
17
+ -->
18
+
19
+ <!--
20
+ For more details about configurations options that may appear in
21
+ this file, see http://wiki.apache.org/solr/SolrConfigXml.
22
+ -->
23
+ <config>
24
+ <!-- In all configuration below, a prefix of "solr." for class names
25
+ is an alias that causes solr to search appropriate packages,
26
+ including org.apache.solr.(search|update|request|core|analysis)
27
+
28
+ You may also specify a fully qualified Java classname if you
29
+ have your own custom plugins.
30
+ -->
31
+
32
+ <!-- Set this to 'false' if you want solr to continue working after
33
+ it has encountered an severe configuration error. In a
34
+ production environment, you may want solr to keep working even
35
+ if one handler is mis-configured.
36
+
37
+ You may also set this to false using by setting the system
38
+ property:
39
+
40
+ -Dsolr.abortOnConfigurationError=false
41
+ -->
42
+ <abortOnConfigurationError>${solr.abortOnConfigurationError:true}</abortOnConfigurationError>
43
+
44
+ <!-- Controls what version of Lucene various components of Solr
45
+ adhere to. Generally, you want to use the latest version to
46
+ get all bug fixes and improvements. It is highly recommended
47
+ that you fully re-index after changing this setting as it can
48
+ affect both how text is indexed and queried.
49
+ -->
50
+ <luceneMatchVersion>LUCENE_40</luceneMatchVersion>
51
+
52
+ <!-- lib directives can be used to instruct Solr to load an Jars
53
+ identified and use them to resolve any "plugins" specified in
54
+ your solrconfig.xml or schema.xml (ie: Analyzers, Request
55
+ Handlers, etc...).
56
+
57
+ All directories and paths are resolved relative to the
58
+ instanceDir.
59
+
60
+ If a "./lib" directory exists in your instanceDir, all files
61
+ found in it are included as if you had used the following
62
+ syntax...
63
+
64
+ <lib dir="./lib" />
65
+ -->
66
+ <!-- A dir option by itself adds any files found in the directory to
67
+ the classpath, this is useful for including all jars in a
68
+ directory.
69
+ -->
70
+ <lib dir="../../contrib/extraction/lib" />
71
+ <!-- When a regex is specified in addition to a directory, only the
72
+ files in that directory which completely match the regex
73
+ (anchored on both ends) will be included.
74
+ -->
75
+ <lib dir="../../dist/" regex="apache-solr-cell-\d.*\.jar" />
76
+ <lib dir="../../dist/" regex="apache-solr-clustering-\d.*\.jar" />
77
+ <lib dir="../../dist/" regex="apache-solr-dataimporthandler-\d.*\.jar" />
78
+
79
+ <!-- If a dir option (with or without a regex) is used and nothing
80
+ is found that matches, it will be ignored
81
+ -->
82
+ <lib dir="../../contrib/clustering/lib/" />
83
+ <lib dir="/total/crap/dir/ignored" />
84
+ <!-- an exact path can be used to specify a specific file. This
85
+ will cause a serious error to be logged if it can't be loaded.
86
+ -->
87
+ <!--
88
+ <lib path="../a-jar-that-does-not-exist.jar" />
89
+ -->
90
+
91
+ <!-- Data Directory
92
+
93
+ Used to specify an alternate directory to hold all index data
94
+ other than the default ./data under the Solr home. If
95
+ replication is in use, this should match the replication
96
+ configuration.
97
+ -->
98
+ <dataDir>${solr.data.dir:}</dataDir>
99
+
100
+
101
+ <!-- The DirectoryFactory to use for indexes.
102
+
103
+ solr.StandardDirectoryFactory, the default, is filesystem
104
+ based and tries to pick the best implementation for the current
105
+ JVM and platform. One can force a particular implementation
106
+ via solr.MMapDirectoryFactory, solr.NIOFSDirectoryFactory, or
107
+ solr.SimpleFSDirectoryFactory.
108
+
109
+ solr.RAMDirectoryFactory is memory based, not
110
+ persistent, and doesn't work with replication.
111
+ -->
112
+ <directoryFactory name="DirectoryFactory"
113
+ class="${solr.directoryFactory:solr.StandardDirectoryFactory}"/>
114
+
115
+
116
+ <!-- Index Defaults
117
+
118
+ Values here affect all index writers and act as a default
119
+ unless overridden.
120
+
121
+ WARNING: See also the <mainIndex> section below for parameters
122
+ that overfor Solr's main Lucene index.
123
+ -->
124
+ <indexDefaults>
125
+
126
+ <useCompoundFile>false</useCompoundFile>
127
+
128
+ <mergeFactor>10</mergeFactor>
129
+ <!-- Sets the amount of RAM that may be used by Lucene indexing
130
+ for buffering added documents and deletions before they are
131
+ flushed to the Directory. -->
132
+ <ramBufferSizeMB>32</ramBufferSizeMB>
133
+ <!-- If both ramBufferSizeMB and maxBufferedDocs is set, then
134
+ Lucene will flush based on whichever limit is hit first.
135
+ -->
136
+ <!-- <maxBufferedDocs>1000</maxBufferedDocs> -->
137
+
138
+ <maxFieldLength>10000</maxFieldLength>
139
+ <writeLockTimeout>1000</writeLockTimeout>
140
+ <commitLockTimeout>10000</commitLockTimeout>
141
+
142
+ <!-- Expert: Merge Policy
143
+
144
+ The Merge Policy in Lucene controls how merging is handled by
145
+ Lucene. The default in Solr 3.3 is TieredMergePolicy.
146
+
147
+ The default in 2.3 was the LogByteSizeMergePolicy,
148
+ previous versions used LogDocMergePolicy.
149
+
150
+ LogByteSizeMergePolicy chooses segments to merge based on
151
+ their size. The Lucene 2.2 default, LogDocMergePolicy chose
152
+ when to merge based on number of documents
153
+
154
+ Other implementations of MergePolicy must have a no-argument
155
+ constructor
156
+ -->
157
+ <!--
158
+ <mergePolicy class="org.apache.lucene.index.TieredMergePolicy"/>
159
+ -->
160
+
161
+ <!-- Expert: Merge Scheduler
162
+
163
+ The Merge Scheduler in Lucene controls how merges are
164
+ performed. The ConcurrentMergeScheduler (Lucene 2.3 default)
165
+ can perform merges in the background using separate threads.
166
+ The SerialMergeScheduler (Lucene 2.2 default) does not.
167
+ -->
168
+ <!--
169
+ <mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"/>
170
+ -->
171
+
172
+ <!-- LockFactory
173
+
174
+ This option specifies which Lucene LockFactory implementation
175
+ to use.
176
+
177
+ single = SingleInstanceLockFactory - suggested for a
178
+ read-only index or when there is no possibility of
179
+ another process trying to modify the index.
180
+ native = NativeFSLockFactory - uses OS native file locking.
181
+ Do not use when multiple solr webapps in the same
182
+ JVM are attempting to share a single index.
183
+ simple = SimpleFSLockFactory - uses a plain file for locking
184
+
185
+ (For backwards compatibility with Solr 1.2, 'simple' is the
186
+ default if not specified.)
187
+
188
+ More details on the nuances of each LockFactory...
189
+ http://wiki.apache.org/lucene-java/AvailableLockFactories
190
+ -->
191
+ <lockType>native</lockType>
192
+
193
+ <!-- Expert: Controls how often Lucene loads terms into memory
194
+ Default is 128 and is likely good for most everyone.
195
+ -->
196
+ <!-- <termIndexInterval>256</termIndexInterval> -->
197
+ </indexDefaults>
198
+
199
+ <!-- Main Index
200
+
201
+ Values here override the values in the <indexDefaults> section
202
+ for the main on disk index.
203
+ -->
204
+ <mainIndex>
205
+
206
+ <useCompoundFile>false</useCompoundFile>
207
+ <ramBufferSizeMB>32</ramBufferSizeMB>
208
+ <mergeFactor>10</mergeFactor>
209
+
210
+ <!-- Unlock On Startup
211
+
212
+ If true, unlock any held write or commit locks on startup.
213
+ This defeats the locking mechanism that allows multiple
214
+ processes to safely access a lucene index, and should be used
215
+ with care.
216
+
217
+ This is not needed if lock type is 'none' or 'single'
218
+ -->
219
+ <unlockOnStartup>false</unlockOnStartup>
220
+
221
+ <!-- If true, IndexReaders will be reopened (often more efficient)
222
+ instead of closed and then opened.
223
+ -->
224
+ <reopenReaders>true</reopenReaders>
225
+
226
+ <!-- Commit Deletion Policy
227
+
228
+ Custom deletion policies can specified here. The class must
229
+ implement org.apache.lucene.index.IndexDeletionPolicy.
230
+
231
+ http://lucene.apache.org/java/2_9_1/api/all/org/apache/lucene/index/IndexDeletionPolicy.html
232
+
233
+ The standard Solr IndexDeletionPolicy implementation supports
234
+ deleting index commit points on number of commits, age of
235
+ commit point and optimized status.
236
+
237
+ The latest commit point should always be preserved regardless
238
+ of the criteria.
239
+ -->
240
+ <deletionPolicy class="solr.SolrDeletionPolicy">
241
+ <!-- The number of commit points to be kept -->
242
+ <str name="maxCommitsToKeep">1</str>
243
+ <!-- The number of optimized commit points to be kept -->
244
+ <str name="maxOptimizedCommitsToKeep">0</str>
245
+ <!--
246
+ Delete all commit points once they have reached the given age.
247
+ Supports DateMathParser syntax e.g.
248
+ -->
249
+ <!--
250
+ <str name="maxCommitAge">30MINUTES</str>
251
+ <str name="maxCommitAge">1DAY</str>
252
+ -->
253
+ </deletionPolicy>
254
+
255
+ <!-- Lucene Infostream
256
+
257
+ To aid in advanced debugging, Lucene provides an "InfoStream"
258
+ of detailed information when indexing.
259
+
260
+ Setting The value to true will instruct the underlying Lucene
261
+ IndexWriter to write its debugging info the specified file
262
+ -->
263
+ <infoStream file="INFOSTREAM.txt">false</infoStream>
264
+
265
+ </mainIndex>
266
+
267
+ <!-- JMX
268
+
269
+ This example enables JMX if and only if an existing MBeanServer
270
+ is found, use this if you want to configure JMX through JVM
271
+ parameters. Remove this to disable exposing Solr configuration
272
+ and statistics to JMX.
273
+
274
+ For more details see http://wiki.apache.org/solr/SolrJmx
275
+ -->
276
+ <jmx />
277
+ <!-- If you want to connect to a particular server, specify the
278
+ agentId
279
+ -->
280
+ <!-- <jmx agentId="myAgent" /> -->
281
+ <!-- If you want to start a new MBeanServer, specify the serviceUrl -->
282
+ <!-- <jmx serviceUrl="service:jmx:rmi:///jndi/rmi://localhost:9999/solr"/>
283
+ -->
284
+
285
+ <!-- The default high-performance update handler -->
286
+ <updateHandler class="solr.DirectUpdateHandler2">
287
+
288
+ <!-- AutoCommit
289
+
290
+ Perform a <commit/> automatically under certain conditions.
291
+ Instead of enabling autoCommit, consider using "commitWithin"
292
+ when adding documents.
293
+
294
+ http://wiki.apache.org/solr/UpdateXmlMessages
295
+
296
+ maxDocs - Maximum number of documents to add since the last
297
+ commit before automatically triggering a new commit.
298
+
299
+ maxTime - Maximum amount of time that is allowed to pass
300
+ since a document was added before automaticly
301
+ triggering a new commit.
302
+ -->
303
+ <autoSoftCommit>
304
+ <maxDocs>1</maxDocs>
305
+ <maxTime>1000</maxTime>
306
+ </autoSoftCommit>
307
+
308
+ <!-- Update Related Event Listeners
309
+
310
+ Various IndexWriter related events can trigger Listeners to
311
+ take actions.
312
+
313
+ postCommit - fired after every commit or optimize command
314
+ postOptimize - fired after every optimize command
315
+ -->
316
+ <!-- The RunExecutableListener executes an external command from a
317
+ hook such as postCommit or postOptimize.
318
+
319
+ exe - the name of the executable to run
320
+ dir - dir to use as the current working directory. (default=".")
321
+ wait - the calling thread waits until the executable returns.
322
+ (default="true")
323
+ args - the arguments to pass to the program. (default is none)
324
+ env - environment variables to set. (default is none)
325
+ -->
326
+ <!-- This example shows how RunExecutableListener could be used
327
+ with the script based replication...
328
+ http://wiki.apache.org/solr/CollectionDistribution
329
+ -->
330
+ <!--
331
+ <listener event="postCommit" class="solr.RunExecutableListener">
332
+ <str name="exe">solr/bin/snapshooter</str>
333
+ <str name="dir">.</str>
334
+ <bool name="wait">true</bool>
335
+ <arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
336
+ <arr name="env"> <str>MYVAR=val1</str> </arr>
337
+ </listener>
338
+ -->
339
+ </updateHandler>
340
+
341
+ <!-- IndexReaderFactory
342
+
343
+ Use the following format to specify a custom IndexReaderFactory,
344
+ which allows for alternate IndexReader implementations.
345
+
346
+ ** Experimental Feature **
347
+
348
+ Please note - Using a custom IndexReaderFactory may prevent
349
+ certain other features from working. The API to
350
+ IndexReaderFactory may change without warning or may even be
351
+ removed from future releases if the problems cannot be
352
+ resolved.
353
+
354
+
355
+ ** Features that may not work with custom IndexReaderFactory **
356
+
357
+ The ReplicationHandler assumes a disk-resident index. Using a
358
+ custom IndexReader implementation may cause incompatibility
359
+ with ReplicationHandler and may cause replication to not work
360
+ correctly. See SOLR-1366 for details.
361
+
362
+ -->
363
+ <!--
364
+ <indexReaderFactory name="IndexReaderFactory" class="package.class">
365
+ <str name="someArg">Some Value</str>
366
+ </indexReaderFactory >
367
+ -->
368
+ <!-- By explicitly declaring the Factory, the termIndexDivisor can
369
+ be specified.
370
+ -->
371
+ <!--
372
+ <indexReaderFactory name="IndexReaderFactory"
373
+ class="solr.StandardIndexReaderFactory">
374
+ <int name="setTermIndexDivisor">12</int>
375
+ </indexReaderFactory >
376
+ -->
377
+
378
+
379
+ <query>
380
+ <!-- Max Boolean Clauses
381
+
382
+ Maximum number of clauses in each BooleanQuery, an exception
383
+ is thrown if exceeded.
384
+
385
+ ** WARNING **
386
+
387
+ This option actually modifies a global Lucene property that
388
+ will affect all SolrCores. If multiple solrconfig.xml files
389
+ disagree on this property, the value at any given moment will
390
+ be based on the last SolrCore to be initialized.
391
+
392
+ -->
393
+ <maxBooleanClauses>1024</maxBooleanClauses>
394
+
395
+
396
+ <!-- Solr Internal Query Caches
397
+
398
+ There are two implementations of cache available for Solr,
399
+ LRUCache, based on a synchronized LinkedHashMap, and
400
+ FastLRUCache, based on a ConcurrentHashMap.
401
+
402
+ FastLRUCache has faster gets and slower puts in single
403
+ threaded operation and thus is generally faster than LRUCache
404
+ when the hit ratio of the cache is high (> 75%), and may be
405
+ faster under other scenarios on multi-cpu systems.
406
+ -->
407
+
408
+ <!-- Filter Cache
409
+
410
+ Cache used by SolrIndexSearcher for filters (DocSets),
411
+ unordered sets of *all* documents that match a query. When a
412
+ new searcher is opened, its caches may be prepopulated or
413
+ "autowarmed" using data from caches in the old searcher.
414
+ autowarmCount is the number of items to prepopulate. For
415
+ LRUCache, the autowarmed items will be the most recently
416
+ accessed items.
417
+
418
+ Parameters:
419
+ class - the SolrCache implementation LRUCache or
420
+ (LRUCache or FastLRUCache)
421
+ size - the maximum number of entries in the cache
422
+ initialSize - the initial capacity (number of entries) of
423
+ the cache. (see java.util.HashMap)
424
+ autowarmCount - the number of entries to prepopulate from
425
+ and old cache.
426
+ -->
427
+ <filterCache class="solr.FastLRUCache"
428
+ size="512"
429
+ initialSize="512"
430
+ autowarmCount="0"/>
431
+
432
+ <!-- Query Result Cache
433
+
434
+ Caches results of searches - ordered lists of document ids
435
+ (DocList) based on a query, a sort, and the range of documents requested.
436
+ -->
437
+ <queryResultCache class="solr.LRUCache"
438
+ size="512"
439
+ initialSize="512"
440
+ autowarmCount="0"/>
441
+
442
+ <!-- Document Cache
443
+
444
+ Caches Lucene Document objects (the stored fields for each
445
+ document). Since Lucene internal document ids are transient,
446
+ this cache will not be autowarmed.
447
+ -->
448
+ <documentCache class="solr.LRUCache"
449
+ size="512"
450
+ initialSize="512"
451
+ autowarmCount="0"/>
452
+
453
+ <!-- Field Value Cache
454
+
455
+ Cache used to hold field values that are quickly accessible
456
+ by document id. The fieldValueCache is created by default
457
+ even if not configured here.
458
+ -->
459
+ <!--
460
+ <fieldValueCache class="solr.FastLRUCache"
461
+ size="512"
462
+ autowarmCount="128"
463
+ showItems="32" />
464
+ -->
465
+
466
+ <!-- Custom Cache
467
+
468
+ Example of a generic cache. These caches may be accessed by
469
+ name through SolrIndexSearcher.getCache(),cacheLookup(), and
470
+ cacheInsert(). The purpose is to enable easy caching of
471
+ user/application level data. The regenerator argument should
472
+ be specified as an implementation of solr.CacheRegenerator
473
+ if autowarming is desired.
474
+ -->
475
+ <!--
476
+ <cache name="myUserCache"
477
+ class="solr.LRUCache"
478
+ size="4096"
479
+ initialSize="1024"
480
+ autowarmCount="1024"
481
+ regenerator="com.mycompany.MyRegenerator"
482
+ />
483
+ -->
484
+
485
+
486
+ <!-- Lazy Field Loading
487
+
488
+ If true, stored fields that are not requested will be loaded
489
+ lazily. This can result in a significant speed improvement
490
+ if the usual case is to not load all stored fields,
491
+ especially if the skipped fields are large compressed text
492
+ fields.
493
+ -->
494
+ <enableLazyFieldLoading>true</enableLazyFieldLoading>
495
+
496
+ <!-- Use Filter For Sorted Query
497
+
498
+ A possible optimization that attempts to use a filter to
499
+ satisfy a search. If the requested sort does not include
500
+ score, then the filterCache will be checked for a filter
501
+ matching the query. If found, the filter will be used as the
502
+ source of document ids, and then the sort will be applied to
503
+ that.
504
+
505
+ For most situations, this will not be useful unless you
506
+ frequently get the same search repeatedly with different sort
507
+ options, and none of them ever use "score"
508
+ -->
509
+ <!--
510
+ <useFilterForSortedQuery>true</useFilterForSortedQuery>
511
+ -->
512
+
513
+ <!-- Result Window Size
514
+
515
+ An optimization for use with the queryResultCache. When a search
516
+ is requested, a superset of the requested number of document ids
517
+ are collected. For example, if a search for a particular query
518
+ requests matching documents 10 through 19, and queryWindowSize is 50,
519
+ then documents 0 through 49 will be collected and cached. Any further
520
+ requests in that range can be satisfied via the cache.
521
+ -->
522
+ <queryResultWindowSize>20</queryResultWindowSize>
523
+
524
+ <!-- Maximum number of documents to cache for any entry in the
525
+ queryResultCache.
526
+ -->
527
+ <queryResultMaxDocsCached>200</queryResultMaxDocsCached>
528
+
529
+ <!-- Query Related Event Listeners
530
+
531
+ Various IndexSearcher related events can trigger Listeners to
532
+ take actions.
533
+
534
+ newSearcher - fired whenever a new searcher is being prepared
535
+ and there is a current searcher handling requests (aka
536
+ registered). It can be used to prime certain caches to
537
+ prevent long request times for certain requests.
538
+
539
+ firstSearcher - fired whenever a new searcher is being
540
+ prepared but there is no current registered searcher to handle
541
+ requests or to gain autowarming data from.
542
+
543
+
544
+ -->
545
+ <!-- QuerySenderListener takes an array of NamedList and executes a
546
+ local query request for each NamedList in sequence.
547
+ -->
548
+ <listener event="newSearcher" class="solr.QuerySenderListener">
549
+ <arr name="queries">
550
+ <!--
551
+ <lst><str name="q">solr</str><str name="sort">price asc</str></lst>
552
+ <lst><str name="q">rocks</str><str name="sort">weight asc</str></lst>
553
+ -->
554
+ </arr>
555
+ </listener>
556
+ <listener event="firstSearcher" class="solr.QuerySenderListener">
557
+ <arr name="queries">
558
+ <lst>
559
+ <str name="q">static firstSearcher warming in solrconfig.xml</str>
560
+ </lst>
561
+ </arr>
562
+ </listener>
563
+
564
+ <!-- Use Cold Searcher
565
+
566
+ If a search request comes in and there is no current
567
+ registered searcher, then immediately register the still
568
+ warming searcher and use it. If "false" then all requests
569
+ will block until the first searcher is done warming.
570
+ -->
571
+ <useColdSearcher>true</useColdSearcher>
572
+
573
+ <!-- Max Warming Searchers
574
+
575
+ Maximum number of searchers that may be warming in the
576
+ background concurrently. An error is returned if this limit
577
+ is exceeded.
578
+
579
+ Recommend values of 1-2 for read-only slaves, higher for
580
+ masters w/o cache warming.
581
+ -->
582
+ <maxWarmingSearchers>2</maxWarmingSearchers>
583
+
584
+ </query>
585
+
586
+
587
+ <!-- Request Dispatcher
588
+
589
+ This section contains instructions for how the SolrDispatchFilter
590
+ should behave when processing requests for this SolrCore.
591
+
592
+ handleSelect affects the behavior of requests such as /select?qt=XXX
593
+
594
+ handleSelect="true" will cause the SolrDispatchFilter to process
595
+ the request and will result in consistent error handling and
596
+ formatting for all types of requests.
597
+
598
+ handleSelect="false" will cause the SolrDispatchFilter to
599
+ ignore "/select" requests and fallback to using the legacy
600
+ SolrServlet and it's Solr 1.1 style error formatting
601
+ -->
602
+ <requestDispatcher handleSelect="true" >
603
+ <!-- Request Parsing
604
+
605
+ These settings indicate how Solr Requests may be parsed, and
606
+ what restrictions may be placed on the ContentStreams from
607
+ those requests
608
+
609
+ enableRemoteStreaming - enables use of the stream.file
610
+ and stream.url parameters for specifying remote streams.
611
+
612
+ multipartUploadLimitInKB - specifies the max size of
613
+ Multipart File Uploads that Solr will allow in a Request.
614
+
615
+ *** WARNING ***
616
+ The settings below authorize Solr to fetch remote files, You
617
+ should make sure your system has some authentication before
618
+ using enableRemoteStreaming="true"
619
+
620
+ -->
621
+ <requestParsers enableRemoteStreaming="true"
622
+ multipartUploadLimitInKB="2048000" />
623
+
624
+ <!-- HTTP Caching
625
+
626
+ Set HTTP caching related parameters (for proxy caches and clients).
627
+
628
+ The options below instruct Solr not to output any HTTP Caching
629
+ related headers
630
+ -->
631
+ <httpCaching never304="true" />
632
+ <!-- If you include a <cacheControl> directive, it will be used to
633
+ generate a Cache-Control header (as well as an Expires header
634
+ if the value contains "max-age=")
635
+
636
+ By default, no Cache-Control header is generated.
637
+
638
+ You can use the <cacheControl> option even if you have set
639
+ never304="true"
640
+ -->
641
+ <!--
642
+ <httpCaching never304="true" >
643
+ <cacheControl>max-age=30, public</cacheControl>
644
+ </httpCaching>
645
+ -->
646
+ <!-- To enable Solr to respond with automatically generated HTTP
647
+ Caching headers, and to response to Cache Validation requests
648
+ correctly, set the value of never304="false"
649
+
650
+ This will cause Solr to generate Last-Modified and ETag
651
+ headers based on the properties of the Index.
652
+
653
+ The following options can also be specified to affect the
654
+ values of these headers...
655
+
656
+ lastModFrom - the default value is "openTime" which means the
657
+ Last-Modified value (and validation against If-Modified-Since
658
+ requests) will all be relative to when the current Searcher
659
+ was opened. You can change it to lastModFrom="dirLastMod" if
660
+ you want the value to exactly correspond to when the physical
661
+ index was last modified.
662
+
663
+ etagSeed="..." is an option you can change to force the ETag
664
+ header (and validation against If-None-Match requests) to be
665
+ different even if the index has not changed (ie: when making
666
+ significant changes to your config file)
667
+
668
+ (lastModifiedFrom and etagSeed are both ignored if you use
669
+ the never304="true" option)
670
+ -->
671
+ <!--
672
+ <httpCaching lastModifiedFrom="openTime"
673
+ etagSeed="Solr">
674
+ <cacheControl>max-age=30, public</cacheControl>
675
+ </httpCaching>
676
+ -->
677
+ </requestDispatcher>
678
+
679
+ <!-- Request Handlers
680
+
681
+ http://wiki.apache.org/solr/SolrRequestHandler
682
+
683
+ incoming queries will be dispatched to the correct handler
684
+ based on the path or the qt (query type) param.
685
+
686
+ Names starting with a '/' are accessed with the a path equal to
687
+ the registered name. Names without a leading '/' are accessed
688
+ with: http://host/app/[core/]select?qt=name
689
+
690
+ If a /select request is processed with out a qt param
691
+ specified, the requestHandler that declares default="true" will
692
+ be used.
693
+
694
+ If a Request Handler is declared with startup="lazy", then it will
695
+ not be initialized until the first request that uses it.
696
+
697
+ -->
698
+ <!-- SearchHandler
699
+
700
+ http://wiki.apache.org/solr/SearchHandler
701
+
702
+ For processing Search Queries, the primary Request Handler
703
+ provided with Solr is "SearchHandler" It delegates to a sequent
704
+ of SearchComponents (see below) and supports distributed
705
+ queries across multiple shards
706
+ -->
707
+ <requestHandler name="search" class="solr.SearchHandler" default="true">
708
+ <!-- default values for query parameters can be specified, these
709
+ will be overridden by parameters in the request
710
+ -->
711
+ <lst name="defaults">
712
+ <str name="echoParams">explicit</str>
713
+ <int name="rows">10</int>
714
+ </lst>
715
+ <!-- In addition to defaults, "appends" params can be specified
716
+ to identify values which should be appended to the list of
717
+ multi-val params from the query (or the existing "defaults").
718
+ -->
719
+ <!-- In this example, the param "fq=instock:true" would be appended to
720
+ any query time fq params the user may specify, as a mechanism for
721
+ partitioning the index, independent of any user selected filtering
722
+ that may also be desired (perhaps as a result of faceted searching).
723
+
724
+ NOTE: there is *absolutely* nothing a client can do to prevent these
725
+ "appends" values from being used, so don't use this mechanism
726
+ unless you are sure you always want it.
727
+ -->
728
+ <!--
729
+ <lst name="appends">
730
+ <str name="fq">inStock:true</str>
731
+ </lst>
732
+ -->
733
+ <!-- "invariants" are a way of letting the Solr maintainer lock down
734
+ the options available to Solr clients. Any params values
735
+ specified here are used regardless of what values may be specified
736
+ in either the query, the "defaults", or the "appends" params.
737
+
738
+ In this example, the facet.field and facet.query params would
739
+ be fixed, limiting the facets clients can use. Faceting is
740
+ not turned on by default - but if the client does specify
741
+ facet=true in the request, these are the only facets they
742
+ will be able to see counts for; regardless of what other
743
+ facet.field or facet.query params they may specify.
744
+
745
+ NOTE: there is *absolutely* nothing a client can do to prevent these
746
+ "invariants" values from being used, so don't use this mechanism
747
+ unless you are sure you always want it.
748
+ -->
749
+ <!--
750
+ <lst name="invariants">
751
+ <str name="facet.field">cat</str>
752
+ <str name="facet.field">manu_exact</str>
753
+ <str name="facet.query">price:[* TO 500]</str>
754
+ <str name="facet.query">price:[500 TO *]</str>
755
+ </lst>
756
+ -->
757
+ <!-- If the default list of SearchComponents is not desired, that
758
+ list can either be overridden completely, or components can be
759
+ prepended or appended to the default list. (see below)
760
+ -->
761
+ <!--
762
+ <arr name="components">
763
+ <str>nameOfCustomComponent1</str>
764
+ <str>nameOfCustomComponent2</str>
765
+ </arr>
766
+ -->
767
+ </requestHandler>
768
+
769
+ <!-- A Robust Example
770
+
771
+ This example SearchHandler declaration shows off usage of the
772
+ SearchHandler with many defaults declared
773
+
774
+ Note that multiple instances of the same Request Handler
775
+ (SearchHandler) can be registered multiple times with different
776
+ names (and different init parameters)
777
+ -->
778
+ <requestHandler name="/browse" class="solr.SearchHandler">
779
+ <lst name="defaults">
780
+ <str name="echoParams">explicit</str>
781
+
782
+ <!-- VelocityResponseWriter settings -->
783
+ <str name="wt">velocity</str>
784
+
785
+ <str name="v.template">browse</str>
786
+ <str name="v.layout">layout</str>
787
+ <str name="title">Solritas</str>
788
+
789
+ <str name="defType">edismax</str>
790
+ <str name="q.alt">*:*</str>
791
+ <str name="rows">10</str>
792
+ <str name="fl">*,score</str>
793
+ <str name="mlt.qf">
794
+ text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
795
+ </str>
796
+ <str name="mlt.fl">text,features,name,sku,id,manu,cat</str>
797
+ <int name="mlt.count">3</int>
798
+
799
+ <str name="qf">
800
+ text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
801
+ </str>
802
+
803
+ <str name="facet">on</str>
804
+ <str name="facet.field">cat</str>
805
+ <str name="facet.field">manu_exact</str>
806
+ <str name="facet.query">ipod</str>
807
+ <str name="facet.query">GB</str>
808
+ <str name="facet.mincount">1</str>
809
+ <str name="facet.pivot">cat,inStock</str>
810
+ <str name="facet.range.other">after</str>
811
+ <str name="facet.range">price</str>
812
+ <int name="f.price.facet.range.start">0</int>
813
+ <int name="f.price.facet.range.end">600</int>
814
+ <int name="f.price.facet.range.gap">50</int>
815
+ <str name="facet.range">popularity</str>
816
+ <int name="f.popularity.facet.range.start">0</int>
817
+ <int name="f.popularity.facet.range.end">10</int>
818
+ <int name="f.popularity.facet.range.gap">3</int>
819
+ <str name="facet.range">manufacturedate_dt</str>
820
+ <str name="f.manufacturedate_dt.facet.range.start">NOW/YEAR-10YEARS</str>
821
+ <str name="f.manufacturedate_dt.facet.range.end">NOW</str>
822
+ <str name="f.manufacturedate_dt.facet.range.gap">+1YEAR</str>
823
+ <str name="f.manufacturedate_dt.facet.range.other">before</str>
824
+ <str name="f.manufacturedate_dt.facet.range.other">after</str>
825
+
826
+
827
+ <!-- Highlighting defaults -->
828
+ <str name="hl">on</str>
829
+ <str name="hl.fl">text features name</str>
830
+ <str name="f.name.hl.fragsize">0</str>
831
+ <str name="f.name.hl.alternateField">name</str>
832
+ </lst>
833
+ <arr name="last-components">
834
+ <str>spellcheck</str>
835
+ </arr>
836
+ <!--
837
+ <str name="url-scheme">httpx</str>
838
+ -->
839
+ </requestHandler>
840
+
841
+ <!-- XML Update Request Handler.
842
+
843
+ http://wiki.apache.org/solr/UpdateXmlMessages
844
+
845
+ The canonical Request Handler for Modifying the Index through
846
+ commands specified using XML.
847
+
848
+ Note: Since solr1.1 requestHandlers requires a valid content
849
+ type header if posted in the body. For example, curl now
850
+ requires: -H 'Content-type:text/xml; charset=utf-8'
851
+ -->
852
+ <requestHandler name="/update"
853
+ class="solr.XmlUpdateRequestHandler">
854
+ <!-- See below for information on defining
855
+ updateRequestProcessorChains that can be used by name
856
+ on each Update Request
857
+ -->
858
+ <!--
859
+ <lst name="defaults">
860
+ <str name="update.chain">dedupe</str>
861
+ </lst>
862
+ -->
863
+ </requestHandler>
864
+ <!-- Binary Update Request Handler
865
+ http://wiki.apache.org/solr/javabin
866
+ -->
867
+ <requestHandler name="/update/javabin"
868
+ class="solr.BinaryUpdateRequestHandler" />
869
+
870
+ <!-- CSV Update Request Handler
871
+ http://wiki.apache.org/solr/UpdateCSV
872
+ -->
873
+ <requestHandler name="/update/csv"
874
+ class="solr.CSVRequestHandler"
875
+ startup="lazy" />
876
+
877
+ <!-- JSON Update Request Handler
878
+ http://wiki.apache.org/solr/UpdateJSON
879
+ -->
880
+ <requestHandler name="/update/json"
881
+ class="solr.JsonUpdateRequestHandler"
882
+ startup="lazy" />
883
+
884
+ <!-- Solr Cell Update Request Handler
885
+
886
+ http://wiki.apache.org/solr/ExtractingRequestHandler
887
+
888
+ -->
889
+ <requestHandler name="/update/extract"
890
+ startup="lazy"
891
+ class="solr.extraction.ExtractingRequestHandler" >
892
+ <lst name="defaults">
893
+ <!-- All the main content goes into "text"... if you need to return
894
+ the extracted text or do highlighting, use a stored field. -->
895
+ <str name="fmap.content">text</str>
896
+ <str name="lowernames">true</str>
897
+ <str name="uprefix">ignored_</str>
898
+
899
+ <!-- capture link hrefs but ignore div attributes -->
900
+ <str name="captureAttr">true</str>
901
+ <str name="fmap.a">links</str>
902
+ <str name="fmap.div">ignored_</str>
903
+ </lst>
904
+ </requestHandler>
905
+
906
+ <!-- XSLT Update Request Handler
907
+ Transforms incoming XML with stylesheet identified by tr=
908
+ -->
909
+ <requestHandler name="/update/xslt"
910
+ startup="lazy"
911
+ class="solr.XsltUpdateRequestHandler"/>
912
+
913
+ <!-- Field Analysis Request Handler
914
+
915
+ RequestHandler that provides much the same functionality as
916
+ analysis.jsp. Provides the ability to specify multiple field
917
+ types and field names in the same request and outputs
918
+ index-time and query-time analysis for each of them.
919
+
920
+ Request parameters are:
921
+ analysis.fieldname - field name whose analyzers are to be used
922
+
923
+ analysis.fieldtype - field type whose analyzers are to be used
924
+ analysis.fieldvalue - text for index-time analysis
925
+ q (or analysis.q) - text for query time analysis
926
+ analysis.showmatch (true|false) - When set to true and when
927
+ query analysis is performed, the produced tokens of the
928
+ field value analysis will be marked as "matched" for every
929
+ token that is produces by the query analysis
930
+ -->
931
+ <requestHandler name="/analysis/field"
932
+ startup="lazy"
933
+ class="solr.FieldAnalysisRequestHandler" />
934
+
935
+
936
+ <!-- Document Analysis Handler
937
+
938
+ http://wiki.apache.org/solr/AnalysisRequestHandler
939
+
940
+ An analysis handler that provides a breakdown of the analysis
941
+ process of provided docuemnts. This handler expects a (single)
942
+ content stream with the following format:
943
+
944
+ <docs>
945
+ <doc>
946
+ <field name="id">1</field>
947
+ <field name="name">The Name</field>
948
+ <field name="text">The Text Value</field>
949
+ </doc>
950
+ <doc>...</doc>
951
+ <doc>...</doc>
952
+ ...
953
+ </docs>
954
+
955
+ Note: Each document must contain a field which serves as the
956
+ unique key. This key is used in the returned response to associate
957
+ an analysis breakdown to the analyzed document.
958
+
959
+ Like the FieldAnalysisRequestHandler, this handler also supports
960
+ query analysis by sending either an "analysis.query" or "q"
961
+ request parameter that holds the query text to be analyzed. It
962
+ also supports the "analysis.showmatch" parameter which when set to
963
+ true, all field tokens that match the query tokens will be marked
964
+ as a "match".
965
+ -->
966
+ <requestHandler name="/analysis/document"
967
+ class="solr.DocumentAnalysisRequestHandler"
968
+ startup="lazy" />
969
+
970
+ <!-- Admin Handlers
971
+
972
+ Admin Handlers - This will register all the standard admin
973
+ RequestHandlers.
974
+ -->
975
+ <requestHandler name="/admin/"
976
+ class="solr.admin.AdminHandlers" />
977
+ <!-- This single handler is equivalent to the following... -->
978
+ <!--
979
+ <requestHandler name="/admin/luke" class="solr.admin.LukeRequestHandler" />
980
+ <requestHandler name="/admin/system" class="solr.admin.SystemInfoHandler" />
981
+ <requestHandler name="/admin/plugins" class="solr.admin.PluginInfoHandler" />
982
+ <requestHandler name="/admin/threads" class="solr.admin.ThreadDumpHandler" />
983
+ <requestHandler name="/admin/properties" class="solr.admin.PropertiesRequestHandler" />
984
+ <requestHandler name="/admin/file" class="solr.admin.ShowFileRequestHandler" >
985
+ -->
986
+ <!-- If you wish to hide files under ${solr.home}/conf, explicitly
987
+ register the ShowFileRequestHandler using:
988
+ -->
989
+ <!--
990
+ <requestHandler name="/admin/file"
991
+ class="solr.admin.ShowFileRequestHandler" >
992
+ <lst name="invariants">
993
+ <str name="hidden">synonyms.txt</str>
994
+ <str name="hidden">anotherfile.txt</str>
995
+ </lst>
996
+ </requestHandler>
997
+ -->
998
+
999
+ <!-- ping/healthcheck -->
1000
+ <requestHandler name="/admin/ping" class="solr.PingRequestHandler">
1001
+ <lst name="invariants">
1002
+ <str name="qt">search</str>
1003
+ <str name="q">solrpingquery</str>
1004
+ </lst>
1005
+ <lst name="defaults">
1006
+ <str name="echoParams">all</str>
1007
+ </lst>
1008
+ </requestHandler>
1009
+
1010
+ <!-- Echo the request contents back to the client -->
1011
+ <requestHandler name="/debug/dump" class="solr.DumpRequestHandler" >
1012
+ <lst name="defaults">
1013
+ <str name="echoParams">explicit</str>
1014
+ <str name="echoHandler">true</str>
1015
+ </lst>
1016
+ </requestHandler>
1017
+
1018
+ <!-- Solr Replication
1019
+
1020
+ The SolrReplicationHandler supports replicating indexes from a
1021
+ "master" used for indexing and "salves" used for queries.
1022
+
1023
+ http://wiki.apache.org/solr/SolrReplication
1024
+
1025
+ In the example below, remove the <lst name="master"> section if
1026
+ this is just a slave and remove the <lst name="slave"> section
1027
+ if this is just a master.
1028
+ -->
1029
+ <!--
1030
+ <requestHandler name="/replication" class="solr.ReplicationHandler" >
1031
+ <lst name="master">
1032
+ <str name="replicateAfter">commit</str>
1033
+ <str name="replicateAfter">startup</str>
1034
+ <str name="confFiles">schema.xml,stopwords.txt</str>
1035
+ </lst>
1036
+ <lst name="slave">
1037
+ <str name="masterUrl">http://localhost:8983/solr/replication</str>
1038
+ <str name="pollInterval">00:00:60</str>
1039
+ </lst>
1040
+ </requestHandler>
1041
+ -->
1042
+
1043
+ <!-- Search Components
1044
+
1045
+ Search components are registered to SolrCore and used by
1046
+ instances of SearchHandler (which can access them by name)
1047
+
1048
+ By default, the following components are available:
1049
+
1050
+ <searchComponent name="query" class="solr.QueryComponent" />
1051
+ <searchComponent name="facet" class="solr.FacetComponent" />
1052
+ <searchComponent name="mlt" class="solr.MoreLikeThisComponent" />
1053
+ <searchComponent name="highlight" class="solr.HighlightComponent" />
1054
+ <searchComponent name="stats" class="solr.StatsComponent" />
1055
+ <searchComponent name="debug" class="solr.DebugComponent" />
1056
+
1057
+ Default configuration in a requestHandler would look like:
1058
+
1059
+ <arr name="components">
1060
+ <str>query</str>
1061
+ <str>facet</str>
1062
+ <str>mlt</str>
1063
+ <str>highlight</str>
1064
+ <str>stats</str>
1065
+ <str>debug</str>
1066
+ </arr>
1067
+
1068
+ If you register a searchComponent to one of the standard names,
1069
+ that will be used instead of the default.
1070
+
1071
+ To insert components before or after the 'standard' components, use:
1072
+
1073
+ <arr name="first-components">
1074
+ <str>myFirstComponentName</str>
1075
+ </arr>
1076
+
1077
+ <arr name="last-components">
1078
+ <str>myLastComponentName</str>
1079
+ </arr>
1080
+
1081
+ NOTE: The component registered with the name "debug" will
1082
+ always be executed after the "last-components"
1083
+
1084
+ -->
1085
+
1086
+ <!-- Spell Check
1087
+
1088
+ The spell check component can return a list of alternative spelling
1089
+ suggestions.
1090
+
1091
+ http://wiki.apache.org/solr/SpellCheckComponent
1092
+ -->
1093
+ <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
1094
+
1095
+ <str name="queryAnalyzerFieldType">textSpell</str>
1096
+
1097
+ <!-- Multiple "Spell Checkers" can be declared and used by this
1098
+ component
1099
+ -->
1100
+
1101
+ <!-- a spellchecker built from a field of the main index, and
1102
+ written to disk
1103
+ -->
1104
+ <lst name="spellchecker">
1105
+ <str name="name">default</str>
1106
+ <str name="field">name</str>
1107
+ <str name="spellcheckIndexDir">spellchecker</str>
1108
+ <!-- uncomment this to require terms to occur in 1% of the documents in order to be included in the dictionary
1109
+ <float name="thresholdTokenFrequency">.01</float>
1110
+ -->
1111
+ </lst>
1112
+
1113
+ <!-- a spellchecker that uses a different distance measure -->
1114
+ <!--
1115
+ <lst name="spellchecker">
1116
+ <str name="name">jarowinkler</str>
1117
+ <str name="field">spell</str>
1118
+ <str name="distanceMeasure">
1119
+ org.apache.lucene.search.spell.JaroWinklerDistance
1120
+ </str>
1121
+ <str name="spellcheckIndexDir">spellcheckerJaro</str>
1122
+ </lst>
1123
+ -->
1124
+
1125
+ <!-- a spellchecker that use an alternate comparator
1126
+
1127
+ comparatorClass be one of:
1128
+ 1. score (default)
1129
+ 2. freq (Frequency first, then score)
1130
+ 3. A fully qualified class name
1131
+ -->
1132
+ <!--
1133
+ <lst name="spellchecker">
1134
+ <str name="name">freq</str>
1135
+ <str name="field">lowerfilt</str>
1136
+ <str name="spellcheckIndexDir">spellcheckerFreq</str>
1137
+ <str name="comparatorClass">freq</str>
1138
+ <str name="buildOnCommit">true</str>
1139
+ -->
1140
+
1141
+ <!-- A spellchecker that reads the list of words from a file -->
1142
+ <!--
1143
+ <lst name="spellchecker">
1144
+ <str name="classname">solr.FileBasedSpellChecker</str>
1145
+ <str name="name">file</str>
1146
+ <str name="sourceLocation">spellings.txt</str>
1147
+ <str name="characterEncoding">UTF-8</str>
1148
+ <str name="spellcheckIndexDir">spellcheckerFile</str>
1149
+ </lst>
1150
+ -->
1151
+ </searchComponent>
1152
+
1153
+ <!-- A request handler for demonstrating the spellcheck component.
1154
+
1155
+ NOTE: This is purely as an example. The whole purpose of the
1156
+ SpellCheckComponent is to hook it into the request handler that
1157
+ handles your normal user queries so that a separate request is
1158
+ not needed to get suggestions.
1159
+
1160
+ IN OTHER WORDS, THERE IS REALLY GOOD CHANCE THE SETUP BELOW IS
1161
+ NOT WHAT YOU WANT FOR YOUR PRODUCTION SYSTEM!
1162
+
1163
+ See http://wiki.apache.org/solr/SpellCheckComponent for details
1164
+ on the request parameters.
1165
+ -->
1166
+ <requestHandler name="/spell" class="solr.SearchHandler" startup="lazy">
1167
+ <lst name="defaults">
1168
+ <str name="spellcheck.onlyMorePopular">false</str>
1169
+ <str name="spellcheck.extendedResults">false</str>
1170
+ <str name="spellcheck.count">1</str>
1171
+ </lst>
1172
+ <arr name="last-components">
1173
+ <str>spellcheck</str>
1174
+ </arr>
1175
+ </requestHandler>
1176
+
1177
+ <!-- Term Vector Component
1178
+
1179
+ http://wiki.apache.org/solr/TermVectorComponent
1180
+ -->
1181
+ <searchComponent name="tvComponent" class="solr.TermVectorComponent"/>
1182
+
1183
+ <!-- A request handler for demonstrating the term vector component
1184
+
1185
+ This is purely as an example.
1186
+
1187
+ In reality you will likely want to add the component to your
1188
+ already specified request handlers.
1189
+ -->
1190
+ <requestHandler name="tvrh" class="solr.SearchHandler" startup="lazy">
1191
+ <lst name="defaults">
1192
+ <bool name="tv">true</bool>
1193
+ </lst>
1194
+ <arr name="last-components">
1195
+ <str>tvComponent</str>
1196
+ </arr>
1197
+ </requestHandler>
1198
+
1199
+ <!-- Clustering Component
1200
+
1201
+ http://wiki.apache.org/solr/ClusteringComponent
1202
+
1203
+ This relies on third party jars which are notincluded in the
1204
+ release. To use this component (and the "/clustering" handler)
1205
+ Those jars will need to be downloaded, and you'll need to set
1206
+ the solr.cluster.enabled system property when running solr...
1207
+
1208
+ java -Dsolr.clustering.enabled=true -jar start.jar
1209
+ -->
1210
+ <searchComponent name="clustering"
1211
+ enable="${solr.clustering.enabled:false}"
1212
+ class="solr.clustering.ClusteringComponent" >
1213
+ <!-- Declare an engine -->
1214
+ <lst name="engine">
1215
+ <!-- The name, only one can be named "default" -->
1216
+ <str name="name">default</str>
1217
+
1218
+ <!-- Class name of Carrot2 clustering algorithm.
1219
+
1220
+ Currently available algorithms are:
1221
+
1222
+ * org.carrot2.clustering.lingo.LingoClusteringAlgorithm
1223
+ * org.carrot2.clustering.stc.STCClusteringAlgorithm
1224
+ * org.carrot2.clustering.kmeans.BisectingKMeansClusteringAlgorithm
1225
+
1226
+ See http://project.carrot2.org/algorithms.html for the
1227
+ algorithm's characteristics.
1228
+ -->
1229
+ <str name="carrot.algorithm">org.carrot2.clustering.lingo.LingoClusteringAlgorithm</str>
1230
+
1231
+ <!-- Overriding values for Carrot2 default algorithm attributes.
1232
+
1233
+ For a description of all available attributes, see:
1234
+ http://download.carrot2.org/stable/manual/#chapter.components.
1235
+ Use attribute key as name attribute of str elements
1236
+ below. These can be further overridden for individual
1237
+ requests by specifying attribute key as request parameter
1238
+ name and attribute value as parameter value.
1239
+ -->
1240
+ <str name="LingoClusteringAlgorithm.desiredClusterCountBase">20</str>
1241
+
1242
+ <!-- Location of Carrot2 lexical resources.
1243
+
1244
+ A directory from which to load Carrot2-specific stop words
1245
+ and stop labels. Absolute or relative to Solr config directory.
1246
+ If a specific resource (e.g. stopwords.en) is present in the
1247
+ specified dir, it will completely override the corresponding
1248
+ default one that ships with Carrot2.
1249
+
1250
+ For an overview of Carrot2 lexical resources, see:
1251
+ http://download.carrot2.org/head/manual/#chapter.lexical-resources
1252
+ -->
1253
+ <str name="carrot.lexicalResourcesDir">clustering/carrot2</str>
1254
+
1255
+ <!-- The language to assume for the documents.
1256
+
1257
+ For a list of allowed values, see:
1258
+ http://download.carrot2.org/stable/manual/#section.attribute.lingo.MultilingualClustering.defaultLanguage
1259
+ -->
1260
+ <str name="MultilingualClustering.defaultLanguage">ENGLISH</str>
1261
+ </lst>
1262
+ <lst name="engine">
1263
+ <str name="name">stc</str>
1264
+ <str name="carrot.algorithm">org.carrot2.clustering.stc.STCClusteringAlgorithm</str>
1265
+ </lst>
1266
+ </searchComponent>
1267
+
1268
+ <!-- A request handler for demonstrating the clustering component
1269
+
1270
+ This is purely as an example.
1271
+
1272
+ In reality you will likely want to add the component to your
1273
+ already specified request handlers.
1274
+ -->
1275
+ <requestHandler name="/clustering"
1276
+ startup="lazy"
1277
+ enable="${solr.clustering.enabled:false}"
1278
+ class="solr.SearchHandler">
1279
+ <lst name="defaults">
1280
+ <bool name="clustering">true</bool>
1281
+ <str name="clustering.engine">default</str>
1282
+ <bool name="clustering.results">true</bool>
1283
+ <!-- The title field -->
1284
+ <str name="carrot.title">name</str>
1285
+ <str name="carrot.url">id</str>
1286
+ <!-- The field to cluster on -->
1287
+ <str name="carrot.snippet">features</str>
1288
+ <!-- produce summaries -->
1289
+ <bool name="carrot.produceSummary">true</bool>
1290
+ <!-- the maximum number of labels per cluster -->
1291
+ <!--<int name="carrot.numDescriptions">5</int>-->
1292
+ <!-- produce sub clusters -->
1293
+ <bool name="carrot.outputSubClusters">false</bool>
1294
+
1295
+ <str name="defType">edismax</str>
1296
+ <str name="qf">
1297
+ text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
1298
+ </str>
1299
+ <str name="q.alt">*:*</str>
1300
+ <str name="rows">10</str>
1301
+ <str name="fl">*,score</str>
1302
+ </lst>
1303
+ <arr name="last-components">
1304
+ <str>clustering</str>
1305
+ </arr>
1306
+ </requestHandler>
1307
+
1308
+ <!-- Terms Component
1309
+
1310
+ http://wiki.apache.org/solr/TermsComponent
1311
+
1312
+ A component to return terms and document frequency of those
1313
+ terms
1314
+ -->
1315
+ <searchComponent name="terms" class="solr.TermsComponent"/>
1316
+
1317
+ <!-- A request handler for demonstrating the terms component -->
1318
+ <requestHandler name="/terms" class="solr.SearchHandler" startup="lazy">
1319
+ <lst name="defaults">
1320
+ <bool name="terms">true</bool>
1321
+ </lst>
1322
+ <arr name="components">
1323
+ <str>terms</str>
1324
+ </arr>
1325
+ </requestHandler>
1326
+
1327
+
1328
+ <!-- Query Elevation Component
1329
+
1330
+ http://wiki.apache.org/solr/QueryElevationComponent
1331
+
1332
+ a search component that enables you to configure the top
1333
+ results for a given query regardless of the normal lucene
1334
+ scoring.
1335
+ -->
1336
+ <!-- <searchComponent name="elevator" class="solr.QueryElevationComponent" >
1337
+ <str name="queryFieldType">string</str>
1338
+ <str name="config-file">elevate.xml</str>
1339
+ </searchComponent> -->
1340
+
1341
+ <!-- A request handler for demonstrating the elevator component -->
1342
+ <requestHandler name="/elevate" class="solr.SearchHandler" startup="lazy">
1343
+ <lst name="defaults">
1344
+ <str name="echoParams">explicit</str>
1345
+ </lst>
1346
+ <arr name="last-components">
1347
+ <str>elevator</str>
1348
+ </arr>
1349
+ </requestHandler>
1350
+
1351
+ <!-- Highlighting Component
1352
+
1353
+ http://wiki.apache.org/solr/HighlightingParameters
1354
+ -->
1355
+ <searchComponent class="solr.HighlightComponent" name="highlight">
1356
+ <highlighting>
1357
+ <!-- Configure the standard fragmenter -->
1358
+ <!-- This could most likely be commented out in the "default" case -->
1359
+ <fragmenter name="gap"
1360
+ default="true"
1361
+ class="solr.highlight.GapFragmenter">
1362
+ <lst name="defaults">
1363
+ <int name="hl.fragsize">100</int>
1364
+ </lst>
1365
+ </fragmenter>
1366
+
1367
+ <!-- A regular-expression-based fragmenter
1368
+ (for sentence extraction)
1369
+ -->
1370
+ <fragmenter name="regex"
1371
+ class="solr.highlight.RegexFragmenter">
1372
+ <lst name="defaults">
1373
+ <!-- slightly smaller fragsizes work better because of slop -->
1374
+ <int name="hl.fragsize">70</int>
1375
+ <!-- allow 50% slop on fragment sizes -->
1376
+ <float name="hl.regex.slop">0.5</float>
1377
+ <!-- a basic sentence pattern -->
1378
+ <str name="hl.regex.pattern">[-\w ,/\n\&quot;&apos;]{20,200}</str>
1379
+ </lst>
1380
+ </fragmenter>
1381
+
1382
+ <!-- Configure the standard formatter -->
1383
+ <formatter name="html"
1384
+ default="true"
1385
+ class="solr.highlight.HtmlFormatter">
1386
+ <lst name="defaults">
1387
+ <str name="hl.simple.pre"><![CDATA[<em>]]></str>
1388
+ <str name="hl.simple.post"><![CDATA[</em>]]></str>
1389
+ </lst>
1390
+ </formatter>
1391
+
1392
+ <!-- Configure the standard encoder -->
1393
+ <encoder name="html"
1394
+ class="solr.highlight.HtmlEncoder" />
1395
+
1396
+ <!-- Configure the standard fragListBuilder -->
1397
+ <fragListBuilder name="simple"
1398
+ default="true"
1399
+ class="solr.highlight.SimpleFragListBuilder"/>
1400
+
1401
+ <!-- Configure the single fragListBuilder -->
1402
+ <fragListBuilder name="single"
1403
+ class="solr.highlight.SingleFragListBuilder"/>
1404
+
1405
+ <!-- default tag FragmentsBuilder -->
1406
+ <fragmentsBuilder name="default"
1407
+ default="true"
1408
+ class="solr.highlight.ScoreOrderFragmentsBuilder">
1409
+ <!--
1410
+ <lst name="defaults">
1411
+ <str name="hl.multiValuedSeparatorChar">/</str>
1412
+ </lst>
1413
+ -->
1414
+ </fragmentsBuilder>
1415
+
1416
+ <!-- multi-colored tag FragmentsBuilder -->
1417
+ <fragmentsBuilder name="colored"
1418
+ class="solr.highlight.ScoreOrderFragmentsBuilder">
1419
+ <lst name="defaults">
1420
+ <str name="hl.tag.pre"><![CDATA[
1421
+ <b style="background:yellow">,<b style="background:lawgreen">,
1422
+ <b style="background:aquamarine">,<b style="background:magenta">,
1423
+ <b style="background:palegreen">,<b style="background:coral">,
1424
+ <b style="background:wheat">,<b style="background:khaki">,
1425
+ <b style="background:lime">,<b style="background:deepskyblue">]]></str>
1426
+ <str name="hl.tag.post"><![CDATA[</b>]]></str>
1427
+ </lst>
1428
+ </fragmentsBuilder>
1429
+
1430
+ <boundaryScanner name="default"
1431
+ default="true"
1432
+ class="solr.highlight.SimpleBoundaryScanner">
1433
+ <lst name="defaults">
1434
+ <str name="hl.bs.maxScan">10</str>
1435
+ <str name="hl.bs.chars">.,!? &#9;&#10;&#13;</str>
1436
+ </lst>
1437
+ </boundaryScanner>
1438
+
1439
+ <boundaryScanner name="breakIterator"
1440
+ class="solr.highlight.BreakIteratorBoundaryScanner">
1441
+ <lst name="defaults">
1442
+ <!-- type should be one of CHARACTER, WORD(default), LINE and SENTENCE -->
1443
+ <str name="hl.bs.type">WORD</str>
1444
+ <!-- language and country are used when constructing Locale object. -->
1445
+ <!-- And the Locale object will be used when getting instance of BreakIterator -->
1446
+ <str name="hl.bs.language">en</str>
1447
+ <str name="hl.bs.country">US</str>
1448
+ </lst>
1449
+ </boundaryScanner>
1450
+ </highlighting>
1451
+ </searchComponent>
1452
+
1453
+ <!-- Update Processors
1454
+
1455
+ Chains of Update Processor Factories for dealing with Update
1456
+ Requests can be declared, and then used by name in Update
1457
+ Request Processors
1458
+
1459
+ http://wiki.apache.org/solr/UpdateRequestProcessor
1460
+
1461
+ -->
1462
+ <!-- Deduplication
1463
+
1464
+ An example dedup update processor that creates the "id" field
1465
+ on the fly based on the hash code of some other fields. This
1466
+ example has overwriteDupes set to false since we are using the
1467
+ id field as the signatureField and Solr will maintain
1468
+ uniqueness based on that anyway.
1469
+
1470
+ -->
1471
+ <!--
1472
+ <updateRequestProcessorChain name="dedupe">
1473
+ <processor class="solr.processor.SignatureUpdateProcessorFactory">
1474
+ <bool name="enabled">true</bool>
1475
+ <str name="signatureField">id</str>
1476
+ <bool name="overwriteDupes">false</bool>
1477
+ <str name="fields">name,features,cat</str>
1478
+ <str name="signatureClass">solr.processor.Lookup3Signature</str>
1479
+ </processor>
1480
+ <processor class="solr.LogUpdateProcessorFactory" />
1481
+ <processor class="solr.RunUpdateProcessorFactory" />
1482
+ </updateRequestProcessorChain>
1483
+ -->
1484
+
1485
+ <!-- Response Writers
1486
+
1487
+ http://wiki.apache.org/solr/QueryResponseWriter
1488
+
1489
+ Request responses will be written using the writer specified by
1490
+ the 'wt' request parameter matching the name of a registered
1491
+ writer.
1492
+
1493
+ The "default" writer is the default and will be used if 'wt' is
1494
+ not specified in the request.
1495
+ -->
1496
+ <!-- The following response writers are implicitly configured unless
1497
+ overridden...
1498
+ -->
1499
+ <!--
1500
+ <queryResponseWriter name="xml"
1501
+ default="true"
1502
+ class="solr.XMLResponseWriter" />
1503
+ <queryResponseWriter name="json" class="solr.JSONResponseWriter"/>
1504
+ <queryResponseWriter name="python" class="solr.PythonResponseWriter"/>
1505
+ <queryResponseWriter name="ruby" class="solr.RubyResponseWriter"/>
1506
+ <queryResponseWriter name="php" class="solr.PHPResponseWriter"/>
1507
+ <queryResponseWriter name="phps" class="solr.PHPSerializedResponseWriter"/>
1508
+ <queryResponseWriter name="velocity" class="solr.VelocityResponseWriter"/>
1509
+ <queryResponseWriter name="csv" class="solr.CSVResponseWriter"/>
1510
+ -->
1511
+ <!--
1512
+ Custom response writers can be declared as needed...
1513
+ -->
1514
+ <!--
1515
+ <queryResponseWriter name="custom" class="com.example.MyResponseWriter"/>
1516
+ -->
1517
+
1518
+ <!-- XSLT response writer transforms the XML output by any xslt file found
1519
+ in Solr's conf/xslt directory. Changes to xslt files are checked for
1520
+ every xsltCacheLifetimeSeconds.
1521
+ -->
1522
+ <queryResponseWriter name="xslt" class="solr.XSLTResponseWriter">
1523
+ <int name="xsltCacheLifetimeSeconds">5</int>
1524
+ </queryResponseWriter>
1525
+
1526
+ <!-- Query Parsers
1527
+
1528
+ http://wiki.apache.org/solr/SolrQuerySyntax
1529
+
1530
+ Multiple QParserPlugins can be registered by name, and then
1531
+ used in either the "defType" param for the QueryComponent (used
1532
+ by SearchHandler) or in LocalParams
1533
+ -->
1534
+ <!-- example of registering a query parser -->
1535
+ <!--
1536
+ <queryParser name="myparser" class="com.mycompany.MyQParserPlugin"/>
1537
+ -->
1538
+
1539
+ <!-- Function Parsers
1540
+
1541
+ http://wiki.apache.org/solr/FunctionQuery
1542
+
1543
+ Multiple ValueSourceParsers can be registered by name, and then
1544
+ used as function names when using the "func" QParser.
1545
+ -->
1546
+ <!-- example of registering a custom function parser -->
1547
+ <!--
1548
+ <valueSourceParser name="myfunc"
1549
+ class="com.mycompany.MyValueSourceParser" />
1550
+ -->
1551
+
1552
+ <!-- Legacy config for the admin interface -->
1553
+ <admin>
1554
+ <defaultQuery>*:*</defaultQuery>
1555
+
1556
+ <!-- configure a healthcheck file for servers behind a
1557
+ loadbalancer
1558
+ -->
1559
+ <!--
1560
+ <healthcheck type="file">server-enabled</healthcheck>
1561
+ -->
1562
+ </admin>
1563
+
1564
+ </config>