solr_makr 0.0.4 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/.agignore +1 -0
  3. data/README.md +24 -2
  4. data/Rakefile +1 -1
  5. data/bin/console +13 -0
  6. data/exe/solr-makr +9 -0
  7. data/lib/solr_makr.rb +76 -23
  8. data/lib/solr_makr/application.rb +24 -44
  9. data/lib/solr_makr/application_action.rb +182 -0
  10. data/lib/solr_makr/application_dispatch.rb +85 -0
  11. data/lib/solr_makr/collection.rb +17 -0
  12. data/lib/solr_makr/commands.rb +14 -0
  13. data/lib/solr_makr/commands/abstract_command.rb +60 -0
  14. data/lib/solr_makr/commands/buffer.rb +98 -0
  15. data/lib/solr_makr/commands/create_collection.rb +57 -0
  16. data/lib/solr_makr/commands/delete_collection.rb +13 -0
  17. data/lib/solr_makr/commands/execute.rb +67 -0
  18. data/lib/solr_makr/commands/fetch_collection_list.rb +17 -0
  19. data/lib/solr_makr/commands/push_config.rb +36 -0
  20. data/lib/solr_makr/commands/reload_collection.rb +13 -0
  21. data/lib/solr_makr/commands/set_up_local_configuration.rb +27 -0
  22. data/lib/solr_makr/commands/write_yaml.rb +28 -19
  23. data/lib/solr_makr/configsets.rb +15 -0
  24. data/lib/solr_makr/configsets/directory.rb +32 -0
  25. data/lib/solr_makr/configsets/get_nodes.rb +33 -0
  26. data/lib/solr_makr/configsets/install_default.rb +17 -0
  27. data/lib/solr_makr/configsets/lookup_dependent_collections.rb +20 -0
  28. data/lib/solr_makr/configsets/node.rb +56 -0
  29. data/lib/solr_makr/configsets/push_to_zookeeper.rb +19 -0
  30. data/lib/solr_makr/configsets/remote.rb +30 -0
  31. data/lib/solr_makr/configuration.rb +45 -0
  32. data/lib/solr_makr/errors/halt_execution.rb +4 -0
  33. data/lib/solr_makr/files/default-configset/README.md +1 -0
  34. data/lib/solr_makr/files/default-configset/conf/_rest_managed.json +1 -0
  35. data/lib/solr_makr/files/default-configset/conf/admin-extra.html +31 -0
  36. data/lib/solr_makr/files/default-configset/conf/currency.xml +67 -0
  37. data/lib/solr_makr/files/default-configset/conf/elevate.xml +1672 -0
  38. data/lib/solr_makr/files/default-configset/conf/lang/stopwords_en.txt +54 -0
  39. data/lib/solr_makr/files/default-configset/conf/mapping-ISOLatin1Accent.txt +2586 -0
  40. data/lib/solr_makr/files/default-configset/conf/protwords.txt +1613 -0
  41. data/lib/{files → solr_makr/files/default-configset/conf}/schema.xml +132 -40
  42. data/lib/solr_makr/files/default-configset/conf/scripts.conf +1623 -0
  43. data/lib/{files → solr_makr/files/default-configset/conf}/solrconfig.xml +294 -328
  44. data/lib/solr_makr/files/default-configset/conf/spellings.txt +1534 -0
  45. data/lib/solr_makr/files/default-configset/conf/synonyms.txt +1646 -0
  46. data/lib/solr_makr/local_configuration.rb +42 -0
  47. data/lib/solr_makr/local_configuration/cache.rb +21 -0
  48. data/lib/solr_makr/local_configuration/config_directory.rb +17 -0
  49. data/lib/solr_makr/local_configuration/directory.rb +17 -0
  50. data/lib/solr_makr/local_configuration/helper.rb +19 -0
  51. data/lib/solr_makr/local_configuration/save_settings.rb +9 -0
  52. data/lib/solr_makr/local_configuration/settings.rb +50 -0
  53. data/lib/solr_makr/meta/abstract_runner.rb +36 -0
  54. data/lib/solr_makr/meta/application_logger.rb +13 -0
  55. data/lib/solr_makr/meta/buffer_interaction.rb +41 -0
  56. data/lib/solr_makr/meta/disable_paging.rb +6 -0
  57. data/lib/solr_makr/meta/has_solr_attributes.rb +13 -0
  58. data/lib/solr_makr/meta/indifferent_options.rb +13 -0
  59. data/lib/solr_makr/meta/option_definition.rb +105 -0
  60. data/lib/solr_makr/meta/option_mapping.rb +38 -0
  61. data/lib/solr_makr/meta/pathlike.rb +9 -0
  62. data/lib/solr_makr/meta/set_global_options.rb +23 -0
  63. data/lib/solr_makr/meta/utility.rb +99 -0
  64. data/lib/solr_makr/meta/wraps_directory.rb +27 -0
  65. data/lib/solr_makr/meta/wraps_path.rb +18 -0
  66. data/lib/solr_makr/solr_api.rb +12 -0
  67. data/lib/solr_makr/solr_api/client.rb +32 -0
  68. data/lib/solr_makr/solr_api/client_macros.rb +61 -0
  69. data/lib/solr_makr/solr_api/cluster_response.rb +21 -0
  70. data/lib/solr_makr/solr_api/endpoint.rb +15 -0
  71. data/lib/solr_makr/solr_api/list_response.rb +19 -0
  72. data/lib/solr_makr/solr_api/request_params.rb +50 -0
  73. data/lib/solr_makr/solr_api/response.rb +69 -0
  74. data/lib/solr_makr/sunspot_configuration.rb +49 -0
  75. data/lib/solr_makr/version.rb +1 -1
  76. data/solr_makr.gemspec +17 -9
  77. metadata +171 -31
  78. data/bin/solr-makr +0 -7
  79. data/lib/solr_makr/commands/create_core.rb +0 -21
  80. data/lib/solr_makr/commands/destroy_core.rb +0 -17
  81. data/lib/solr_makr/commands/list_cores.rb +0 -17
  82. data/lib/solr_makr/commands/shared.rb +0 -84
  83. data/lib/solr_makr/core.rb +0 -94
  84. data/lib/solr_makr/core_status.rb +0 -56
  85. data/lib/solr_makr/solr_configuration.rb +0 -84
  86. data/lib/solr_makr/solr_request.rb +0 -23
@@ -16,9 +16,9 @@
16
16
  limitations under the License.
17
17
  -->
18
18
 
19
- <!--
19
+ <!--
20
20
  For more details about configurations options that may appear in
21
- this file, see http://wiki.apache.org/solr/SolrConfigXml.
21
+ this file, see http://wiki.apache.org/solr/SolrConfigXml.
22
22
  -->
23
23
  <config>
24
24
  <!-- In all configuration below, a prefix of "solr." for class names
@@ -35,33 +35,20 @@
35
35
  that you fully re-index after changing this setting as it can
36
36
  affect both how text is indexed and queried.
37
37
  -->
38
- <luceneMatchVersion>LUCENE_41</luceneMatchVersion>
39
-
40
- <!-- <lib/> directives can be used to instruct Solr to load an Jars
41
- identified and use them to resolve any "plugins" specified in
42
- your solrconfig.xml or schema.xml (ie: Analyzers, Request
43
- Handlers, etc...).
44
-
45
- All directories and paths are resolved relative to the
46
- instanceDir.
47
-
48
- Please note that <lib/> directives are processed in the order
49
- that they appear in your solrconfig.xml file, and are "stacked"
50
- on top of each other when building a ClassLoader - so if you have
51
- plugin jars with dependencies on other jars, the "lower level"
52
- dependency jars should be loaded first.
53
-
54
- If a "./lib" directory exists in your instanceDir, all files
55
- found in it are included as if you had used the following
56
- syntax...
57
-
58
- <lib dir="./lib" />
38
+ <luceneMatchVersion>5.0.0</luceneMatchVersion>
39
+
40
+ <!-- Data Directory
41
+
42
+ Used to specify an alternate directory to hold all index data
43
+ other than the default ./data under the Solr home. If
44
+ replication is in use, this should match the replication
45
+ configuration.
59
46
  -->
60
47
  <dataDir>${solr.data.dir:}</dataDir>
61
48
 
62
49
 
63
50
  <!-- The DirectoryFactory to use for indexes.
64
-
51
+
65
52
  solr.StandardDirectoryFactory is filesystem
66
53
  based and tries to pick the best implementation for the current
67
54
  JVM and platform. solr.NRTCachingDirectoryFactory, the default,
@@ -74,57 +61,85 @@
74
61
  solr.RAMDirectoryFactory is memory based, not
75
62
  persistent, and doesn't work with replication.
76
63
  -->
77
- <directoryFactory name="DirectoryFactory"
78
- class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}"/>
64
+ <directoryFactory name="DirectoryFactory"
65
+ class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}">
66
+ </directoryFactory>
67
+
68
+ <!-- The CodecFactory for defining the format of the inverted index.
69
+ The default implementation is SchemaCodecFactory, which is the official Lucene
70
+ index format, but hooks into the schema to provide per-field customization of
71
+ the postings lists and per-document values in the fieldType element
72
+ (postingsFormat/docValuesFormat). Note that most of the alternative implementations
73
+ are experimental, so if you choose to customize the index format, it's a good
74
+ idea to convert back to the official format e.g. via IndexWriter.addIndexes(IndexReader)
75
+ before upgrading to a newer version to avoid unnecessary reindexing.
76
+ -->
77
+ <codecFactory class="solr.SchemaCodecFactory"/>
78
+
79
+ <schemaFactory class="ClassicIndexSchemaFactory"/>
79
80
 
80
81
  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
81
82
  Index Config - These settings control low-level behavior of indexing
82
83
  Most example settings here show the default value, but are commented
83
84
  out, to more easily see where customizations have been made.
84
-
85
+
85
86
  Note: This replaces <indexDefaults> and <mainIndex> from older versions
86
87
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
87
88
  <indexConfig>
88
- <!-- maxFieldLength was removed in 4.0. To get similar behavior, include a
89
- LimitTokenCountFilterFactory in your fieldType definition. E.g.
90
- <filter class="solr.LimitTokenCountFilterFactory" maxTokenCount="10000"/>
89
+
90
+ <!-- LockFactory
91
+
92
+ This option specifies which Lucene LockFactory implementation
93
+ to use.
94
+
95
+ single = SingleInstanceLockFactory - suggested for a
96
+ read-only index or when there is no possibility of
97
+ another process trying to modify the index.
98
+ native = NativeFSLockFactory - uses OS native file locking.
99
+ Do not use when multiple solr webapps in the same
100
+ JVM are attempting to share a single index.
101
+ simple = SimpleFSLockFactory - uses a plain file for locking
102
+
103
+ Defaults: 'native' is default for Solr3.6 and later, otherwise
104
+ 'simple' is the default
105
+
106
+ More details on the nuances of each LockFactory...
107
+ http://wiki.apache.org/lucene-java/AvailableLockFactories
91
108
  -->
92
- <!-- Maximum time to wait for a write lock (ms) for an IndexWriter. Default: 1000 -->
93
- <!-- <writeLockTimeout>1000</writeLockTimeout> -->
94
-
95
- <!-- The maximum number of simultaneous threads that may be
96
- indexing documents at once in IndexWriter; if more than this
97
- many threads arrive they will wait for others to finish.
98
- Default in Solr/Lucene is 8. -->
99
- <maxIndexingThreads>2</maxIndexingThreads>
100
-
101
- <useCompoundFile>true</useCompoundFile>
102
-
103
- <!-- ramBufferSizeMB sets the amount of RAM that may be used by Lucene
104
- indexing for buffering added documents and deletions before they are
105
- flushed to the Directory.
106
- maxBufferedDocs sets a limit on the number of documents buffered
107
- before flushing.
108
- If both ramBufferSizeMB and maxBufferedDocs is set, then
109
- Lucene will flush based on whichever limit is hit first. -->
110
- <ramBufferSizeMB>20</ramBufferSizeMB> -->
111
- <maxBufferedDocs>10000</maxBufferedDocs>
112
-
113
- <!-- Expert: Merge Policy
114
- The Merge Policy in Lucene controls how merging of segments is done.
115
- The default since Solr/Lucene 3.3 is TieredMergePolicy.
116
- The default since Lucene 2.3 was the LogByteSizeMergePolicy,
117
- Even older versions of Lucene used LogDocMergePolicy.
109
+ <lockType>${solr.lock.type:native}</lockType>
110
+
111
+ <!-- Lucene Infostream
112
+
113
+ To aid in advanced debugging, Lucene provides an "InfoStream"
114
+ of detailed information when indexing.
115
+
116
+ Setting the value to true will instruct the underlying Lucene
117
+ IndexWriter to write its info stream to solr's log. By default,
118
+ this is enabled here, and controlled through log4j.properties.
118
119
  -->
119
- <mergePolicy class="org.apache.lucene.index.TieredMergePolicy">
120
- <int name="maxMergeAtOnce">4</int>
121
- <int name="segmentsPerTier">4</int>
122
- </mergePolicy>
123
-
124
- <unlockOnStartup>true</unlockOnStartup>
125
-
120
+ <infoStream>true</infoStream>
126
121
  </indexConfig>
127
122
 
123
+
124
+ <!-- JMX
125
+
126
+ This example enables JMX if and only if an existing MBeanServer
127
+ is found, use this if you want to configure JMX through JVM
128
+ parameters. Remove this to disable exposing Solr configuration
129
+ and statistics to JMX.
130
+
131
+ For more details see http://wiki.apache.org/solr/SolrJmx
132
+ -->
133
+ <jmx />
134
+ <!-- If you want to connect to a particular server, specify the
135
+ agentId
136
+ -->
137
+ <!-- <jmx agentId="myAgent" /> -->
138
+ <!-- If you want to start a new MBeanServer, specify the serviceUrl -->
139
+ <!-- <jmx serviceUrl="service:jmx:rmi:///jndi/rmi://localhost:9999/solr"/>
140
+ -->
141
+
142
+ <!-- The default high-performance update handler -->
128
143
  <updateHandler class="solr.DirectUpdateHandler2">
129
144
 
130
145
  <!-- Enables a transaction log, used for real-time get, durability, and
@@ -132,22 +147,66 @@
132
147
  uncommitted changes to the index, so use of a hard autoCommit
133
148
  is recommended (see below).
134
149
  "dir" - the target directory for transaction logs, defaults to the
135
- solr data directory. -->
150
+ solr data directory. -->
136
151
  <updateLog>
137
152
  <str name="dir">${solr.ulog.dir:}</str>
138
153
  </updateLog>
139
154
 
140
- <autoCommit>
141
- <maxTime>15000</maxTime>
142
- <openSearcher>false</openSearcher>
155
+ <!-- AutoCommit
156
+
157
+ Perform a hard commit automatically under certain conditions.
158
+ Instead of enabling autoCommit, consider using "commitWithin"
159
+ when adding documents.
160
+
161
+ http://wiki.apache.org/solr/UpdateXmlMessages
162
+
163
+ maxDocs - Maximum number of documents to add since the last
164
+ commit before automatically triggering a new commit.
165
+
166
+ maxTime - Maximum amount of time in ms that is allowed to pass
167
+ since a document was added before automatically
168
+ triggering a new commit.
169
+ openSearcher - if false, the commit causes recent index changes
170
+ to be flushed to stable storage, but does not cause a new
171
+ searcher to be opened to make those changes visible.
172
+
173
+ If the updateLog is enabled, then it's highly recommended to
174
+ have some sort of hard autoCommit to limit the log size.
175
+ -->
176
+ <autoCommit>
177
+ <maxTime>15000</maxTime>
178
+ <maxDocs>25</maxDocs>
179
+ <openSearcher>true</openSearcher>
143
180
  </autoCommit>
144
181
 
145
- <autoSoftCommit>
146
- <maxTime>5000</maxTime>
182
+ <!-- softAutoCommit is like autoCommit except it causes a
183
+ 'soft' commit which only ensures that changes are visible
184
+ but does not ensure that data is synced to disk. This is
185
+ faster and more near-realtime friendly than a hard commit.
186
+ -->
187
+ <autoSoftCommit>
188
+ <maxTime>1000</maxTime>
147
189
  </autoSoftCommit>
190
+
148
191
  </updateHandler>
149
192
 
193
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
194
+ Query section - these settings control query time things like caches
195
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
150
196
  <query>
197
+ <!-- Max Boolean Clauses
198
+
199
+ Maximum number of clauses in each BooleanQuery, an exception
200
+ is thrown if exceeded.
201
+
202
+ ** WARNING **
203
+
204
+ This option actually modifies a global Lucene property that
205
+ will affect all SolrCores. If multiple solrconfig.xml files
206
+ disagree on this property, the value at any given moment will
207
+ be based on the last SolrCore to be initialized.
208
+
209
+ -->
151
210
  <maxBooleanClauses>1024</maxBooleanClauses>
152
211
 
153
212
 
@@ -155,7 +214,7 @@
155
214
 
156
215
  There are two implementations of cache available for Solr,
157
216
  LRUCache, based on a synchronized LinkedHashMap, and
158
- FastLRUCache, based on a ConcurrentHashMap.
217
+ FastLRUCache, based on a ConcurrentHashMap.
159
218
 
160
219
  FastLRUCache has faster gets and slower puts in single
161
220
  threaded operation and thus is generally faster than LRUCache
@@ -180,7 +239,7 @@
180
239
  initialSize - the initial capacity (number of entries) of
181
240
  the cache. (see java.util.HashMap)
182
241
  autowarmCount - the number of entries to prepopulate from
183
- and old cache.
242
+ and old cache.
184
243
  -->
185
244
  <filterCache class="solr.FastLRUCache"
186
245
  size="512"
@@ -188,26 +247,34 @@
188
247
  autowarmCount="0"/>
189
248
 
190
249
  <!-- Query Result Cache
191
-
250
+
192
251
  Caches results of searches - ordered lists of document ids
193
- (DocList) based on a query, a sort, and the range of documents requested.
252
+ (DocList) based on a query, a sort, and the range of documents requested.
194
253
  -->
195
254
  <queryResultCache class="solr.LRUCache"
196
255
  size="512"
197
256
  initialSize="512"
198
257
  autowarmCount="0"/>
199
-
258
+
200
259
  <!-- Document Cache
201
260
 
202
261
  Caches Lucene Document objects (the stored fields for each
203
262
  document). Since Lucene internal document ids are transient,
204
- this cache will not be autowarmed.
263
+ this cache will not be autowarmed.
205
264
  -->
206
265
  <documentCache class="solr.LRUCache"
207
266
  size="512"
208
267
  initialSize="512"
209
268
  autowarmCount="0"/>
210
269
 
270
+ <!-- custom cache currently used by block join -->
271
+ <cache name="perSegFilter"
272
+ class="solr.search.LRUCache"
273
+ size="10"
274
+ initialSize="0"
275
+ autowarmCount="10"
276
+ regenerator="solr.NoOpRegenerator" />
277
+
211
278
  <!-- Lazy Field Loading
212
279
 
213
280
  If true, stored fields that are not requested will be loaded
@@ -218,23 +285,6 @@
218
285
  -->
219
286
  <enableLazyFieldLoading>true</enableLazyFieldLoading>
220
287
 
221
- <!-- Use Filter For Sorted Query
222
-
223
- A possible optimization that attempts to use a filter to
224
- satisfy a search. If the requested sort does not include
225
- score, then the filterCache will be checked for a filter
226
- matching the query. If found, the filter will be used as the
227
- source of document ids, and then the sort will be applied to
228
- that.
229
-
230
- For most situations, this will not be useful unless you
231
- frequently get the same search repeatedly with different sort
232
- options, and none of them ever use "score"
233
- -->
234
- <!--
235
- <useFilterForSortedQuery>true</useFilterForSortedQuery>
236
- -->
237
-
238
288
  <!-- Result Window Size
239
289
 
240
290
  An optimization for use with the queryResultCache. When a search
@@ -242,32 +292,15 @@
242
292
  are collected. For example, if a search for a particular query
243
293
  requests matching documents 10 through 19, and queryWindowSize is 50,
244
294
  then documents 0 through 49 will be collected and cached. Any further
245
- requests in that range can be satisfied via the cache.
295
+ requests in that range can be satisfied via the cache.
246
296
  -->
247
297
  <queryResultWindowSize>20</queryResultWindowSize>
248
298
 
249
299
  <!-- Maximum number of documents to cache for any entry in the
250
- queryResultCache.
300
+ queryResultCache.
251
301
  -->
252
302
  <queryResultMaxDocsCached>200</queryResultMaxDocsCached>
253
303
 
254
- <!-- Query Related Event Listeners
255
-
256
- Various IndexSearcher related events can trigger Listeners to
257
- take actions.
258
-
259
- newSearcher - fired whenever a new searcher is being prepared
260
- and there is a current searcher handling requests (aka
261
- registered). It can be used to prime certain caches to
262
- prevent long request times for certain requests.
263
-
264
- firstSearcher - fired whenever a new searcher is being
265
- prepared but there is no current registered searcher to handle
266
- requests or to gain autowarming data from.
267
-
268
-
269
- -->
270
-
271
304
  <!-- Use Cold Searcher
272
305
 
273
306
  If a search request comes in and there is no current
@@ -278,7 +311,7 @@
278
311
  <useColdSearcher>false</useColdSearcher>
279
312
 
280
313
  <!-- Max Warming Searchers
281
-
314
+
282
315
  Maximum number of searchers that may be warming in the
283
316
  background concurrently. An error is returned if this limit
284
317
  is exceeded.
@@ -286,7 +319,7 @@
286
319
  Recommend values of 1-2 for read-only slaves, higher for
287
320
  masters w/o cache warming.
288
321
  -->
289
- <maxWarmingSearchers>5</maxWarmingSearchers>
322
+ <maxWarmingSearchers>2</maxWarmingSearchers>
290
323
 
291
324
  </query>
292
325
 
@@ -300,7 +333,7 @@
300
333
  such as /select?qt=XXX
301
334
 
302
335
  handleSelect="true" will cause the SolrDispatchFilter to process
303
- the request and dispatch the query to a handler specified by the
336
+ the request and dispatch the query to a handler specified by the
304
337
  "qt" param, assuming "/select" isn't already registered.
305
338
 
306
339
  handleSelect="false" will cause the SolrDispatchFilter to
@@ -322,18 +355,29 @@
322
355
 
323
356
  multipartUploadLimitInKB - specifies the max size (in KiB) of
324
357
  Multipart File Uploads that Solr will allow in a Request.
325
-
358
+
326
359
  formdataUploadLimitInKB - specifies the max size (in KiB) of
327
360
  form data (application/x-www-form-urlencoded) sent via
328
361
  POST. You can use POST to pass request parameters not
329
362
  fitting into the URL.
330
-
363
+
364
+ addHttpRequestToContext - if set to true, it will instruct
365
+ the requestParsers to include the original HttpServletRequest
366
+ object in the context map of the SolrQueryRequest under the
367
+ key "httpRequest". It will not be used by any of the existing
368
+ Solr components, but may be useful when developing custom
369
+ plugins.
370
+
331
371
  *** WARNING ***
332
372
  The settings below authorize Solr to fetch remote files, You
333
373
  should make sure your system has some authentication before
334
374
  using enableRemoteStreaming="true"
335
375
 
336
- -->
376
+ -->
377
+ <requestParsers enableRemoteStreaming="true"
378
+ multipartUploadLimitInKB="2048000"
379
+ formdataUploadLimitInKB="2048"
380
+ addHttpRequestToContext="false"/>
337
381
 
338
382
  <!-- HTTP Caching
339
383
 
@@ -343,54 +387,10 @@
343
387
  related headers
344
388
  -->
345
389
  <httpCaching never304="true" />
346
- <!-- If you include a <cacheControl> directive, it will be used to
347
- generate a Cache-Control header (as well as an Expires header
348
- if the value contains "max-age=")
349
-
350
- By default, no Cache-Control header is generated.
351
-
352
- You can use the <cacheControl> option even if you have set
353
- never304="true"
354
- -->
355
- <!--
356
- <httpCaching never304="true" >
357
- <cacheControl>max-age=30, public</cacheControl>
358
- </httpCaching>
359
- -->
360
- <!-- To enable Solr to respond with automatically generated HTTP
361
- Caching headers, and to response to Cache Validation requests
362
- correctly, set the value of never304="false"
363
-
364
- This will cause Solr to generate Last-Modified and ETag
365
- headers based on the properties of the Index.
366
-
367
- The following options can also be specified to affect the
368
- values of these headers...
369
-
370
- lastModFrom - the default value is "openTime" which means the
371
- Last-Modified value (and validation against If-Modified-Since
372
- requests) will all be relative to when the current Searcher
373
- was opened. You can change it to lastModFrom="dirLastMod" if
374
- you want the value to exactly correspond to when the physical
375
- index was last modified.
376
-
377
- etagSeed="..." is an option you can change to force the ETag
378
- header (and validation against If-None-Match requests) to be
379
- different even if the index has not changed (ie: when making
380
- significant changes to your config file)
381
-
382
- (lastModifiedFrom and etagSeed are both ignored if you use
383
- the never304="true" option)
384
- -->
385
- <!--
386
- <httpCaching lastModifiedFrom="openTime"
387
- etagSeed="Solr">
388
- <cacheControl>max-age=30, public</cacheControl>
389
- </httpCaching>
390
- -->
390
+
391
391
  </requestDispatcher>
392
392
 
393
- <!-- Request Handlers
393
+ <!-- Request Handlers
394
394
 
395
395
  http://wiki.apache.org/solr/SolrRequestHandler
396
396
 
@@ -419,6 +419,11 @@
419
419
  queries across multiple shards
420
420
  -->
421
421
  <requestHandler name="/select" class="solr.SearchHandler">
422
+ <lst name="defaults">
423
+ <str name="spellcheck.dictionary">default</str>
424
+ <str name="spellcheck.extendedResults">true</str>
425
+ <str name="spellcheck.collate">true</str>
426
+ </lst>
422
427
  <arr name="last-components">
423
428
  <str>spellcheck</str>
424
429
  </arr>
@@ -434,78 +439,97 @@
434
439
  </lst>
435
440
  <arr name="last-components">
436
441
  <str>spellcheck</str>
437
- </arr>
442
+ </arr>
438
443
  </requestHandler>
439
444
 
445
+ <!--
446
+ The export request handler is used to export full sorted result sets.
447
+ Do not change these defaults.
448
+ -->
449
+ <requestHandler name="/export" class="solr.SearchHandler">
450
+ <lst name="invariants">
451
+ <str name="rq">{!xport}</str>
452
+ <str name="wt">xsort</str>
453
+ <str name="distrib">false</str>
454
+ </lst>
440
455
 
441
- <!-- realtime get handler, guaranteed to return the latest stored fields of
442
- any document, without the need to commit or open a new searcher. The
443
- current implementation relies on the updateLog feature being enabled. -->
444
- <requestHandler name="/get" class="solr.RealTimeGetHandler">
445
- <lst name="defaults">
446
- <str name="omitHeader">true</str>
447
- <str name="wt">json</str>
448
- <str name="indent">true</str>
449
- </lst>
450
- </requestHandler>
451
-
452
- <requestHandler name="/update" class="solr.UpdateRequestHandler">
453
- </requestHandler>
454
-
455
- <requestHandler name="/update/json" class="solr.JsonUpdateRequestHandler">
456
- <lst name="defaults">
457
- <str name="stream.contentType">application/json</str>
458
- </lst>
456
+ <arr name="components">
457
+ <str>query</str>
458
+ </arr>
459
459
  </requestHandler>
460
460
 
461
- <requestHandler name="/update/csv" class="solr.CSVRequestHandler">
462
- <lst name="defaults">
463
- <str name="stream.contentType">application/csv</str>
464
- </lst>
465
- </requestHandler>
466
461
 
467
- <requestHandler name="/update/extract"
468
- startup="lazy"
469
- class="solr.extraction.ExtractingRequestHandler" >
462
+ <initParams path="/update/**,/query,/select,/tvrh,/elevate,/spell">
470
463
  <lst name="defaults">
471
- <str name="lowernames">true</str>
472
- <str name="uprefix">ignored_</str>
473
-
474
- <!-- capture link hrefs but ignore div attributes -->
475
- <str name="captureAttr">true</str>
476
- <str name="fmap.a">links</str>
477
- <str name="fmap.div">ignored_</str>
464
+ <str name="df">text</str>
478
465
  </lst>
479
- </requestHandler>
480
-
481
- <requestHandler name="/analysis/field"
466
+ </initParams>
467
+
468
+ <!-- Field Analysis Request Handler
469
+
470
+ RequestHandler that provides much the same functionality as
471
+ analysis.jsp. Provides the ability to specify multiple field
472
+ types and field names in the same request and outputs
473
+ index-time and query-time analysis for each of them.
474
+
475
+ Request parameters are:
476
+ analysis.fieldname - field name whose analyzers are to be used
477
+
478
+ analysis.fieldtype - field type whose analyzers are to be used
479
+ analysis.fieldvalue - text for index-time analysis
480
+ q (or analysis.q) - text for query time analysis
481
+ analysis.showmatch (true|false) - When set to true and when
482
+ query analysis is performed, the produced tokens of the
483
+ field value analysis will be marked as "matched" for every
484
+ token that is produces by the query analysis
485
+ -->
486
+ <requestHandler name="/analysis/field"
482
487
  startup="lazy"
483
488
  class="solr.FieldAnalysisRequestHandler" />
484
489
 
485
- <requestHandler name="/analysis/document"
486
- class="solr.DocumentAnalysisRequestHandler"
487
- startup="lazy" />
488
490
 
489
- <!-- ping/healthcheck -->
490
- <requestHandler name="/admin/ping" class="solr.PingRequestHandler">
491
- <lst name="invariants">
492
- <str name="q">solrpingquery</str>
493
- </lst>
494
- <lst name="defaults">
495
- <str name="echoParams">all</str>
496
- </lst>
497
- </requestHandler>
491
+ <!-- Document Analysis Handler
492
+
493
+ http://wiki.apache.org/solr/AnalysisRequestHandler
494
+
495
+ An analysis handler that provides a breakdown of the analysis
496
+ process of provided documents. This handler expects a (single)
497
+ content stream with the following format:
498
+
499
+ <docs>
500
+ <doc>
501
+ <field name="id">1</field>
502
+ <field name="name">The Name</field>
503
+ <field name="text">The Text Value</field>
504
+ </doc>
505
+ <doc>...</doc>
506
+ <doc>...</doc>
507
+ ...
508
+ </docs>
509
+
510
+ Note: Each document must contain a field which serves as the
511
+ unique key. This key is used in the returned response to associate
512
+ an analysis breakdown to the analyzed document.
498
513
 
514
+ Like the FieldAnalysisRequestHandler, this handler also supports
515
+ query analysis by sending either an "analysis.query" or "q"
516
+ request parameter that holds the query text to be analyzed. It
517
+ also supports the "analysis.showmatch" parameter which when set to
518
+ true, all field tokens that match the query tokens will be marked
519
+ as a "match".
520
+ -->
521
+ <requestHandler name="/analysis/document"
522
+ class="solr.DocumentAnalysisRequestHandler"
523
+ startup="lazy" />
524
+
525
+ <!-- Echo the request contents back to the client -->
499
526
  <requestHandler name="/debug/dump" class="solr.DumpRequestHandler" >
500
527
  <lst name="defaults">
501
- <str name="echoParams">explicit</str>
528
+ <str name="echoParams">explicit</str>
502
529
  <str name="echoHandler">true</str>
503
530
  </lst>
504
531
  </requestHandler>
505
532
 
506
- <requestHandler name="/replication" class="solr.ReplicationHandler" >
507
- </requestHandler>
508
-
509
533
  <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
510
534
 
511
535
  <str name="queryAnalyzerFieldType">textSpell</str>
@@ -513,11 +537,18 @@
513
537
  <!-- Multiple "Spell Checkers" can be declared and used by this
514
538
  component
515
539
  -->
516
-
517
- <!-- a spellchecker built from a field of the main index -->
518
540
  <lst name="spellchecker">
519
541
  <str name="name">default</str>
520
- <str name="field">name</str>
542
+ <!-- change field to textSpell and use copyField in schema.xml
543
+ to spellcheck multiple fields -->
544
+ <str name="field">textSpell</str>
545
+ <str name="buildOnCommit">true</str>
546
+ </lst>
547
+
548
+ <lst name="spellchecker">
549
+ <str name="name">example</str>
550
+ <str name="field">title_text</str>
551
+ <str name="buildOnCommit">true</str>
521
552
  <str name="classname">solr.DirectSolrSpellChecker</str>
522
553
  <!-- the spellcheck distance measure used, the default is the internal levenshtein -->
523
554
  <str name="distanceMeasure">internal</str>
@@ -534,134 +565,69 @@
534
565
  <!-- maximum threshold of documents a query term can appear to be considered for correction -->
535
566
  <float name="maxQueryFrequency">0.01</float>
536
567
  <!-- uncomment this to require suggestions to occur in 1% of the documents
537
- <float name="thresholdTokenFrequency">.01</float>
568
+ <float name="thresholdTokenFrequency">.01</float>
538
569
  -->
539
570
  </lst>
540
-
571
+
541
572
  <!-- a spellchecker that can break or combine words. See "/spell" handler below for usage -->
542
573
  <lst name="spellchecker">
543
574
  <str name="name">wordbreak</str>
544
- <str name="classname">solr.WordBreakSolrSpellChecker</str>
575
+ <str name="classname">solr.WordBreakSolrSpellChecker</str>
545
576
  <str name="field">name</str>
546
577
  <str name="combineWords">true</str>
547
578
  <str name="breakWords">true</str>
548
579
  <int name="maxChanges">10</int>
549
580
  </lst>
581
+ -->
550
582
  </searchComponent>
551
583
 
552
- <searchComponent name="tvComponent" class="solr.TermVectorComponent"/>
584
+ <!-- Search Components
585
+
586
+ Search components are registered to SolrCore and used by
587
+ instances of SearchHandler (which can access them by name)
588
+
589
+ By default, the following components are available:
590
+
591
+ <searchComponent name="query" class="solr.QueryComponent" />
592
+ <searchComponent name="facet" class="solr.FacetComponent" />
593
+ <searchComponent name="mlt" class="solr.MoreLikeThisComponent" />
594
+ <searchComponent name="highlight" class="solr.HighlightComponent" />
595
+ <searchComponent name="stats" class="solr.StatsComponent" />
596
+ <searchComponent name="debug" class="solr.DebugComponent" />
553
597
 
598
+ -->
599
+
600
+ <!-- Terms Component
601
+
602
+ http://wiki.apache.org/solr/TermsComponent
603
+
604
+ A component to return terms and document frequency of those
605
+ terms
606
+ -->
554
607
  <searchComponent name="terms" class="solr.TermsComponent"/>
555
608
 
556
- <searchComponent class="solr.HighlightComponent" name="highlight">
557
- <highlighting>
558
- <!-- Configure the standard fragmenter -->
559
- <!-- This could most likely be commented out in the "default" case -->
560
- <fragmenter name="gap"
561
- default="true"
562
- class="solr.highlight.GapFragmenter">
563
- <lst name="defaults">
564
- <int name="hl.fragsize">100</int>
565
- </lst>
566
- </fragmenter>
567
-
568
- <!-- A regular-expression-based fragmenter
569
- (for sentence extraction)
570
- -->
571
- <fragmenter name="regex"
572
- class="solr.highlight.RegexFragmenter">
573
- <lst name="defaults">
574
- <!-- slightly smaller fragsizes work better because of slop -->
575
- <int name="hl.fragsize">70</int>
576
- <!-- allow 50% slop on fragment sizes -->
577
- <float name="hl.regex.slop">0.5</float>
578
- <!-- a basic sentence pattern -->
579
- <str name="hl.regex.pattern">[-\w ,/\n\&quot;&apos;]{20,200}</str>
580
- </lst>
581
- </fragmenter>
582
-
583
- <!-- Configure the standard formatter -->
584
- <formatter name="html"
585
- default="true"
586
- class="solr.highlight.HtmlFormatter">
587
- <lst name="defaults">
588
- <str name="hl.simple.pre"><![CDATA[<em>]]></str>
589
- <str name="hl.simple.post"><![CDATA[</em>]]></str>
590
- </lst>
591
- </formatter>
592
-
593
- <!-- Configure the standard encoder -->
594
- <encoder name="html"
595
- class="solr.highlight.HtmlEncoder" />
596
-
597
- <!-- Configure the standard fragListBuilder -->
598
- <fragListBuilder name="simple"
599
- class="solr.highlight.SimpleFragListBuilder"/>
600
-
601
- <!-- Configure the single fragListBuilder -->
602
- <fragListBuilder name="single"
603
- class="solr.highlight.SingleFragListBuilder"/>
604
-
605
- <!-- Configure the weighted fragListBuilder -->
606
- <fragListBuilder name="weighted"
607
- default="true"
608
- class="solr.highlight.WeightedFragListBuilder"/>
609
-
610
- <!-- default tag FragmentsBuilder -->
611
- <fragmentsBuilder name="default"
612
- default="true"
613
- class="solr.highlight.ScoreOrderFragmentsBuilder">
614
- <!--
615
- <lst name="defaults">
616
- <str name="hl.multiValuedSeparatorChar">/</str>
617
- </lst>
618
- -->
619
- </fragmentsBuilder>
620
-
621
- <!-- multi-colored tag FragmentsBuilder -->
622
- <fragmentsBuilder name="colored"
623
- class="solr.highlight.ScoreOrderFragmentsBuilder">
624
- <lst name="defaults">
625
- <str name="hl.tag.pre"><![CDATA[
626
- <b style="background:yellow">,<b style="background:lawgreen">,
627
- <b style="background:aquamarine">,<b style="background:magenta">,
628
- <b style="background:palegreen">,<b style="background:coral">,
629
- <b style="background:wheat">,<b style="background:khaki">,
630
- <b style="background:lime">,<b style="background:deepskyblue">]]></str>
631
- <str name="hl.tag.post"><![CDATA[</b>]]></str>
632
- </lst>
633
- </fragmentsBuilder>
634
-
635
- <boundaryScanner name="default"
636
- default="true"
637
- class="solr.highlight.SimpleBoundaryScanner">
638
- <lst name="defaults">
639
- <str name="hl.bs.maxScan">10</str>
640
- <str name="hl.bs.chars">.,!? &#9;&#10;&#13;</str>
641
- </lst>
642
- </boundaryScanner>
643
-
644
- <boundaryScanner name="breakIterator"
645
- class="solr.highlight.BreakIteratorBoundaryScanner">
646
- <lst name="defaults">
647
- <!-- type should be one of CHARACTER, WORD(default), LINE and SENTENCE -->
648
- <str name="hl.bs.type">WORD</str>
649
- <!-- language and country are used when constructing Locale object. -->
650
- <!-- And the Locale object will be used when getting instance of BreakIterator -->
651
- <str name="hl.bs.language">en</str>
652
- <str name="hl.bs.country">US</str>
653
- </lst>
654
- </boundaryScanner>
655
- </highlighting>
656
- </searchComponent>
657
-
609
+ <!-- A request handler for demonstrating the terms component -->
610
+ <requestHandler name="/terms" class="solr.SearchHandler" startup="lazy">
611
+ <lst name="defaults">
612
+ <bool name="terms">true</bool>
613
+ <bool name="distrib">false</bool>
614
+ </lst>
615
+ <arr name="components">
616
+ <str>terms</str>
617
+ </arr>
618
+ </requestHandler>
619
+
658
620
  <requestHandler class="solr.MoreLikeThisHandler" name="/mlt">
659
621
  <lst name="defaults">
660
622
  <str name="mlt.mintf">1</str>
661
623
  <str name="mlt.mindf">2</str>
662
624
  </lst>
663
625
  </requestHandler>
664
-
665
- <!-- Admin Handlers - This will register all the standard admin RequestHandlers. -->
666
- <requestHandler name="/admin/" class="solr.admin.AdminHandlers" />
626
+
627
+ <!-- Legacy config for the admin interface -->
628
+ <admin>
629
+ <defaultQuery>*:*</defaultQuery>
630
+ </admin>
631
+
667
632
  </config>
633
+