arclight 0.0.1 → 1.6.2

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 (204) hide show
  1. checksums.yaml +5 -5
  2. data/.all-contributorsrc +450 -0
  3. data/.codeclimate.yml +5 -0
  4. data/.eslintrc +22 -0
  5. data/.github/workflows/ruby.yml +51 -0
  6. data/.gitignore +7 -0
  7. data/.rspec +0 -1
  8. data/.rubocop.yml +521 -0
  9. data/.rubocop_todo.yml +122 -0
  10. data/.solr_wrapper +6 -0
  11. data/CONTRIBUTING.md +43 -0
  12. data/CONTRIBUTORS.md +79 -0
  13. data/Gemfile +41 -0
  14. data/LICENSE.txt +1 -0
  15. data/README.md +100 -12
  16. data/Rakefile +13 -3
  17. data/app/assets/images/arclight/logo.png +0 -0
  18. data/app/assets/images/blacklight/bookmark.svg +1 -0
  19. data/app/assets/images/blacklight/collection.svg +5 -0
  20. data/app/assets/images/blacklight/compact.svg +1 -0
  21. data/app/assets/images/blacklight/container.svg +5 -0
  22. data/app/assets/images/blacklight/ead.svg +1 -0
  23. data/app/assets/images/blacklight/file.svg +5 -0
  24. data/app/assets/images/blacklight/folder.svg +1 -0
  25. data/app/assets/images/blacklight/list.svg +1 -0
  26. data/app/assets/images/blacklight/minus.svg +1 -0
  27. data/app/assets/images/blacklight/online.svg +5 -0
  28. data/app/assets/images/blacklight/pdf.svg +1 -0
  29. data/app/assets/images/blacklight/plus.svg +1 -0
  30. data/app/assets/images/blacklight/repository.svg +1 -0
  31. data/app/assets/javascripts/arclight/arclight.js +4 -0
  32. data/app/assets/javascripts/arclight/oembed_controller.js +58 -0
  33. data/app/assets/javascripts/arclight/truncate_controller.js +27 -0
  34. data/app/assets/stylesheets/arclight/application.scss +14 -0
  35. data/app/assets/stylesheets/arclight/build.scss +4 -0
  36. data/app/assets/stylesheets/arclight/modules/collection_search.scss +3 -0
  37. data/app/assets/stylesheets/arclight/modules/hierarchy_and_online_contents.scss +155 -0
  38. data/app/assets/stylesheets/arclight/modules/highlights.scss +11 -0
  39. data/app/assets/stylesheets/arclight/modules/icons.scss +20 -0
  40. data/app/assets/stylesheets/arclight/modules/layout.scss +220 -0
  41. data/app/assets/stylesheets/arclight/modules/mastheads.scss +42 -0
  42. data/app/assets/stylesheets/arclight/modules/repositories.scss +25 -0
  43. data/app/assets/stylesheets/arclight/modules/repository_card.scss +9 -0
  44. data/app/assets/stylesheets/arclight/modules/search_form.scss +9 -0
  45. data/app/assets/stylesheets/arclight/modules/search_results.scss +250 -0
  46. data/app/assets/stylesheets/arclight/modules/show_collection.scss +38 -0
  47. data/app/assets/stylesheets/arclight/modules/truncator.scss +58 -0
  48. data/app/assets/stylesheets/arclight/responsive.scss +13 -0
  49. data/app/assets/stylesheets/arclight/variables.scss +25 -0
  50. data/app/components/arclight/access_component.html.erb +14 -0
  51. data/app/components/arclight/access_component.rb +25 -0
  52. data/app/components/arclight/bookmark_component.html.erb +25 -0
  53. data/app/components/arclight/bookmark_component.rb +9 -0
  54. data/app/components/arclight/breadcrumb_component.rb +50 -0
  55. data/app/components/arclight/breadcrumbs_hierarchy_component.html.erb +34 -0
  56. data/app/components/arclight/breadcrumbs_hierarchy_component.rb +25 -0
  57. data/app/components/arclight/collection_context_component.html.erb +12 -0
  58. data/app/components/arclight/collection_context_component.rb +27 -0
  59. data/app/components/arclight/collection_info_component.html.erb +28 -0
  60. data/app/components/arclight/collection_info_component.rb +26 -0
  61. data/app/components/arclight/collection_sidebar_component.html.erb +15 -0
  62. data/app/components/arclight/collection_sidebar_component.rb +39 -0
  63. data/app/components/arclight/constraints_component.html.erb +7 -0
  64. data/app/components/arclight/constraints_component.rb +17 -0
  65. data/app/components/arclight/document_collection_context_component.html.erb +29 -0
  66. data/app/components/arclight/document_collection_context_component.rb +28 -0
  67. data/app/components/arclight/document_collection_hierarchy_component.html.erb +50 -0
  68. data/app/components/arclight/document_collection_hierarchy_component.rb +62 -0
  69. data/app/components/arclight/document_component.html.erb +39 -0
  70. data/app/components/arclight/document_component.rb +49 -0
  71. data/app/components/arclight/document_components_hierarchy_component.html.erb +20 -0
  72. data/app/components/arclight/document_components_hierarchy_component.rb +34 -0
  73. data/app/components/arclight/document_download_component.html.erb +24 -0
  74. data/app/components/arclight/document_download_component.rb +71 -0
  75. data/app/components/arclight/embed_component.html.erb +10 -0
  76. data/app/components/arclight/embed_component.rb +43 -0
  77. data/app/components/arclight/expand_hierarchy_button_component.html.erb +5 -0
  78. data/app/components/arclight/expand_hierarchy_button_component.rb +16 -0
  79. data/app/components/arclight/group_component.html.erb +34 -0
  80. data/app/components/arclight/group_component.rb +23 -0
  81. data/app/components/arclight/header_component.html.erb +5 -0
  82. data/app/components/arclight/header_component.rb +10 -0
  83. data/app/components/arclight/index_metadata_field_component.html.erb +16 -0
  84. data/app/components/arclight/index_metadata_field_component.rb +20 -0
  85. data/app/components/arclight/masthead_component.html.erb +17 -0
  86. data/app/components/arclight/masthead_component.rb +10 -0
  87. data/app/components/arclight/metadata_section_component.html.erb +13 -0
  88. data/app/components/arclight/metadata_section_component.rb +22 -0
  89. data/app/components/arclight/oembed_viewer_component.html.erb +5 -0
  90. data/app/components/arclight/oembed_viewer_component.rb +16 -0
  91. data/app/components/arclight/online_content_filter_component.html.erb +15 -0
  92. data/app/components/arclight/online_content_filter_component.rb +17 -0
  93. data/app/components/arclight/online_status_indicator_component.rb +19 -0
  94. data/app/components/arclight/repository_breadcrumb_component.html.erb +10 -0
  95. data/app/components/arclight/repository_breadcrumb_component.rb +17 -0
  96. data/app/components/arclight/repository_location_component.html.erb +20 -0
  97. data/app/components/arclight/repository_location_component.rb +10 -0
  98. data/app/components/arclight/search_bar_component.html.erb +27 -0
  99. data/app/components/arclight/search_bar_component.rb +32 -0
  100. data/app/components/arclight/search_result_breadcrumbs_component.html.erb +6 -0
  101. data/app/components/arclight/search_result_breadcrumbs_component.rb +37 -0
  102. data/app/components/arclight/search_result_component.html.erb +20 -0
  103. data/app/components/arclight/search_result_component.rb +18 -0
  104. data/app/components/arclight/search_result_title_component.html.erb +15 -0
  105. data/app/components/arclight/search_result_title_component.rb +15 -0
  106. data/app/components/arclight/sidebar_component.html.erb +9 -0
  107. data/app/components/arclight/sidebar_component.rb +19 -0
  108. data/app/components/arclight/upper_metadata_layout_component.rb +10 -0
  109. data/app/components/blacklight/icons/bookmark_component.rb +12 -0
  110. data/app/components/blacklight/icons/collection_component.rb +14 -0
  111. data/app/components/blacklight/icons/compact_component.rb +12 -0
  112. data/app/components/blacklight/icons/container_component.rb +14 -0
  113. data/app/components/blacklight/icons/ead_component.rb +12 -0
  114. data/app/components/blacklight/icons/file_component.rb +14 -0
  115. data/app/components/blacklight/icons/folder_component.rb +12 -0
  116. data/app/components/blacklight/icons/online_component.rb +15 -0
  117. data/app/components/blacklight/icons/pdf_component.rb +12 -0
  118. data/app/components/blacklight/icons/repository_component.rb +12 -0
  119. data/app/controllers/arclight/repositories_controller.rb +40 -0
  120. data/app/helpers/arclight/ead_format_helpers.rb +309 -0
  121. data/app/helpers/arclight/field_config_helpers.rb +26 -0
  122. data/app/helpers/arclight_helper.rb +108 -0
  123. data/app/models/arclight/document_downloads.rb +122 -0
  124. data/app/models/arclight/parent.rb +24 -0
  125. data/app/models/arclight/parents.rb +39 -0
  126. data/app/models/arclight/requests/aeon_external_request.rb +42 -0
  127. data/app/models/arclight/requests/aeon_web_ead.rb +52 -0
  128. data/app/models/arclight/requests/google_form.rb +49 -0
  129. data/app/models/concerns/arclight/catalog.rb +44 -0
  130. data/app/models/concerns/arclight/search_behavior.rb +47 -0
  131. data/app/models/concerns/arclight/solr_document.rb +160 -0
  132. data/app/presenters/arclight/index_presenter.rb +10 -0
  133. data/app/presenters/arclight/show_presenter.rb +54 -0
  134. data/app/views/arclight/.keep +0 -0
  135. data/app/views/arclight/_requests.html.erb +7 -0
  136. data/app/views/arclight/repositories/_repository.html.erb +43 -0
  137. data/app/views/arclight/repositories/index.html.erb +9 -0
  138. data/app/views/arclight/repositories/show.html.erb +37 -0
  139. data/app/views/arclight/requests/_aeon_external_request_endpoint.html.erb +8 -0
  140. data/app/views/arclight/requests/_aeon_web_ead.html.erb +6 -0
  141. data/app/views/arclight/requests/_google_form.html.erb +10 -0
  142. data/app/views/catalog/_document_list.html.erb +8 -0
  143. data/app/views/catalog/_group.html.erb +4 -0
  144. data/app/views/catalog/_group_toggle.html.erb +10 -0
  145. data/app/views/catalog/_search_results_header.html.erb +3 -0
  146. data/app/views/catalog/hierarchy.html.erb +19 -0
  147. data/app/views/catalog/index.html.erb +17 -0
  148. data/app/views/shared/_breadcrumbs.html.erb +3 -0
  149. data/app/views/shared/_main_menu_links.html.erb +6 -0
  150. data/arclight.gemspec +29 -11
  151. data/bin/rails +13 -0
  152. data/config/breadcrumbs.rb +24 -0
  153. data/config/i18n-tasks.yml +134 -0
  154. data/config/importmap.rb +3 -0
  155. data/config/locales/arclight.en.yml +100 -0
  156. data/config/repositories.yml +0 -0
  157. data/config/routes.rb +6 -0
  158. data/docker-compose.yml +16 -0
  159. data/lib/arclight/digital_object.rb +27 -0
  160. data/lib/arclight/engine.rb +47 -0
  161. data/lib/arclight/exceptions.rb +19 -0
  162. data/lib/arclight/hash_absolute_xpath.rb +62 -0
  163. data/lib/arclight/level_label.rb +46 -0
  164. data/lib/arclight/missing_id_strategy.rb +21 -0
  165. data/lib/arclight/normalized_date.rb +49 -0
  166. data/lib/arclight/normalized_id.rb +30 -0
  167. data/lib/arclight/normalized_title.rb +33 -0
  168. data/lib/arclight/repository.rb +116 -0
  169. data/lib/arclight/routes/hierarchy.rb +19 -0
  170. data/lib/arclight/routes.rb +8 -0
  171. data/lib/arclight/traject/ead2_component_config.rb +335 -0
  172. data/lib/arclight/traject/ead2_config.rb +316 -0
  173. data/lib/arclight/traject/nokogiri_namespaceless_reader.rb +22 -0
  174. data/lib/arclight/version.rb +3 -1
  175. data/lib/arclight/year_range.rb +111 -0
  176. data/lib/arclight.rb +11 -1
  177. data/lib/generators/arclight/install_generator.rb +163 -0
  178. data/lib/generators/arclight/templates/arclight.scss +6 -0
  179. data/lib/generators/arclight/templates/catalog_controller.rb +423 -0
  180. data/lib/generators/arclight/templates/config/downloads.yml +25 -0
  181. data/lib/generators/arclight/templates/config/locales/arclight.en.yml +61 -0
  182. data/lib/generators/arclight/templates/config/repositories.yml +53 -0
  183. data/lib/generators/arclight/update_generator.rb +22 -0
  184. data/lib/tasks/index.rake +84 -0
  185. data/package.json +30 -0
  186. data/solr/conf/_rest_managed.json +3 -0
  187. data/solr/conf/admin-extra.html +31 -0
  188. data/solr/conf/elevate.xml +36 -0
  189. data/solr/conf/mapping-ISOLatin1Accent.txt +246 -0
  190. data/solr/conf/protwords.txt +21 -0
  191. data/solr/conf/schema.xml +400 -0
  192. data/solr/conf/solrconfig.xml +328 -0
  193. data/solr/conf/spellings.txt +2 -0
  194. data/solr/conf/stopwords.txt +58 -0
  195. data/solr/conf/stopwords_en.txt +58 -0
  196. data/solr/conf/synonyms.txt +31 -0
  197. data/solr/conf/xslt/example.xsl +132 -0
  198. data/solr/conf/xslt/example_atom.xsl +67 -0
  199. data/solr/conf/xslt/example_rss.xsl +66 -0
  200. data/solr/conf/xslt/luke.xsl +337 -0
  201. data/tasks/arclight.rake +79 -0
  202. data/template.rb +10 -0
  203. metadata +440 -20
  204. data/.travis.yml +0 -5
@@ -0,0 +1,328 @@
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
+
25
+ <!-- Controls what version of Lucene various components of Solr
26
+ adhere to. Generally, you want to use the latest version to
27
+ get all bug fixes and improvements. It is highly recommended
28
+ that you fully re-index after changing this setting as it can
29
+ affect both how text is indexed and queried.
30
+ -->
31
+ <luceneMatchVersion>8.2.0</luceneMatchVersion>
32
+
33
+ <lib dir="${solr.install.dir:../../../..}/modules/analysis-extras/lib" />
34
+ <lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lib" />
35
+ <lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lucene-libs" />
36
+
37
+ <directoryFactory name="DirectoryFactory"
38
+ class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}">
39
+ </directoryFactory>
40
+
41
+ <codecFactory class="solr.SchemaCodecFactory"/>
42
+
43
+ <schemaFactory class="ClassicIndexSchemaFactory"/>
44
+
45
+
46
+ <dataDir>${solr.blacklight-core.data.dir:}</dataDir>
47
+
48
+ <requestDispatcher handleSelect="true" >
49
+ <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="2048" />
50
+ </requestDispatcher>
51
+
52
+ <requestHandler name="/analysis/field" startup="lazy" class="solr.FieldAnalysisRequestHandler" />
53
+
54
+ <!-- config for the admin interface -->
55
+ <admin>
56
+ <defaultQuery>*:*</defaultQuery>
57
+ </admin>
58
+
59
+ <!-- SearchHandler
60
+
61
+ http://wiki.apache.org/solr/SearchHandler
62
+
63
+ For processing Search Queries, the primary Request Handler
64
+ provided with Solr is "SearchHandler" It delegates to a sequent
65
+ of SearchComponents (see below) and supports distributed
66
+ queries across multiple shards
67
+ -->
68
+ <requestHandler name="search" class="solr.SearchHandler" default="true">
69
+ <!-- default values for query parameters can be specified, these
70
+ will be overridden by parameters in the request
71
+ -->
72
+ <lst name="defaults">
73
+ <str name="defType">edismax</str>
74
+ <str name="echoParams">explicit</str>
75
+ <int name="rows">10</int>
76
+
77
+ <str name="q.alt">*:*</str>
78
+
79
+ <!-- Minimum Should Match parameter (mm) -->
80
+ <str name="mm">4&lt;90%</str>
81
+ <!-- 1-4 term query, all must match
82
+ 5+ term query, 90% must match; rounded down, so e.g.:
83
+ * 5-10 term query, all but one must match
84
+ * 11-20 term query, all but two must match
85
+ * 21-29 term query, all but three must match, etc.
86
+ -->
87
+
88
+ <!-- this qf and pf are used by default, if not otherwise specified by
89
+ client. The default blacklight_config will use these for the
90
+ "keywords" search. See the author_qf/author_pf, title_qf, etc
91
+ below, which the default blacklight_config will specify for
92
+ those searches. You may also be interested in:
93
+ http://wiki.apache.org/solr/LocalParams
94
+ -->
95
+
96
+ <!-- In general, matches using the pf parameter should be boosted higher
97
+ than qf, so the proximity of multiple search terms in the matching
98
+ documents is significant in relevance scoring. See:
99
+ https://solr.apache.org/guide/solr/latest/query-guide/dismax-query-parser.html#pf-phrase-fields-parameter
100
+ -->
101
+ <str name="qf">
102
+ collection_title_tesim^150
103
+ title_tesim^100
104
+ normalized_title_teim^100
105
+ unitid_identifier_match^40
106
+ name_teim^10
107
+ place_teim^10
108
+ subject_teim^2
109
+ id
110
+ ead_ssi
111
+ ref_ssm
112
+ unitid_ssm
113
+ container_teim
114
+ parent_unittitles_tesim
115
+ text
116
+ </str>
117
+ <str name="pf">
118
+ collection_title_tesim^300
119
+ title_tesim^200
120
+ normalized_title_teim^200
121
+ unitid_identifier_match^80
122
+ name_teim^20
123
+ place_teim^20
124
+ subject_teim^5
125
+ id^2
126
+ ead_ssi^2
127
+ ref_ssm^2
128
+ unitid_ssm^2
129
+ container_teim^2
130
+ parent_unittitles_tesim^2
131
+ text^2
132
+ </str>
133
+
134
+ <str name="qf_container">
135
+ container_teim
136
+ </str>
137
+ <str name="pf_container">
138
+ container_teim^2
139
+ </str>
140
+ <str name="qf_identifier">
141
+ id
142
+ ead_ssi
143
+ ref_ssm
144
+ unitid_ssm
145
+ unitid_identifier_match
146
+ </str>
147
+ <str name="pf_identifier">
148
+ id^2
149
+ ead_ssi^2
150
+ ref_ssm^2
151
+ unitid_ssm^2
152
+ unitid_identifier_match^2
153
+ </str>
154
+ <str name="qf_name">
155
+ name_teim
156
+ </str>
157
+ <str name="pf_name">
158
+ name_teim^2
159
+ </str>
160
+ <str name="qf_place">
161
+ place_teim
162
+ </str>
163
+ <str name="pf_place">
164
+ place_teim^2
165
+ </str>
166
+ <str name="qf_subject">
167
+ subject_teim
168
+ </str>
169
+ <str name="pf_subject">
170
+ subject_teim^2
171
+ </str>
172
+ <str name="qf_title">
173
+ title_tesim
174
+ normalized_title_teim
175
+ </str>
176
+ <str name="pf_title">
177
+ title_tesim^2
178
+ normalized_title_teim^2
179
+ </str>
180
+
181
+ <int name="ps">3</int>
182
+ <float name="tie">0.01</float>
183
+
184
+ <str name="fl">*</str>
185
+
186
+ <str name="facet">true</str>
187
+ <str name="facet.mincount">1</str>
188
+ <str name="facet.field">level_ssim</str>
189
+ <str name="facet.field">creator_ssim</str>
190
+ <str name="facet.field">date_range_isim</str>
191
+ <str name="facet.field">names_ssim</str>
192
+ <str name="facet.field">geogname_ssim</str>
193
+ <str name="facet.field">access_subjects_ssim</str>
194
+ <str name="facet.field">repository_ssim</str>
195
+ <str name="facet.field">collection_ssim</str>
196
+
197
+ <str name="spellcheck">true</str>
198
+ <str name="spellcheck.dictionary">default</str>
199
+ <str name="spellcheck.onlyMorePopular">true</str>
200
+ <str name="spellcheck.extendedResults">true</str>
201
+ <str name="spellcheck.collate">false</str>
202
+ <str name="spellcheck.count">5</str>
203
+ </lst>
204
+ <arr name="last-components">
205
+ <str>spellcheck</str>
206
+ </arr>
207
+ </requestHandler>
208
+
209
+ <!-- for requests to get a single document; use id=666 instead of q=id:666 -->
210
+ <requestHandler name="document" class="solr.SearchHandler" >
211
+ <lst name="defaults">
212
+ <str name="echoParams">all</str>
213
+ <str name="fl">*</str>
214
+ <str name="rows">1</str>
215
+ <str name="q">{!term f=id v=$id}</str> <!-- use id=666 instead of q=id:666 -->
216
+ </lst>
217
+ </requestHandler>
218
+
219
+ <!-- Spell Check
220
+
221
+ The spell check component can return a list of alternative spelling
222
+ suggestions.
223
+
224
+ http://wiki.apache.org/solr/SpellCheckComponent
225
+ -->
226
+ <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
227
+
228
+ <str name="queryAnalyzerFieldType">textSpell</str>
229
+
230
+ <!-- Multiple "Spell Checkers" can be declared and used by this
231
+ component
232
+ -->
233
+
234
+ <!-- a spellchecker built from a field of the main index, and
235
+ written to disk
236
+ -->
237
+ <lst name="spellchecker">
238
+ <str name="name">default</str>
239
+ <str name="field">spell</str>
240
+ <str name="spellcheckIndexDir">./spell</str>
241
+ <str name="buildOnOptimize">true</str>
242
+ </lst>
243
+ <lst name="spellchecker">
244
+ <str name="name">author</str>
245
+ <str name="field">author_spell</str>
246
+ <str name="spellcheckIndexDir">./spell_author</str>
247
+ <str name="accuracy">0.7</str>
248
+ <str name="buildOnOptimize">true</str>
249
+ </lst>
250
+ <lst name="spellchecker">
251
+ <str name="name">subject</str>
252
+ <str name="field">subject_spell</str>
253
+ <str name="spellcheckIndexDir">./spell_subject</str>
254
+ <str name="accuracy">0.7</str>
255
+ <str name="buildOnOptimize">true</str>
256
+ </lst>
257
+ <lst name="spellchecker">
258
+ <str name="name">title</str>
259
+ <str name="field">title_spell</str>
260
+ <str name="spellcheckIndexDir">./spell_title</str>
261
+ <str name="accuracy">0.7</str>
262
+ <str name="buildOnOptimize">true</str>
263
+ </lst>
264
+
265
+ <!-- a spellchecker that uses a different distance measure -->
266
+ <!--
267
+ <lst name="spellchecker">
268
+ <str name="name">jarowinkler</str>
269
+ <str name="field">spell</str>
270
+ <str name="distanceMeasure">
271
+ org.apache.lucene.search.spell.JaroWinklerDistance
272
+ </str>
273
+ <str name="spellcheckIndexDir">spellcheckerJaro</str>
274
+ </lst>
275
+ -->
276
+
277
+ <!-- a spellchecker that use an alternate comparator
278
+
279
+ comparatorClass be one of:
280
+ 1. score (default)
281
+ 2. freq (Frequency first, then score)
282
+ 3. A fully qualified class name
283
+ -->
284
+ <!--
285
+ <lst name="spellchecker">
286
+ <str name="name">freq</str>
287
+ <str name="field">lowerfilt</str>
288
+ <str name="spellcheckIndexDir">spellcheckerFreq</str>
289
+ <str name="comparatorClass">freq</str>
290
+ <str name="buildOnCommit">true</str>
291
+ -->
292
+
293
+ <!-- A spellchecker that reads the list of words from a file -->
294
+ <!--
295
+ <lst name="spellchecker">
296
+ <str name="classname">solr.FileBasedSpellChecker</str>
297
+ <str name="name">file</str>
298
+ <str name="sourceLocation">spellings.txt</str>
299
+ <str name="characterEncoding">UTF-8</str>
300
+ <str name="spellcheckIndexDir">spellcheckerFile</str>
301
+ </lst>
302
+ -->
303
+ </searchComponent>
304
+
305
+ <searchComponent name="suggest" class="solr.SuggestComponent">
306
+ <lst name="suggester">
307
+ <str name="name">mySuggester</str>
308
+ <str name="lookupImpl">AnalyzingInfixLookupFactory</str>
309
+ <str name="indexPath">suggester_infix_dir</str>
310
+ <str name="highlight">false</str>
311
+ <str name="suggestAnalyzerFieldType">text</str>
312
+ <str name="buildOnCommit">true</str>
313
+ <str name="field">suggest</str>
314
+ </lst>
315
+ </searchComponent>
316
+
317
+ <requestHandler name="/suggest" class="solr.SearchHandler" startup="lazy">
318
+ <lst name="defaults">
319
+ <str name="suggest">true</str>
320
+ <str name="suggest.count">5</str>
321
+ <str name="suggest.dictionary">mySuggester</str>
322
+ </lst>
323
+ <arr name="components">
324
+ <str>suggest</str>
325
+ </arr>
326
+ </requestHandler>
327
+
328
+ </config>
@@ -0,0 +1,2 @@
1
+ pizza
2
+ history
@@ -0,0 +1,58 @@
1
+ # Licensed to the Apache Software Foundation (ASF) under one or more
2
+ # contributor license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright ownership.
4
+ # The ASF licenses this file to You under the Apache License, Version 2.0
5
+ # (the "License"); you may not use this file except in compliance with
6
+ # the License. You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ #-----------------------------------------------------------------------
17
+ # a couple of test stopwords to test that the words are really being
18
+ # configured from this file:
19
+ stopworda
20
+ stopwordb
21
+
22
+ #Standard english stop words taken from Lucene's StopAnalyzer
23
+ a
24
+ an
25
+ and
26
+ are
27
+ as
28
+ at
29
+ be
30
+ but
31
+ by
32
+ for
33
+ if
34
+ in
35
+ into
36
+ is
37
+ it
38
+ no
39
+ not
40
+ of
41
+ on
42
+ or
43
+ s
44
+ such
45
+ t
46
+ that
47
+ the
48
+ their
49
+ then
50
+ there
51
+ these
52
+ they
53
+ this
54
+ to
55
+ was
56
+ will
57
+ with
58
+
@@ -0,0 +1,58 @@
1
+ # Licensed to the Apache Software Foundation (ASF) under one or more
2
+ # contributor license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright ownership.
4
+ # The ASF licenses this file to You under the Apache License, Version 2.0
5
+ # (the "License"); you may not use this file except in compliance with
6
+ # the License. You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ #-----------------------------------------------------------------------
17
+ # a couple of test stopwords to test that the words are really being
18
+ # configured from this file:
19
+ stopworda
20
+ stopwordb
21
+
22
+ #Standard english stop words taken from Lucene's StopAnalyzer
23
+ a
24
+ an
25
+ and
26
+ are
27
+ as
28
+ at
29
+ be
30
+ but
31
+ by
32
+ for
33
+ if
34
+ in
35
+ into
36
+ is
37
+ it
38
+ no
39
+ not
40
+ of
41
+ on
42
+ or
43
+ s
44
+ such
45
+ t
46
+ that
47
+ the
48
+ their
49
+ then
50
+ there
51
+ these
52
+ they
53
+ this
54
+ to
55
+ was
56
+ will
57
+ with
58
+
@@ -0,0 +1,31 @@
1
+ # The ASF licenses this file to You under the Apache License, Version 2.0
2
+ # (the "License"); you may not use this file except in compliance with
3
+ # the License. You may obtain a copy of the License at
4
+ #
5
+ # http://www.apache.org/licenses/LICENSE-2.0
6
+ #
7
+ # Unless required by applicable law or agreed to in writing, software
8
+ # distributed under the License is distributed on an "AS IS" BASIS,
9
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ # See the License for the specific language governing permissions and
11
+ # limitations under the License.
12
+
13
+ #-----------------------------------------------------------------------
14
+ #some test synonym mappings unlikely to appear in real input text
15
+ aaa => aaaa
16
+ bbb => bbbb1 bbbb2
17
+ ccc => cccc1,cccc2
18
+ a\=>a => b\=>b
19
+ a\,a => b\,b
20
+ fooaaa,baraaa,bazaaa
21
+
22
+ # Some synonym groups specific to this example
23
+ GB,gib,gigabyte,gigabytes
24
+ MB,mib,megabyte,megabytes
25
+ Television, Televisions, TV, TVs
26
+ #notice we use "gib" instead of "GiB" so any WordDelimiterFilter coming
27
+ #after us won't split it into two words.
28
+
29
+ # Synonym mappings can be used for spelling correction too
30
+ pixima => pixma
31
+
@@ -0,0 +1,132 @@
1
+ <?xml version='1.0' encoding='UTF-8'?>
2
+
3
+ <!--
4
+ * Licensed to the Apache Software Foundation (ASF) under one or more
5
+ * contributor license agreements. See the NOTICE file distributed with
6
+ * this work for additional information regarding copyright ownership.
7
+ * The ASF licenses this file to You under the Apache License, Version 2.0
8
+ * (the "License"); you may not use this file except in compliance with
9
+ * the License. You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ -->
19
+
20
+ <!--
21
+ Simple transform of Solr query results to HTML
22
+ -->
23
+ <xsl:stylesheet version='1.0'
24
+ xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
25
+ >
26
+
27
+ <xsl:output media-type="text/html; charset=UTF-8" encoding="UTF-8"/>
28
+
29
+ <xsl:variable name="title" select="concat('Solr search results (',response/result/@numFound,' documents)')"/>
30
+
31
+ <xsl:template match='/'>
32
+ <html>
33
+ <head>
34
+ <title><xsl:value-of select="$title"/></title>
35
+ <xsl:call-template name="css"/>
36
+ </head>
37
+ <body>
38
+ <h1><xsl:value-of select="$title"/></h1>
39
+ <div class="note">
40
+ This has been formatted by the sample "example.xsl" transform -
41
+ use your own XSLT to get a nicer page
42
+ </div>
43
+ <xsl:apply-templates select="response/result/doc"/>
44
+ </body>
45
+ </html>
46
+ </xsl:template>
47
+
48
+ <xsl:template match="doc">
49
+ <xsl:variable name="pos" select="position()"/>
50
+ <div class="doc">
51
+ <table width="100%">
52
+ <xsl:apply-templates>
53
+ <xsl:with-param name="pos"><xsl:value-of select="$pos"/></xsl:with-param>
54
+ </xsl:apply-templates>
55
+ </table>
56
+ </div>
57
+ </xsl:template>
58
+
59
+ <xsl:template match="doc/*[@name='score']" priority="100">
60
+ <xsl:param name="pos"></xsl:param>
61
+ <tr>
62
+ <td class="name">
63
+ <xsl:value-of select="@name"/>
64
+ </td>
65
+ <td class="value">
66
+ <xsl:value-of select="."/>
67
+
68
+ <xsl:if test="boolean(//lst[@name='explain'])">
69
+ <xsl:element name="a">
70
+ <!-- can't allow whitespace here -->
71
+ <xsl:attribute name="href">javascript:toggle("<xsl:value-of select="concat('exp-',$pos)" />");</xsl:attribute>?</xsl:element>
72
+ <br/>
73
+ <xsl:element name="div">
74
+ <xsl:attribute name="class">exp</xsl:attribute>
75
+ <xsl:attribute name="id">
76
+ <xsl:value-of select="concat('exp-',$pos)" />
77
+ </xsl:attribute>
78
+ <xsl:value-of select="//lst[@name='explain']/str[position()=$pos]"/>
79
+ </xsl:element>
80
+ </xsl:if>
81
+ </td>
82
+ </tr>
83
+ </xsl:template>
84
+
85
+ <xsl:template match="doc/arr" priority="100">
86
+ <tr>
87
+ <td class="name">
88
+ <xsl:value-of select="@name"/>
89
+ </td>
90
+ <td class="value">
91
+ <ul>
92
+ <xsl:for-each select="*">
93
+ <li><xsl:value-of select="."/></li>
94
+ </xsl:for-each>
95
+ </ul>
96
+ </td>
97
+ </tr>
98
+ </xsl:template>
99
+
100
+
101
+ <xsl:template match="doc/*">
102
+ <tr>
103
+ <td class="name">
104
+ <xsl:value-of select="@name"/>
105
+ </td>
106
+ <td class="value">
107
+ <xsl:value-of select="."/>
108
+ </td>
109
+ </tr>
110
+ </xsl:template>
111
+
112
+ <xsl:template match="*"/>
113
+
114
+ <xsl:template name="css">
115
+ <script>
116
+ function toggle(id) {
117
+ var obj = document.getElementById(id);
118
+ obj.style.display = (obj.style.display != 'block') ? 'block' : 'none';
119
+ }
120
+ </script>
121
+ <style type="text/css">
122
+ body { font-family: "Lucida Grande", sans-serif }
123
+ td.name { font-style: italic; font-size:80%; }
124
+ td { vertical-align: top; }
125
+ ul { margin: 0px; margin-left: 1em; padding: 0px; }
126
+ .note { font-size:80%; }
127
+ .doc { margin-top: 1em; border-top: solid grey 1px; }
128
+ .exp { display: none; font-family: monospace; white-space: pre; }
129
+ </style>
130
+ </xsl:template>
131
+
132
+ </xsl:stylesheet>
@@ -0,0 +1,67 @@
1
+ <?xml version='1.0' encoding='UTF-8'?>
2
+
3
+ <!--
4
+ * Licensed to the Apache Software Foundation (ASF) under one or more
5
+ * contributor license agreements. See the NOTICE file distributed with
6
+ * this work for additional information regarding copyright ownership.
7
+ * The ASF licenses this file to You under the Apache License, Version 2.0
8
+ * (the "License"); you may not use this file except in compliance with
9
+ * the License. You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ -->
19
+
20
+ <!--
21
+ Simple transform of Solr query results to Atom
22
+ -->
23
+
24
+ <xsl:stylesheet version='1.0'
25
+ xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
26
+
27
+ <xsl:output
28
+ method="xml"
29
+ encoding="utf-8"
30
+ media-type="text/xml; charset=UTF-8"
31
+ />
32
+
33
+ <xsl:template match='/'>
34
+ <xsl:variable name="query" select="response/lst[@name='responseHeader']/lst[@name='params']/str[@name='q']"/>
35
+ <feed xmlns="http://www.w3.org/2005/Atom">
36
+ <title>Example Solr Atom 1.0 Feed</title>
37
+ <subtitle>
38
+ This has been formatted by the sample "example_atom.xsl" transform -
39
+ use your own XSLT to get a nicer Atom feed.
40
+ </subtitle>
41
+ <author>
42
+ <name>Apache Solr</name>
43
+ <email>solr-user@lucene.apache.org</email>
44
+ </author>
45
+ <link rel="self" type="application/atom+xml"
46
+ href="http://localhost:8983/solr/q={$query}&amp;wt=xslt&amp;tr=atom.xsl"/>
47
+ <updated>
48
+ <xsl:value-of select="response/result/doc[position()=1]/date[@name='timestamp']"/>
49
+ </updated>
50
+ <id>tag:localhost,2007:example</id>
51
+ <xsl:apply-templates select="response/result/doc"/>
52
+ </feed>
53
+ </xsl:template>
54
+
55
+ <!-- search results xslt -->
56
+ <xsl:template match="doc">
57
+ <xsl:variable name="id" select="str[@name='id']"/>
58
+ <entry>
59
+ <title><xsl:value-of select="str[@name='name']"/></title>
60
+ <link href="http://localhost:8983/solr/select?q={$id}"/>
61
+ <id>tag:localhost,2007:<xsl:value-of select="$id"/></id>
62
+ <summary><xsl:value-of select="arr[@name='features']"/></summary>
63
+ <updated><xsl:value-of select="date[@name='timestamp']"/></updated>
64
+ </entry>
65
+ </xsl:template>
66
+
67
+ </xsl:stylesheet>