blacklight-maps 0.0.1

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 (35) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +20 -0
  3. data/.travis.yml +18 -0
  4. data/Gemfile +16 -0
  5. data/LICENSE.txt +13 -0
  6. data/README.md +81 -0
  7. data/Rakefile +43 -0
  8. data/app/assets/javascripts/blacklight-maps.js +8 -0
  9. data/app/assets/javascripts/blacklight-maps/blacklight-maps-browse.js +141 -0
  10. data/app/assets/stylesheets/blacklight_maps/blacklight-maps.css.scss +4 -0
  11. data/app/assets/stylesheets/blacklight_maps/default.css.scss +24 -0
  12. data/app/helpers/blacklight_maps_helper.rb +36 -0
  13. data/app/views/catalog/_document_maps.html.erb +6 -0
  14. data/app/views/catalog/_index_maps.html.erb +9 -0
  15. data/blacklight-maps.gemspec +34 -0
  16. data/config/jetty.yml +7 -0
  17. data/config/locales/blacklight-maps.en.yml +5 -0
  18. data/config/routes.rb +4 -0
  19. data/docs/map-sidebar.png +0 -0
  20. data/docs/map-view.png +0 -0
  21. data/lib/blacklight/maps.rb +7 -0
  22. data/lib/blacklight/maps/engine.rb +32 -0
  23. data/lib/blacklight/maps/version.rb +5 -0
  24. data/lib/generators/blacklight_maps/install_generator.rb +25 -0
  25. data/lib/generators/blacklight_maps/templates/blacklight_maps.css.scss +3 -0
  26. data/lib/railties/blacklight_maps.rake +13 -0
  27. data/solr_conf/conf/schema.xml +673 -0
  28. data/solr_conf/conf/solrconfig.xml +523 -0
  29. data/spec/features/maps_spec.rb +79 -0
  30. data/spec/fixtures/sample_solr_documents.yml +2742 -0
  31. data/spec/helpers/blacklight_maps_helper_spec.rb +28 -0
  32. data/spec/spec_helper.rb +38 -0
  33. data/spec/test_app_templates/Gemfile.extra +7 -0
  34. data/spec/test_app_templates/lib/generators/test_app_generator.rb +23 -0
  35. metadata +268 -0
@@ -0,0 +1,523 @@
1
+ <?xml version="1.0" encoding="UTF-8" ?>
2
+ <!--
3
+ Licensed to the Apache Software Foundation (ASF) under one or more
4
+ contributor license agreements. See the NOTICE file distributed with
5
+ this work for additional information regarding copyright ownership.
6
+ The ASF licenses this file to You under the Apache License, Version 2.0
7
+ (the "License"); you may not use this file except in compliance with
8
+ the License. You may obtain a copy of the License at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Unless required by applicable law or agreed to in writing, software
13
+ distributed under the License is distributed on an "AS IS" BASIS,
14
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ See the License for the specific language governing permissions and
16
+ limitations under the License.
17
+ -->
18
+
19
+ <!--
20
+ This is a stripped down config file used for a simple example...
21
+ It is *not* a good example to work from.
22
+ -->
23
+ <config>
24
+ <luceneMatchVersion>LUCENE_40</luceneMatchVersion>
25
+ <!-- The DirectoryFactory to use for indexes.
26
+ solr.StandardDirectoryFactory, the default, is filesystem based.
27
+ solr.RAMDirectoryFactory is memory based, not persistent, and doesn't work with replication. -->
28
+ <directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.StandardDirectoryFactory}"/>
29
+
30
+ <lib dir="../lib/contrib/analysis-extras/lib" />
31
+ <lib dir="../lib/contrib/analysis-extras/lucene-libs" />
32
+
33
+ <dataDir>${solr.blacklight-core.data.dir:}</dataDir>
34
+
35
+ <requestHandler name="/replication" class="solr.ReplicationHandler" startup="lazy" />
36
+
37
+ <requestDispatcher handleSelect="true" >
38
+ <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="2048" />
39
+ </requestDispatcher>
40
+
41
+ <requestHandler name="standard" class="solr.StandardRequestHandler" />
42
+ <requestHandler name="/analysis/field" startup="lazy" class="solr.FieldAnalysisRequestHandler" />
43
+ <requestHandler name="/update" class="solr.UpdateRequestHandler" />
44
+ <requestHandler name="/admin/" class="org.apache.solr.handler.admin.AdminHandlers" />
45
+
46
+ <requestHandler name="/admin/ping" class="solr.PingRequestHandler">
47
+ <lst name="invariants">
48
+ <str name="q">solrpingquery</str>
49
+ </lst>
50
+ <lst name="defaults">
51
+ <str name="echoParams">all</str>
52
+ </lst>
53
+ </requestHandler>
54
+
55
+ <!-- config for the admin interface -->
56
+ <admin>
57
+ <defaultQuery>solr</defaultQuery>
58
+ </admin>
59
+
60
+ <!-- SearchHandler
61
+
62
+ http://wiki.apache.org/solr/SearchHandler
63
+
64
+ For processing Search Queries, the primary Request Handler
65
+ provided with Solr is "SearchHandler" It delegates to a sequent
66
+ of SearchComponents (see below) and supports distributed
67
+ queries across multiple shards
68
+ -->
69
+ <requestHandler name="search" class="solr.SearchHandler" default="true">
70
+ <!-- default values for query parameters can be specified, these
71
+ will be overridden by parameters in the request
72
+ -->
73
+ <lst name="defaults">
74
+ <str name="defType">dismax</str>
75
+ <str name="echoParams">explicit</str>
76
+ <int name="rows">10</int>
77
+
78
+ <str name="q.alt">*:*</str>
79
+ <str name="mm">2&lt;-1 5&lt;-2 6&lt;90%</str>
80
+
81
+ <!-- this qf and pf are used by default, if not otherwise specified by
82
+ client. The default blacklight_config will use these for the
83
+ "keywords" search. See the author_qf/author_pf, title_qf, etc
84
+ below, which the default blacklight_config will specify for
85
+ those searches. You may also be interested in:
86
+ http://wiki.apache.org/solr/LocalParams
87
+ -->
88
+
89
+ <str name="qf">
90
+ title_unstem_search^100000
91
+ subtitle_unstem_search^50000
92
+ title_t^25000
93
+ subtitle_t^10000
94
+ title_addl_unstem_search^5000
95
+ title_addl_t^2500
96
+ title_added_entry_unstem_search^1500
97
+ title_added_entry_t^1250
98
+ subject_topic_unstem_search^1000
99
+ subject_unstem_search^750
100
+ subject_topic_facet^625
101
+ subject_t^500
102
+ author_unstem_search^250
103
+ author_addl_unstem_search^250
104
+ author_t^100
105
+ author_addl_t^50
106
+ subject_addl_unstem_search^250
107
+ subject_addl_t^50
108
+ title_series_unstem_search^25
109
+ title_series_t^10
110
+ isbn_t
111
+ text
112
+ </str>
113
+ <str name="pf">
114
+ title_unstem_search^1000000
115
+ subtitle_unstem_search^500000
116
+ title_t^250000
117
+ subtitle_t^100000
118
+ title_addl_unstem_search^50000
119
+ title_addl_t^25000
120
+ title_added_entry_unstem_search^15000
121
+ title_added_entry_t^12500
122
+ subject_topic_unstem_search^10000
123
+ subject_unstem_search^7500
124
+ subject_topic_facet^6250
125
+ subject_t^5000
126
+ author_unstem_search^2500
127
+ author_addl_unstem_search^2500
128
+ author_t^1000
129
+ author_addl_t^500
130
+ subject_addl_unstem_search^2500
131
+ subject_addl_t^500
132
+ title_series_unstem_search^250
133
+ title_series_t^100
134
+ text^10
135
+ </str>
136
+ <str name="author_qf">
137
+ author_unstem_search^200
138
+ author_addl_unstem_search^50
139
+ author_t^20
140
+ author_addl_t
141
+ </str>
142
+ <str name="author_pf">
143
+ author_unstem_search^2000
144
+ author_addl_unstem_search^500
145
+ author_t^200
146
+ author_addl_t^10
147
+ </str>
148
+ <str name="title_qf">
149
+ title_unstem_search^50000
150
+ subtitle_unstem_search^25000
151
+ title_addl_unstem_search^10000
152
+ title_t^5000
153
+ subtitle_t^2500
154
+ title_addl_t^100
155
+ title_added_entry_unstem_search^50
156
+ title_added_entry_t^10
157
+ title_series_unstem_search^5
158
+ title_series_t
159
+ </str>
160
+ <str name="title_pf">
161
+ title_unstem_search^500000
162
+ subtitle_unstem_search^250000
163
+ title_addl_unstem_search^100000
164
+ title_t^50000
165
+ subtitle_t^25000
166
+ title_addl_t^1000
167
+ title_added_entry_unstem_search^500
168
+ title_added_entry_t^100
169
+ title_series_t^50
170
+ title_series_unstem_search^10
171
+ </str>
172
+ <str name="subject_qf">
173
+ subject_topic_unstem_search^200
174
+ subject_unstem_search^125
175
+ subject_topic_facet^100
176
+ subject_t^50
177
+ subject_addl_unstem_search^10
178
+ subject_addl_t
179
+ </str>
180
+ <str name="subject_pf">
181
+ subject_topic_unstem_search^2000
182
+ subject_unstem_search^1250
183
+ subject_t^1000
184
+ subject_topic_facet^500
185
+ subject_addl_unstem_search^100
186
+ subject_addl_t^10
187
+ </str>
188
+
189
+ <int name="ps">3</int>
190
+ <float name="tie">0.01</float>
191
+
192
+ <!-- NOT using marc_display because it is large and will slow things down for search results -->
193
+ <str name="fl">
194
+ id,
195
+ score,
196
+ author_display,
197
+ author_vern_display,
198
+ format,
199
+ isbn_t,
200
+ language_facet,
201
+ lc_callnum_display,
202
+ material_type_display,
203
+ published_display,
204
+ published_vern_display,
205
+ pub_date,
206
+ title_display,
207
+ title_vern_display,
208
+ subject_topic_facet,
209
+ subject_geo_facet,
210
+ subject_era_facet,
211
+ subtitle_display,
212
+ subtitle_vern_display,
213
+ url_fulltext_display,
214
+ url_suppl_display,
215
+ placename_coords
216
+ </str>
217
+
218
+ <str name="facet">true</str>
219
+ <str name="facet.mincount">1</str>
220
+ <str name="facet.limit">10</str>
221
+ <str name="facet.field">format</str>
222
+ <str name="facet.field">lc_1letter_facet</str>
223
+ <str name="facet.field">lc_alpha_facet</str>
224
+ <str name="facet.field">lc_b4cutter_facet</str>
225
+ <str name="facet.field">language_facet</str>
226
+ <str name="facet.field">pub_date</str>
227
+ <str name="facet.field">subject_era_facet</str>
228
+ <str name="facet.field">subject_geo_facet</str>
229
+ <str name="facet.field">subject_topic_facet</str>
230
+ <str name="spellcheck">true</str>
231
+ <str name="spellcheck.dictionary">default</str>
232
+ <str name="spellcheck.onlyMorePopular">true</str>
233
+ <str name="spellcheck.extendedResults">true</str>
234
+ <str name="spellcheck.collate">false</str>
235
+ <str name="spellcheck.count">5</str>
236
+
237
+ </lst>
238
+ <!-- In addition to defaults, "appends" params can be specified
239
+ to identify values which should be appended to the list of
240
+ multi-val params from the query (or the existing "defaults").
241
+ -->
242
+ <!-- In this example, the param "fq=instock:true" would be appended to
243
+ any query time fq params the user may specify, as a mechanism for
244
+ partitioning the index, independent of any user selected filtering
245
+ that may also be desired (perhaps as a result of faceted searching).
246
+
247
+ NOTE: there is *absolutely* nothing a client can do to prevent these
248
+ "appends" values from being used, so don't use this mechanism
249
+ unless you are sure you always want it.
250
+ -->
251
+ <!--
252
+ <lst name="appends">
253
+ <str name="fq">inStock:true</str>
254
+ </lst>
255
+ -->
256
+ <!-- "invariants" are a way of letting the Solr maintainer lock down
257
+ the options available to Solr clients. Any params values
258
+ specified here are used regardless of what values may be specified
259
+ in either the query, the "defaults", or the "appends" params.
260
+
261
+ In this example, the facet.field and facet.query params would
262
+ be fixed, limiting the facets clients can use. Faceting is
263
+ not turned on by default - but if the client does specify
264
+ facet=true in the request, these are the only facets they
265
+ will be able to see counts for; regardless of what other
266
+ facet.field or facet.query params they may specify.
267
+
268
+ NOTE: there is *absolutely* nothing a client can do to prevent these
269
+ "invariants" values from being used, so don't use this mechanism
270
+ unless you are sure you always want it.
271
+ -->
272
+ <!--
273
+ <lst name="invariants">
274
+ <str name="facet.field">cat</str>
275
+ <str name="facet.field">manu_exact</str>
276
+ <str name="facet.query">price:[* TO 500]</str>
277
+ <str name="facet.query">price:[500 TO *]</str>
278
+ </lst>
279
+ -->
280
+ <!-- If the default list of SearchComponents is not desired, that
281
+ list can either be overridden completely, or components can be
282
+ prepended or appended to the default list. (see below)
283
+ -->
284
+ <!--
285
+ <arr name="components">
286
+ <str>nameOfCustomComponent1</str>
287
+ <str>nameOfCustomComponent2</str>
288
+ </arr>
289
+ -->
290
+ <arr name="last-components">
291
+ <str>spellcheck</str>
292
+ </arr>
293
+
294
+ </requestHandler>
295
+
296
+ <!-- for requests to get a single document; use id=666 instead of q=id:666 -->
297
+ <requestHandler name="document" class="solr.SearchHandler" >
298
+ <lst name="defaults">
299
+ <str name="echoParams">all</str>
300
+ <str name="fl">*</str>
301
+ <str name="rows">1</str>
302
+ <str name="q">{!raw f=id v=$id}</str> <!-- use id=666 instead of q=id:666 -->
303
+ </lst>
304
+ </requestHandler>
305
+
306
+ <!-- For Advanced Search -->
307
+ <requestHandler name="advanced" class="solr.SearchHandler" >
308
+ <lst name="defaults">
309
+ <str name="defType">lucene</str>
310
+ <str name="echoParams">explicit</str>
311
+ <str name="sort">score desc, pub_date_sort desc, title_sort asc</str>
312
+ <str name="df">text</str>
313
+ <str name="q.op">AND</str>
314
+ <str name="qs">1</str>
315
+
316
+ <!-- used for dismax query parser -->
317
+ <str name="mm">1</str>
318
+ <str name="ps">3</str>
319
+ <float name="tie">0.01</float>
320
+
321
+ <!-- for user query terms in author text box -->
322
+ <str name="qf_author">
323
+ author_unstem_search^200
324
+ author_addl_unstem_search^50
325
+ author_t^20
326
+ author_addl_t
327
+ </str>
328
+ <str name="pf_author">
329
+ author_unstem_search^2000
330
+ author_addl_unstem_search^500
331
+ author_t^200
332
+ author_addl_t^10
333
+ </str>
334
+
335
+ <!-- for user query terms in title text box -->
336
+ <str name="qf_title">
337
+ title_unstem_search^50000
338
+ subtitle_unstem_search^25000
339
+ title_addl_unstem_search^10000
340
+ title_t^5000
341
+ subtitle_t^2500
342
+ title_addl_t^100
343
+ title_added_entry_unstem_search^50
344
+ title_added_entry_t^10
345
+ title_series_unstem_search^5
346
+ title_series_t
347
+ </str>
348
+ <str name="pf_title">
349
+ title_unstem_search^500000
350
+ subtitle_unstem_search^250000
351
+ title_addl_unstem_search^100000
352
+ title_t^50000
353
+ subtitle_t^25000
354
+ title_addl_t^1000
355
+ title_added_entry_unstem_search^500
356
+ title_added_entry_t^100
357
+ title_series_t^50
358
+ title_series_unstem_search^10
359
+ </str>
360
+
361
+ <!-- for user query terms in subject text box -->
362
+ <str name="qf_subject">
363
+ subject_topic_unstem_search^200
364
+ subject_unstem_search^125
365
+ subject_topic_facet^100
366
+ subject_t^50
367
+ subject_addl_unstem_search^10
368
+ subject_addl_t
369
+ </str>
370
+ <str name="pf_subject">
371
+ subject_topic_unstem_search^2000
372
+ subject_unstem_search^1250
373
+ subject_t^1000
374
+ subject_topic_facet^500
375
+ subject_addl_unstem_search^100
376
+ subject_addl_t^10
377
+ </str>
378
+
379
+ <!-- for user query terms in number text box -->
380
+ <str name="qf_number">isbn_t</str>
381
+
382
+ <!-- for user query terms in keyword text box -->
383
+ <str name="qf_keyword">text</str>
384
+ <str name="pf_keyword">text^10</str>
385
+
386
+ <!-- NOT using marc_display because it is large and will slow things down for search results -->
387
+ <str name="fl">
388
+ id,
389
+ score,
390
+ author_display,
391
+ author_vern_display,
392
+ format,
393
+ isbn_t,
394
+ language_facet,
395
+ lc_callnum_display,
396
+ material_type_display,
397
+ published_display,
398
+ published_vern_display,
399
+ pub_date,
400
+ title_display,
401
+ title_vern_display,
402
+ subject_topic_facet,
403
+ subject_geo_facet,
404
+ subject_era_facet,
405
+ subtitle_display,
406
+ subtitle_vern_display,
407
+ url_fulltext_display,
408
+ url_suppl_display,
409
+ </str>
410
+
411
+ <str name="facet">true</str>
412
+ <str name="facet.mincount">1</str>
413
+ <str name="facet.limit">10</str>
414
+ <str name="facet.field">format</str>
415
+ <str name="facet.field">lc_1letter_facet</str>
416
+ <str name="facet.field">lc_alpha_facet</str>
417
+ <str name="facet.field">lc_b4cutter_facet</str>
418
+ <str name="facet.field">language_facet</str>
419
+ <str name="facet.field">pub_date</str>
420
+ <str name="facet.field">subject_era_facet</str>
421
+ <str name="facet.field">subject_geo_facet</str>
422
+ <str name="facet.field">subject_topic_facet</str>
423
+
424
+ <str name="spellcheck">true</str>
425
+ <str name="spellcheck.dictionary">subject</str>
426
+ <str name="spellcheck.onlyMorePopular">true</str>
427
+ <str name="spellcheck.extendedResults">true</str>
428
+ <str name="spellcheck.collate">false</str>
429
+ <str name="spellcheck.count">5</str>
430
+ </lst>
431
+ <arr name="last-components">
432
+ <str>spellcheck</str>
433
+ </arr>
434
+ </requestHandler>
435
+
436
+ <!-- Spell Check
437
+
438
+ The spell check component can return a list of alternative spelling
439
+ suggestions.
440
+
441
+ http://wiki.apache.org/solr/SpellCheckComponent
442
+ -->
443
+ <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
444
+
445
+ <str name="queryAnalyzerFieldType">textSpell</str>
446
+
447
+ <!-- Multiple "Spell Checkers" can be declared and used by this
448
+ component
449
+ -->
450
+
451
+ <!-- a spellchecker built from a field of the main index, and
452
+ written to disk
453
+ -->
454
+ <lst name="spellchecker">
455
+ <str name="name">default</str>
456
+ <str name="field">spell</str>
457
+ <str name="spellcheckIndexDir">./spell</str>
458
+ <str name="buildOnOptimize">true</str>
459
+ </lst>
460
+ <lst name="spellchecker">
461
+ <str name="name">author</str>
462
+ <str name="field">author_spell</str>
463
+ <str name="spellcheckIndexDir">./spell_author</str>
464
+ <str name="accuracy">0.7</str>
465
+ <str name="buildOnOptimize">true</str>
466
+ </lst>
467
+ <lst name="spellchecker">
468
+ <str name="name">subject</str>
469
+ <str name="field">subject_spell</str>
470
+ <str name="spellcheckIndexDir">./spell_subject</str>
471
+ <str name="accuracy">0.7</str>
472
+ <str name="buildOnOptimize">true</str>
473
+ </lst>
474
+ <lst name="spellchecker">
475
+ <str name="name">title</str>
476
+ <str name="field">title_spell</str>
477
+ <str name="spellcheckIndexDir">./spell_title</str>
478
+ <str name="accuracy">0.7</str>
479
+ <str name="buildOnOptimize">true</str>
480
+ </lst>
481
+
482
+ <!-- a spellchecker that uses a different distance measure -->
483
+ <!--
484
+ <lst name="spellchecker">
485
+ <str name="name">jarowinkler</str>
486
+ <str name="field">spell</str>
487
+ <str name="distanceMeasure">
488
+ org.apache.lucene.search.spell.JaroWinklerDistance
489
+ </str>
490
+ <str name="spellcheckIndexDir">spellcheckerJaro</str>
491
+ </lst>
492
+ -->
493
+
494
+ <!-- a spellchecker that use an alternate comparator
495
+
496
+ comparatorClass be one of:
497
+ 1. score (default)
498
+ 2. freq (Frequency first, then score)
499
+ 3. A fully qualified class name
500
+ -->
501
+ <!--
502
+ <lst name="spellchecker">
503
+ <str name="name">freq</str>
504
+ <str name="field">lowerfilt</str>
505
+ <str name="spellcheckIndexDir">spellcheckerFreq</str>
506
+ <str name="comparatorClass">freq</str>
507
+ <str name="buildOnCommit">true</str>
508
+ -->
509
+
510
+ <!-- A spellchecker that reads the list of words from a file -->
511
+ <!--
512
+ <lst name="spellchecker">
513
+ <str name="classname">solr.FileBasedSpellChecker</str>
514
+ <str name="name">file</str>
515
+ <str name="sourceLocation">spellings.txt</str>
516
+ <str name="characterEncoding">UTF-8</str>
517
+ <str name="spellcheckIndexDir">spellcheckerFile</str>
518
+ </lst>
519
+ -->
520
+ </searchComponent>
521
+
522
+ </config>
523
+