outoftime-sunspot 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. data/History.txt +9 -6
  2. data/README.rdoc +45 -13
  3. data/Rakefile +5 -21
  4. data/VERSION.yml +4 -0
  5. data/bin/sunspot-solr +39 -0
  6. data/lib/sunspot/builder.rb +78 -0
  7. data/lib/sunspot/dsl/fields.rb +39 -0
  8. data/lib/sunspot/dsl/query.rb +32 -0
  9. data/lib/sunspot/dsl/scope.rb +35 -0
  10. data/lib/sunspot/dsl.rb +3 -0
  11. data/lib/sunspot/query.rb +9 -20
  12. data/lib/sunspot/search.rb +8 -25
  13. data/lib/sunspot.rb +2 -3
  14. data/solr/etc/jetty.xml +10 -4
  15. data/solr/solr/conf/{admin-extra.html → elevate.xml} +18 -13
  16. data/solr/solr/conf/solrconfig.xml +369 -67
  17. data/solr/webapps/solr.war +0 -0
  18. data/spec/api/build_search_spec.rb +195 -0
  19. data/spec/api/indexer_spec.rb +112 -0
  20. data/spec/api/search_retrieval_spec.rb +59 -0
  21. data/spec/api/session_spec.rb +44 -0
  22. data/spec/api/spec_helper.rb +1 -0
  23. data/spec/api/standard_search_builder_spec.rb +76 -0
  24. data/{test → spec}/custom_expectation.rb +0 -0
  25. data/{test/integration/test_field_types.rb → spec/integration/field_types_spec.rb} +9 -9
  26. data/{test/integration/test_keyword_search.rb → spec/integration/keyword_search_spec.rb} +5 -5
  27. data/spec/integration/spec_helper.rb +1 -0
  28. data/{test → spec}/integration/test_pagination.rb +5 -5
  29. data/{test → spec}/mocks/base_class.rb +0 -0
  30. data/{test → spec}/mocks/comment.rb +0 -0
  31. data/{test → spec}/mocks/mock_adapter.rb +0 -0
  32. data/{test → spec}/mocks/post.rb +0 -0
  33. data/{test/test_helper.rb → spec/spec_helper.rb} +6 -12
  34. data/tasks/gemspec.rake +18 -0
  35. data/tasks/rcov.rake +27 -5
  36. data/tasks/spec.rake +21 -0
  37. metadata +90 -125
  38. data/Manifest.txt +0 -104
  39. data/PostInstall.txt +0 -7
  40. data/config/hoe.rb +0 -74
  41. data/config/requirements.rb +0 -15
  42. data/lib/sunspot/conditions.rb +0 -50
  43. data/lib/sunspot/conditions_builder.rb +0 -37
  44. data/lib/sunspot/field_builder.rb +0 -37
  45. data/lib/sunspot/query_builder.rb +0 -30
  46. data/lib/sunspot/scope_builder.rb +0 -33
  47. data/lib/sunspot/version.rb +0 -10
  48. data/setup.rb +0 -1585
  49. data/solr/README.txt +0 -36
  50. data/solr/exampledocs/books.csv +0 -11
  51. data/solr/exampledocs/hd.xml +0 -46
  52. data/solr/exampledocs/ipod_other.xml +0 -50
  53. data/solr/exampledocs/ipod_video.xml +0 -35
  54. data/solr/exampledocs/mem.xml +0 -58
  55. data/solr/exampledocs/monitor.xml +0 -31
  56. data/solr/exampledocs/monitor2.xml +0 -30
  57. data/solr/exampledocs/mp500.xml +0 -39
  58. data/solr/exampledocs/post.jar +0 -0
  59. data/solr/exampledocs/post.sh +0 -28
  60. data/solr/exampledocs/sd500.xml +0 -33
  61. data/solr/exampledocs/solr.xml +0 -38
  62. data/solr/exampledocs/spellchecker.xml +0 -58
  63. data/solr/exampledocs/utf8-example.xml +0 -42
  64. data/solr/exampledocs/vidcard.xml +0 -52
  65. data/solr/solr/README.txt +0 -52
  66. data/solr/solr/bin/abc +0 -176
  67. data/solr/solr/bin/abo +0 -176
  68. data/solr/solr/bin/backup +0 -108
  69. data/solr/solr/bin/backupcleaner +0 -142
  70. data/solr/solr/bin/commit +0 -128
  71. data/solr/solr/bin/optimize +0 -129
  72. data/solr/solr/bin/readercycle +0 -129
  73. data/solr/solr/bin/rsyncd-disable +0 -77
  74. data/solr/solr/bin/rsyncd-enable +0 -76
  75. data/solr/solr/bin/rsyncd-start +0 -145
  76. data/solr/solr/bin/rsyncd-stop +0 -105
  77. data/solr/solr/bin/scripts-util +0 -83
  78. data/solr/solr/bin/snapcleaner +0 -148
  79. data/solr/solr/bin/snapinstaller +0 -168
  80. data/solr/solr/bin/snappuller +0 -248
  81. data/solr/solr/bin/snappuller-disable +0 -77
  82. data/solr/solr/bin/snappuller-enable +0 -77
  83. data/solr/solr/bin/snapshooter +0 -109
  84. data/solr/solr/conf/scripts.conf +0 -24
  85. data/tasks/deployment.rake +0 -34
  86. data/tasks/environment.rake +0 -7
  87. data/tasks/solr.rake +0 -12
  88. data/tasks/website.rake +0 -17
  89. data/test/api/test_build_search.rb +0 -216
  90. data/test/api/test_helper.rb +0 -4
  91. data/test/api/test_indexer.rb +0 -110
  92. data/test/api/test_retrieve_search.rb +0 -114
  93. data/test/api/test_session.rb +0 -46
  94. data/test/integration/test_helper.rb +0 -1
@@ -1,4 +1,4 @@
1
- <?xml version="1.0" ?>
1
+ <?xml version="1.0" encoding="UTF-8" ?>
2
2
  <!--
3
3
  Licensed to the Apache Software Foundation (ASF) under one or more
4
4
  contributor license agreements. See the NOTICE file distributed with
@@ -31,15 +31,69 @@
31
31
  If replication is in use, this should match the replication configuration. -->
32
32
  <dataDir>${solr.data.dir:./solr/data}</dataDir>
33
33
 
34
+
34
35
  <indexDefaults>
35
36
  <!-- Values here affect all index writers and act as a default unless overridden. -->
36
37
  <useCompoundFile>false</useCompoundFile>
37
- <ramBufferSizeMB>32</ramBufferSizeMB>
38
+
38
39
  <mergeFactor>10</mergeFactor>
40
+ <!--
41
+ If both ramBufferSizeMB and maxBufferedDocs is set, then Lucene will flush based on whichever limit is hit first.
42
+
43
+ -->
44
+ <!--<maxBufferedDocs>1000</maxBufferedDocs>-->
45
+ <!-- Tell Lucene when to flush documents to disk.
46
+ Giving Lucene more memory for indexing means faster indexing at the cost of more RAM
47
+
48
+ If both ramBufferSizeMB and maxBufferedDocs is set, then Lucene will flush based on whichever limit is hit first.
49
+
50
+ -->
51
+ <ramBufferSizeMB>32</ramBufferSizeMB>
39
52
  <maxMergeDocs>2147483647</maxMergeDocs>
40
53
  <maxFieldLength>10000</maxFieldLength>
41
54
  <writeLockTimeout>1000</writeLockTimeout>
42
55
  <commitLockTimeout>10000</commitLockTimeout>
56
+
57
+ <!--
58
+ Expert: Turn on Lucene's auto commit capability.
59
+ This causes intermediate segment flushes to write a new lucene
60
+ index descriptor, enabling it to be opened by an external
61
+ IndexReader.
62
+ NOTE: Despite the name, this value does not have any relation to Solr's autoCommit functionality
63
+ -->
64
+ <!--<luceneAutoCommit>false</luceneAutoCommit>-->
65
+ <!--
66
+ Expert:
67
+ The Merge Policy in Lucene controls how merging is handled by Lucene. The default in 2.3 is the LogByteSizeMergePolicy, previous
68
+ versions used LogDocMergePolicy.
69
+
70
+ LogByteSizeMergePolicy chooses segments to merge based on their size. The Lucene 2.2 default, LogDocMergePolicy chose when
71
+ to merge based on number of documents
72
+
73
+ Other implementations of MergePolicy must have a no-argument constructor
74
+ -->
75
+ <!--<mergePolicy>org.apache.lucene.index.LogByteSizeMergePolicy</mergePolicy>-->
76
+
77
+ <!--
78
+ Expert:
79
+ The Merge Scheduler in Lucene controls how merges are performed. The ConcurrentMergeScheduler (Lucene 2.3 default)
80
+ can perform merges in the background using separate threads. The SerialMergeScheduler (Lucene 2.2 default) does not.
81
+ -->
82
+ <!--<mergeScheduler>org.apache.lucene.index.ConcurrentMergeScheduler</mergeScheduler>-->
83
+
84
+ <!--
85
+ This option specifies which Lucene LockFactory implementation to use.
86
+
87
+ single = SingleInstanceLockFactory - suggested for a read-only index
88
+ or when there is no possibility of another process trying
89
+ to modify the index.
90
+ native = NativeFSLockFactory
91
+ simple = SimpleFSLockFactory
92
+
93
+ (For backwards compatibility with Solr 1.2, 'simple' is the default
94
+ if not specified.)
95
+ -->
96
+ <lockType>single</lockType>
43
97
  </indexDefaults>
44
98
 
45
99
  <mainIndex>
@@ -47,15 +101,33 @@
47
101
  <useCompoundFile>false</useCompoundFile>
48
102
  <ramBufferSizeMB>32</ramBufferSizeMB>
49
103
  <mergeFactor>10</mergeFactor>
104
+ <!-- Deprecated -->
105
+ <!--<maxBufferedDocs>1000</maxBufferedDocs>-->
50
106
  <maxMergeDocs>2147483647</maxMergeDocs>
51
107
  <maxFieldLength>10000</maxFieldLength>
52
108
 
53
109
  <!-- If true, unlock any held write or commit locks on startup.
54
110
  This defeats the locking mechanism that allows multiple
55
111
  processes to safely access a lucene index, and should be
56
- used with care. -->
112
+ used with care.
113
+ This is not needed if lock type is 'none' or 'single'
114
+ -->
57
115
  <unlockOnStartup>false</unlockOnStartup>
58
116
  </mainIndex>
117
+
118
+ <!-- Enables JMX if and only if an existing MBeanServer is found, use
119
+ this if you want to configure JMX through JVM parameters. Remove
120
+ this to disable exposing Solr configuration and statistics to JMX.
121
+
122
+ If you want to connect to a particular server, specify the agentId
123
+ e.g. <jmx agentId="myAgent" />
124
+
125
+ If you want to start a new MBeanServer, specify the serviceUrl
126
+ e.g <jmx serviceurl="service:jmx:rmi:///jndi/rmi://localhost:9999/solr" />
127
+
128
+ For more details see http://wiki.apache.org/solr/SolrJmx
129
+ -->
130
+ <jmx />
59
131
 
60
132
  <!-- the default high-performance update handler -->
61
133
  <updateHandler class="solr.DirectUpdateHandler2">
@@ -65,10 +137,12 @@
65
137
  org.apache.solr.(search|update|request|core|analysis)
66
138
  -->
67
139
 
68
- <!-- autocommit pending docs if certain criteria are met
140
+ <!-- Perform a <commit/> automatically under certain conditions:
141
+ maxDocs - number of updates since last commit is greater than this
142
+ maxTime - oldest uncommited update (in ms) is this long ago
69
143
  <autoCommit>
70
144
  <maxDocs>10000</maxDocs>
71
- <maxTime>1000</maxTime>
145
+ <maxTime>1000</maxTime>
72
146
  </autoCommit>
73
147
  -->
74
148
 
@@ -81,8 +155,8 @@
81
155
  -->
82
156
  <!-- A postCommit event is fired after every commit or optimize command
83
157
  <listener event="postCommit" class="solr.RunExecutableListener">
84
- <str name="exe">snapshooter</str>
85
- <str name="dir">solr/bin</str>
158
+ <str name="exe">solr/bin/snapshooter</str>
159
+ <str name="dir">.</str>
86
160
  <bool name="wait">true</bool>
87
161
  <arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
88
162
  <arr name="env"> <str>MYVAR=val1</str> </arr>
@@ -125,7 +199,7 @@
125
199
  class="solr.LRUCache"
126
200
  size="512"
127
201
  initialSize="512"
128
- autowarmCount="256"/>
202
+ autowarmCount="128"/>
129
203
 
130
204
  <!-- queryResultCache caches results of searches - ordered lists of
131
205
  document ids (DocList) based on a query, a sort, and the range
@@ -134,7 +208,7 @@
134
208
  class="solr.LRUCache"
135
209
  size="512"
136
210
  initialSize="512"
137
- autowarmCount="256"/>
211
+ autowarmCount="32"/>
138
212
 
139
213
  <!-- documentCache caches Lucene Document objects (the stored fields for each document).
140
214
  Since Lucene internal document ids are transient, this cache will not be autowarmed. -->
@@ -145,8 +219,12 @@
145
219
  autowarmCount="0"/>
146
220
 
147
221
  <!-- If true, stored fields that are not requested will be loaded lazily.
222
+
223
+ This can result in a significant speed improvement if the usual case is to
224
+ not load all stored fields, especially if the skipped fields are large compressed
225
+ text fields.
148
226
  -->
149
- <enableLazyFieldLoading>false</enableLazyFieldLoading>
227
+ <enableLazyFieldLoading>true</enableLazyFieldLoading>
150
228
 
151
229
  <!-- Example of a generic cache. These caches may be accessed by name
152
230
  through SolrIndexSearcher.getCache(),cacheLookup(), and cacheInsert().
@@ -175,9 +253,13 @@
175
253
  is requested, a superset of the requested number of document ids
176
254
  are collected. For example, if a search for a particular query
177
255
  requests matching documents 10 through 19, and queryWindowSize is 50,
178
- then documents 0 through 50 will be collected and cached. Any further
256
+ then documents 0 through 49 will be collected and cached. Any further
179
257
  requests in that range can be satisfied via the cache. -->
180
- <queryResultWindowSize>10</queryResultWindowSize>
258
+ <queryResultWindowSize>50</queryResultWindowSize>
259
+
260
+ <!-- Maximum number of documents to cache for any entry in the
261
+ queryResultCache. -->
262
+ <queryResultMaxDocsCached>200</queryResultMaxDocsCached>
181
263
 
182
264
  <!-- This entry enables an int hash representation for filters (DocSets)
183
265
  when the number of items in the set is less than maxSize. For smaller
@@ -185,36 +267,27 @@
185
267
  iterate over, and faster to take intersections. -->
186
268
  <HashDocSet maxSize="3000" loadFactor="0.75"/>
187
269
 
188
-
189
- <!-- boolToFilterOptimizer converts boolean clauses with zero boost
190
- into cached filters if the number of docs selected by the clause exceeds
191
- the threshold (represented as a fraction of the total index) -->
192
- <boolTofilterOptimizer enabled="true" cacheSize="32" threshold=".05"/>
193
-
194
-
195
270
  <!-- a newSearcher event is fired whenever a new searcher is being prepared
196
271
  and there is a current searcher handling requests (aka registered). -->
197
272
  <!-- QuerySenderListener takes an array of NamedList and executes a
198
273
  local query request for each NamedList in sequence. -->
199
- <!--
200
274
  <listener event="newSearcher" class="solr.QuerySenderListener">
201
275
  <arr name="queries">
202
276
  <lst> <str name="q">solr</str> <str name="start">0</str> <str name="rows">10</str> </lst>
203
277
  <lst> <str name="q">rocks</str> <str name="start">0</str> <str name="rows">10</str> </lst>
278
+ <lst><str name="q">static newSearcher warming query from solrconfig.xml</str></lst>
204
279
  </arr>
205
280
  </listener>
206
- -->
207
281
 
208
282
  <!-- a firstSearcher event is fired whenever a new searcher is being
209
283
  prepared but there is no current registered searcher to handle
210
284
  requests or to gain autowarming data from. -->
211
- <!--
212
285
  <listener event="firstSearcher" class="solr.QuerySenderListener">
213
286
  <arr name="queries">
214
287
  <lst> <str name="q">fast_warm</str> <str name="start">0</str> <str name="rows">10</str> </lst>
288
+ <lst><str name="q">static firstSearcher warming query from solrconfig.xml</str></lst>
215
289
  </arr>
216
290
  </listener>
217
- -->
218
291
 
219
292
  <!-- If a search request comes in and there is no current registered searcher,
220
293
  then immediately register the still warming searcher and use it. If
@@ -225,7 +298,7 @@
225
298
  <!-- Maximum number of searchers that may be warming in the background
226
299
  concurrently. An error is returned if this limit is exceeded. Recommend
227
300
  1-2 for read-only slaves, higher for masters w/o cache warming. -->
228
- <maxWarmingSearchers>4</maxWarmingSearchers>
301
+ <maxWarmingSearchers>2</maxWarmingSearchers>
229
302
 
230
303
  </query>
231
304
 
@@ -237,16 +310,54 @@
237
310
  <requestDispatcher handleSelect="true" >
238
311
  <!--Make sure your system has some authentication before enabling remote streaming! -->
239
312
  <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="2048" />
313
+
314
+ <!-- Set HTTP caching related parameters (for proxy caches and clients).
315
+
316
+ To get the behaviour of Solr 1.2 (ie: no caching related headers)
317
+ use the never304="true" option and do not specify a value for
318
+ <cacheControl>
319
+ -->
320
+ <!-- <httpCaching never304="true"> -->
321
+ <httpCaching lastModifiedFrom="openTime"
322
+ etagSeed="Solr">
323
+ <!-- lastModFrom="openTime" is the default, the Last-Modified value
324
+ (and validation against If-Modified-Since requests) will all be
325
+ relative to when the current Searcher was opened.
326
+ You can change it to lastModFrom="dirLastMod" if you want the
327
+ value to exactly corrispond to when the physical index was last
328
+ modified.
329
+
330
+ etagSeed="..." is an option you can change to force the ETag
331
+ header (and validation against If-None-Match requests) to be
332
+ differnet even if the index has not changed (ie: when making
333
+ significant changes to your config file)
334
+
335
+ lastModifiedFrom and etagSeed are both ignored if you use the
336
+ never304="true" option.
337
+ -->
338
+ <!-- If you include a <cacheControl> directive, it will be used to
339
+ generate a Cache-Control header, as well as an Expires header
340
+ if the value contains "max-age="
341
+
342
+ By default, no Cache-Control header is generated.
343
+
344
+ You can use the <cacheControl> option even if you have set
345
+ never304="true"
346
+ -->
347
+ <!-- <cacheControl>max-age=30, public</cacheControl> -->
348
+ </httpCaching>
240
349
  </requestDispatcher>
241
350
 
242
351
 
243
352
  <!-- requestHandler plugins... incoming queries will be dispatched to the
244
- correct handler based on the qt (query type) param matching the
245
- name of registered handlers.
246
- The "standard" request handler is the default and will be used if qt
247
- is not specified in the request.
353
+ correct handler based on the path or the qt (query type) param.
354
+ Names starting with a '/' are accessed with the a path equal to the
355
+ registered name. Names without a leading '/' are accessed with:
356
+ http://host/app/select?qt=name
357
+ If no qt is defined, the requestHandler that declares default="true"
358
+ will be used.
248
359
  -->
249
- <requestHandler name="standard" class="solr.StandardRequestHandler">
360
+ <requestHandler name="standard" class="solr.SearchHandler" default="true">
250
361
  <!-- default values for query parameters -->
251
362
  <lst name="defaults">
252
363
  <str name="echoParams">explicit</str>
@@ -259,14 +370,58 @@
259
370
  </requestHandler>
260
371
 
261
372
 
373
+ <!-- DisMaxRequestHandler allows easy searching across multiple fields
374
+ for simple user-entered phrases. It's implementation is now
375
+ just the standard SearchHandler with a default query type
376
+ of "dismax".
377
+ see http://wiki.apache.org/solr/DisMaxRequestHandler
378
+ -->
379
+ <requestHandler name="dismax" class="solr.SearchHandler" >
380
+ <lst name="defaults">
381
+ <str name="defType">dismax</str>
382
+ <str name="echoParams">explicit</str>
383
+ <float name="tie">0.01</float>
384
+ <str name="qf">
385
+ text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
386
+ </str>
387
+ <str name="pf">
388
+ text^0.2 features^1.1 name^1.5 manu^1.4 manu_exact^1.9
389
+ </str>
390
+ <str name="bf">
391
+ ord(popularity)^0.5 recip(rord(price),1,1000,1000)^0.3
392
+ </str>
393
+ <str name="fl">
394
+ id,name,price,score
395
+ </str>
396
+ <str name="mm">
397
+ 2&lt;-1 5&lt;-2 6&lt;90%
398
+ </str>
399
+ <int name="ps">100</int>
400
+ <str name="q.alt">*:*</str>
401
+ <!-- example highlighter config, enable per-query with hl=true -->
402
+ <str name="hl.fl">text features name</str>
403
+ <!-- for this field, we want no fragmenting, just highlighting -->
404
+ <str name="f.name.hl.fragsize">0</str>
405
+ <!-- instructs Solr to return the field itself if no query terms are
406
+ found -->
407
+ <str name="f.name.hl.alternateField">name</str>
408
+ <str name="f.text.hl.fragmenter">regex</str> <!-- defined below -->
409
+ </lst>
410
+ </requestHandler>
262
411
 
263
-
264
- <requestHandler name="browse" class="solr.DisMaxRequestHandler" >
412
+ <!-- Note how you can register the same handler multiple times with
413
+ different names (and different init parameters)
414
+ -->
415
+ <requestHandler name="partitioned" class="solr.SearchHandler" >
265
416
  <lst name="defaults">
417
+ <str name="defType">dismax</str>
266
418
  <str name="echoParams">explicit</str>
267
- <str name="qf">text^1.0 title_text^2.0 description_text^1.5 id^10.0</str>
419
+ <str name="qf">text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0</str>
268
420
  <str name="mm">2&lt;-1 5&lt;-2 6&lt;90%</str>
269
- <str name="q.alt">*:*</str>
421
+ <!-- This is an example of using Date Math to specify a constantly
422
+ moving date range in a config...
423
+ -->
424
+ <str name="bq">incubationdate_dt:[* TO NOW/DAY-1MONTH]^2.2</str>
270
425
  </lst>
271
426
  <!-- In addition to defaults, "appends" params can be specified
272
427
  to identify values which should be appended to the list of
@@ -282,6 +437,7 @@
282
437
  unless you are sure you always want it.
283
438
  -->
284
439
  <lst name="appends">
440
+ <str name="fq">inStock:true</str>
285
441
  </lst>
286
442
  <!-- "invariants" are a way of letting the Solr maintainer lock down
287
443
  the options available to Solr clients. Any params values
@@ -300,43 +456,110 @@
300
456
  unless you are sure you always want it.
301
457
  -->
302
458
  <lst name="invariants">
303
- <str name="facet">on</str>
304
- <str name="facet.mincount">1</str>
305
- <str name="facet.field">genre_facet</str>
306
- <str name="facet.field">medium_facet</str>
307
- <str name="facet.field">rating_facet</str>
308
- <str name="facet.field">publisher_facet</str>
459
+ <str name="facet.field">cat</str>
460
+ <str name="facet.field">manu_exact</str>
461
+ <str name="facet.query">price:[* TO 500]</str>
462
+ <str name="facet.query">price:[500 TO *]</str>
309
463
  </lst>
310
464
  </requestHandler>
465
+
311
466
 
312
-
313
- <!-- SpellCheckerRequestHandler takes in a word (or several words) as the
314
- value of the "q" parameter and returns a list of alternative spelling
315
- suggestions. If invoked with a ...&cmd=rebuild, it will rebuild the
316
- spellchecker index.
467
+ <!--
468
+ Search components are registered to SolrCore and used by Search Handlers
469
+
470
+ By default, the following components are avaliable:
471
+
472
+ <searchComponent name="query" class="org.apache.solr.handler.component.QueryComponent" />
473
+ <searchComponent name="facet" class="org.apache.solr.handler.component.FacetComponent" />
474
+ <searchComponent name="mlt" class="org.apache.solr.handler.component.MoreLikeThisComponent" />
475
+ <searchComponent name="highlight" class="org.apache.solr.handler.component.HighlightComponent" />
476
+ <searchComponent name="debug" class="org.apache.solr.handler.component.DebugComponent" />
477
+
478
+ Default configuration in a requestHandler would look like:
479
+ <arr name="components">
480
+ <str>query</str>
481
+ <str>facet</str>
482
+ <str>mlt</str>
483
+ <str>highlight</str>
484
+ <str>debug</str>
485
+ </arr>
486
+
487
+ If you register a searchComponent to one of the standard names, that will be used instead.
488
+ To insert handlers before or after the 'standard' components, use:
489
+
490
+ <arr name="first-components">
491
+ <str>myFirstComponentName</str>
492
+ </arr>
493
+
494
+ <arr name="last-components">
495
+ <str>myLastComponentName</str>
496
+ </arr>
317
497
  -->
318
- <requestHandler name="spellchecker" class="solr.SpellCheckerRequestHandler">
319
- <!-- default values for query parameters -->
320
- <lst name="defaults">
321
- <int name="suggestionCount">1</int>
322
- <float name="accuracy">0.5</float>
323
- </lst>
324
-
325
- <!-- Main init params for handler -->
326
-
327
- <!-- The directory where your SpellChecker Index should live. -->
328
- <!-- May be absolute, or relative to the Solr "dataDir" directory. -->
329
- <!-- If this option is not specified, a RAM directory will be used -->
330
- <str name="spellcheckerIndexDir">spell</str>
331
-
332
- <!-- the field in your schema that you want to be able to build -->
333
- <!-- your spell index on. This should be a field that uses a very -->
334
- <!-- simple FieldType without a lot of Analysis (ie: string) -->
335
- <str name="termSourceField">word</str>
336
-
337
- </requestHandler>
338
498
 
499
+ <!-- The spell check component can return a list of alternative spelling
500
+ suggestions. -->
501
+ <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
502
+
503
+ <str name="queryAnalyzerFieldType">textSpell</str>
504
+
505
+ <lst name="spellchecker">
506
+ <str name="name">default</str>
507
+ <str name="field">spell</str>
508
+ <str name="spellcheckIndexDir">./spellchecker1</str>
509
+
510
+ </lst>
511
+ <lst name="spellchecker">
512
+ <str name="name">jarowinkler</str>
513
+ <str name="field">spell</str>
514
+ <!-- Use a different Distance Measure -->
515
+ <str name="distanceMeasure">org.apache.lucene.search.spell.JaroWinklerDistance</str>
516
+ <str name="spellcheckIndexDir">./spellchecker2</str>
517
+
518
+ </lst>
519
+
520
+ <lst name="spellchecker">
521
+ <str name="classname">solr.FileBasedSpellChecker</str>
522
+ <str name="name">file</str>
523
+ <str name="sourceLocation">spellings.txt</str>
524
+ <str name="characterEncoding">UTF-8</str>
525
+ <str name="spellcheckIndexDir">./spellcheckerFile</str>
526
+ </lst>
527
+ </searchComponent>
528
+
529
+ <!-- a request handler utilizing the spellcheck component -->
530
+ <requestHandler name="/spellCheckCompRH" class="solr.SearchHandler">
531
+ <lst name="defaults">
532
+ <!-- omp = Only More Popular -->
533
+ <str name="spellcheck.onlyMorePopular">false</str>
534
+ <!-- exr = Extended Results -->
535
+ <str name="spellcheck.extendedResults">false</str>
536
+ <!-- The number of suggestions to return -->
537
+ <str name="spellcheck.count">1</str>
538
+ </lst>
539
+ <arr name="last-components">
540
+ <str>spellcheck</str>
541
+ </arr>
542
+ </requestHandler>
543
+
544
+ <!-- a search component that enables you to configure the top results for
545
+ a given query regardless of the normal lucene scoring.-->
546
+ <searchComponent name="elevator" class="solr.QueryElevationComponent" >
547
+ <!-- pick a fieldType to analyze queries -->
548
+ <str name="queryFieldType">string</str>
549
+ <str name="config-file">elevate.xml</str>
550
+ </searchComponent>
551
+
552
+ <!-- a request handler utilizing the elevator component -->
553
+ <requestHandler name="/elevate" class="solr.SearchHandler" startup="lazy">
554
+ <lst name="defaults">
555
+ <str name="echoParams">explicit</str>
556
+ </lst>
557
+ <arr name="last-components">
558
+ <str>elevator</str>
559
+ </arr>
560
+ </requestHandler>
339
561
 
562
+
340
563
  <!-- Update request handler.
341
564
 
342
565
  Note: Since solr1.1 requestHandlers requires a valid content type header if posted in
@@ -347,11 +570,47 @@
347
570
  -->
348
571
  <requestHandler name="/update" class="solr.XmlUpdateRequestHandler" />
349
572
 
573
+ <!--
574
+ Analysis request handler. Since Solr 1.3. Use to returnhow a document is analyzed. Useful
575
+ for debugging and as a token server for other types of applications
576
+ -->
577
+ <requestHandler name="/analysis" class="solr.AnalysisRequestHandler" />
578
+
579
+
350
580
  <!-- CSV update handler, loaded on demand -->
351
581
  <requestHandler name="/update/csv" class="solr.CSVRequestHandler" startup="lazy" />
352
582
 
353
- <!-- requestHandler name="/admin/" class="org.apache.solr.handler.admin.AdminHandlers" /-->
583
+
584
+ <!--
585
+ Admin Handlers - This will register all the standard admin RequestHandlers. Adding
586
+ this single handler is equivolent to registering:
587
+
588
+ <requestHandler name="/admin/luke" class="org.apache.solr.handler.admin.LukeRequestHandler" />
589
+ <requestHandler name="/admin/system" class="org.apache.solr.handler.admin.SystemInfoHandler" />
590
+ <requestHandler name="/admin/plugins" class="org.apache.solr.handler.admin.PluginInfoHandler" />
591
+ <requestHandler name="/admin/threads" class="org.apache.solr.handler.admin.ThreadDumpHandler" />
592
+ <requestHandler name="/admin/properties" class="org.apache.solr.handler.admin.PropertiesRequestHandler" />
593
+ <requestHandler name="/admin/file" class="org.apache.solr.handler.admin.ShowFileRequestHandler" >
354
594
 
595
+ If you wish to hide files under ${solr.home}/conf, explicitly register the ShowFileRequestHandler using:
596
+ <requestHandler name="/admin/file" class="org.apache.solr.handler.admin.ShowFileRequestHandler" >
597
+ <lst name="invariants">
598
+ <str name="hidden">synonyms.txt</str>
599
+ <str name="hidden">anotherfile.txt</str>
600
+ </lst>
601
+ </requestHandler>
602
+ -->
603
+ <requestHandler name="/admin/" class="org.apache.solr.handler.admin.AdminHandlers" />
604
+
605
+ <!-- ping/healthcheck -->
606
+ <requestHandler name="/admin/ping" class="PingRequestHandler">
607
+ <lst name="defaults">
608
+ <str name="qt">standard</str>
609
+ <str name="q">solrpingquery</str>
610
+ <str name="echoParams">all</str>
611
+ </lst>
612
+ </requestHandler>
613
+
355
614
  <!-- Echo the request contents back to the client -->
356
615
  <requestHandler name="/debug/dump" class="solr.DumpRequestHandler" >
357
616
  <lst name="defaults">
@@ -360,17 +619,50 @@
360
619
  </lst>
361
620
  </requestHandler>
362
621
 
622
+ <highlighting>
623
+ <!-- Configure the standard fragmenter -->
624
+ <!-- This could most likely be commented out in the "default" case -->
625
+ <fragmenter name="gap" class="org.apache.solr.highlight.GapFragmenter" default="true">
626
+ <lst name="defaults">
627
+ <int name="hl.fragsize">100</int>
628
+ </lst>
629
+ </fragmenter>
630
+
631
+ <!-- A regular-expression-based fragmenter (f.i., for sentence extraction) -->
632
+ <fragmenter name="regex" class="org.apache.solr.highlight.RegexFragmenter">
633
+ <lst name="defaults">
634
+ <!-- slightly smaller fragsizes work better because of slop -->
635
+ <int name="hl.fragsize">70</int>
636
+ <!-- allow 50% slop on fragment sizes -->
637
+ <float name="hl.regex.slop">0.5</float>
638
+ <!-- a basic sentence pattern -->
639
+ <str name="hl.regex.pattern">[-\w ,/\n\"']{20,200}</str>
640
+ </lst>
641
+ </fragmenter>
642
+
643
+ <!-- Configure the standard formatter -->
644
+ <formatter name="html" class="org.apache.solr.highlight.HtmlFormatter" default="true">
645
+ <lst name="defaults">
646
+ <str name="hl.simple.pre"><![CDATA[<em>]]></str>
647
+ <str name="hl.simple.post"><![CDATA[</em>]]></str>
648
+ </lst>
649
+ </formatter>
650
+ </highlighting>
651
+
652
+
363
653
  <!-- queryResponseWriter plugins... query responses will be written using the
364
654
  writer specified by the 'wt' request parameter matching the name of a registered
365
655
  writer.
366
- The "standard" writer is the default and will be used if 'wt' is not specified
656
+ The "default" writer is the default and will be used if 'wt' is not specified
367
657
  in the request. XMLResponseWriter will be used if nothing is specified here.
368
658
  The json, python, and ruby writers are also available by default.
369
659
 
370
- <queryResponseWriter name="standard" class="org.apache.solr.request.XMLResponseWriter"/>
660
+ <queryResponseWriter name="xml" class="org.apache.solr.request.XMLResponseWriter" default="true"/>
371
661
  <queryResponseWriter name="json" class="org.apache.solr.request.JSONResponseWriter"/>
372
662
  <queryResponseWriter name="python" class="org.apache.solr.request.PythonResponseWriter"/>
373
663
  <queryResponseWriter name="ruby" class="org.apache.solr.request.RubyResponseWriter"/>
664
+ <queryResponseWriter name="php" class="org.apache.solr.request.PHPResponseWriter"/>
665
+ <queryResponseWriter name="phps" class="org.apache.solr.request.PHPSerializedResponseWriter"/>
374
666
 
375
667
  <queryResponseWriter name="custom" class="com.example.MyResponseWriter"/>
376
668
  -->
@@ -382,10 +674,20 @@
382
674
  <queryResponseWriter name="xslt" class="org.apache.solr.request.XSLTResponseWriter">
383
675
  <int name="xsltCacheLifetimeSeconds">5</int>
384
676
  </queryResponseWriter>
677
+
678
+
679
+ <!-- example of registering a query parser
680
+ <queryParser name="lucene" class="org.apache.solr.search.LuceneQParserPlugin"/>
681
+ -->
682
+
683
+ <!-- example of registering a custom function parser
684
+ <valueSourceParser name="myfunc" class="com.mycompany.MyValueSourceParser" />
685
+ -->
385
686
 
386
687
  <!-- config for the admin interface -->
387
688
  <admin>
388
689
  <defaultQuery>solr</defaultQuery>
690
+
389
691
  <!-- configure a healthcheck file for servers behind a loadbalancer
390
692
  <healthcheck type="file">server-enabled</healthcheck>
391
693
  -->
Binary file