blacklight_allmaps 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +107 -0
  3. data/.gitignore +20 -0
  4. data/.standard.yml +1 -0
  5. data/Gemfile +50 -0
  6. data/app/assets/images/blacklight_allmaps/.keep +0 -0
  7. data/app/assets/stylesheets/blacklight/allmaps/base.scss +4 -1
  8. data/app/assets/stylesheets/blacklight/allmaps/modules/leaflet.opacity.css +76 -0
  9. data/app/jobs/blacklight/allmaps/store_sidecar_annotation.rb +3 -0
  10. data/app/models/concerns/.keep +0 -0
  11. data/blacklight_allmaps.gemspec +34 -0
  12. data/doc/Proposal_Eric_Larson_Ian_Spangler_4CE510.pdf +0 -0
  13. data/doc/allmaps_branding_screenshot.png +0 -0
  14. data/doc/allmaps_screenshot.png +0 -0
  15. data/doc/allmaps_screenshot_window.png +0 -0
  16. data/doc/development.md +72 -0
  17. data/doc/gbl_screenshot.png +0 -0
  18. data/doc/gbl_screenshot_window.png +0 -0
  19. data/doc/georeferenced_facet.png +0 -0
  20. data/doc/screenshot_layers.acorn +0 -0
  21. data/doc/screenshot_layers.png +0 -0
  22. data/lib/blacklight/allmaps/tasks/index.rake +1 -0
  23. data/lib/blacklight/allmaps/version.rb +1 -1
  24. data/lib/blacklight/allmaps.rb +10 -2
  25. data/lib/generators/blacklight/allmaps/blacklight_generator.rb +9 -3
  26. data/lib/generators/blacklight/allmaps/config_generator.rb +7 -1
  27. data/lib/generators/blacklight/allmaps/geoblacklight_generator.rb +10 -1
  28. data/lib/generators/blacklight/allmaps/templates/package.json +6 -0
  29. data/package.json +43 -0
  30. data/rollup.config.js +43 -0
  31. data/solr/blacklight/conf/_rest_managed.json +3 -0
  32. data/solr/blacklight/conf/admin-extra.html +31 -0
  33. data/solr/blacklight/conf/elevate.xml +36 -0
  34. data/solr/blacklight/conf/mapping-ISOLatin1Accent.txt +246 -0
  35. data/solr/blacklight/conf/protwords.txt +21 -0
  36. data/solr/blacklight/conf/schema.xml +388 -0
  37. data/solr/blacklight/conf/scripts.conf +24 -0
  38. data/solr/blacklight/conf/solrconfig.xml +265 -0
  39. data/solr/blacklight/conf/spellings.txt +2 -0
  40. data/solr/blacklight/conf/stopwords.txt +58 -0
  41. data/solr/blacklight/conf/stopwords_en.txt +58 -0
  42. data/solr/blacklight/conf/synonyms.txt +31 -0
  43. data/solr/blacklight/conf/xslt/example.xsl +132 -0
  44. data/solr/blacklight/conf/xslt/example_atom.xsl +67 -0
  45. data/solr/blacklight/conf/xslt/example_rss.xsl +66 -0
  46. data/solr/blacklight/conf/xslt/luke.xsl +337 -0
  47. data/solr/geoblacklight/conf/_rest_managed.json +3 -0
  48. data/solr/geoblacklight/conf/admin-extra.html +31 -0
  49. data/solr/geoblacklight/conf/core.properties +5 -0
  50. data/solr/geoblacklight/conf/elevate.xml +36 -0
  51. data/solr/geoblacklight/conf/mapping-ISOLatin1Accent.txt +246 -0
  52. data/solr/geoblacklight/conf/protwords.txt +21 -0
  53. data/solr/geoblacklight/conf/schema.xml +198 -0
  54. data/solr/geoblacklight/conf/scripts.conf +24 -0
  55. data/solr/geoblacklight/conf/solrconfig.xml +243 -0
  56. data/solr/geoblacklight/conf/spellings.txt +2 -0
  57. data/solr/geoblacklight/conf/stopwords.txt +58 -0
  58. data/solr/geoblacklight/conf/stopwords_en.txt +58 -0
  59. data/solr/geoblacklight/conf/synonyms.txt +31 -0
  60. data/solr/geoblacklight/conf/xslt/example.xsl +132 -0
  61. data/solr/geoblacklight/conf/xslt/example_atom.xsl +67 -0
  62. data/solr/geoblacklight/conf/xslt/example_rss.xsl +66 -0
  63. data/solr/geoblacklight/conf/xslt/luke.xsl +337 -0
  64. data/spec/controllers/annotations_controller_spec.rb +74 -0
  65. data/spec/factories/annotations.rb +12 -0
  66. data/spec/features/show_page_spec.rb +35 -0
  67. data/spec/features/sidebar_spec.rb +28 -0
  68. data/spec/fixtures/blacklight_allmaps_sidecars.yml +1203 -0
  69. data/spec/fixtures/solr_documents/README.md +15 -0
  70. data/spec/fixtures/solr_documents/blacklight/README.md +9 -0
  71. data/spec/fixtures/solr_documents/blacklight/bl_georeferenced.json +40 -0
  72. data/spec/fixtures/solr_documents/geoblacklight/gbl_btaa_northwestern_georeferenced.json +57 -0
  73. data/spec/fixtures/solr_documents/geoblacklight/gbl_harvard-g4124-m2-1855-m3_georefereneced.json +68 -0
  74. data/spec/fixtures/solr_documents/geoblacklight/gbl_not_georeferenced.json +67 -0
  75. data/spec/fixtures/solr_documents/geoblacklight/gbl_osu-0r967h708_georeferenced.json +60 -0
  76. data/spec/fixtures/solr_documents/geoblacklight/gbl_p16022coll230:1933_georeferenced.json +60 -0
  77. data/spec/fixtures/solr_documents/geoblacklight/gbl_p16022coll230:360_georeferenced.json +67 -0
  78. data/spec/fixtures/solr_documents/geoblacklight/gbl_p16022coll230:4038_georeferenced.json +53 -0
  79. data/spec/helpers/blacklight/allmaps/application_helper_spec.rb +28 -0
  80. data/spec/models/blacklight/allmaps/sidecar_allmaps_spec.rb +22 -0
  81. data/spec/spec_helper.rb +53 -0
  82. data/spec/test_app_templates/Gemfile.extra +2 -0
  83. data/spec/test_app_templates/lib/generators/test_app_generator.rb +48 -0
  84. data/vendor/assets/images/fullscreen.png +0 -0
  85. data/vendor/assets/images/fullscreen@2x.png +0 -0
  86. data/vendor/assets/images/layers-2x.png +0 -0
  87. data/vendor/assets/images/layers.png +0 -0
  88. data/vendor/assets/images/marker-icon-2x.png +0 -0
  89. data/vendor/assets/images/marker-icon.png +0 -0
  90. data/vendor/assets/images/marker-shadow.png +0 -0
  91. data/vendor/assets/stylesheets/leaflet.css +640 -0
  92. data/vendor/assets/stylesheets/leaflet.fullscreen.css +40 -0
  93. metadata +85 -2
@@ -0,0 +1,265 @@
1
+ <?xml version="1.0" encoding="UTF-8" ?>
2
+ <config>
3
+ <!-- NOTE: various comments and unused configuration possibilities have been purged
4
+ from this file. Please refer to http://wiki.apache.org/solr/SolrConfigXml,
5
+ as well as the default solrconfig file included with Solr -->
6
+
7
+ <abortOnConfigurationError>${solr.abortOnConfigurationError:true}</abortOnConfigurationError>
8
+
9
+ <luceneMatchVersion>6.1.0</luceneMatchVersion>
10
+
11
+ <directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.StandardDirectoryFactory}"/>
12
+
13
+ <updateHandler class="solr.DirectUpdateHandler2">
14
+ <updateLog>
15
+ <str name="dir">${solr.core0.data.dir:}</str>
16
+ </updateLog>
17
+ </updateHandler>
18
+
19
+ <!-- solr lib dirs -->
20
+ <lib dir="${solr.install.dir:../../../..}/modules/analysis-extras/lib" />
21
+ <lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lib" />
22
+ <lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lucene-libs" />
23
+
24
+ <dataDir>${solr.data.dir:}</dataDir>
25
+
26
+ <requestHandler name="search" class="solr.SearchHandler" default="true">
27
+ <!-- default values for query parameters can be specified, these
28
+ will be overridden by parameters in the request
29
+ -->
30
+ <lst name="defaults">
31
+ <str name="defType">edismax</str>
32
+ <str name="echoParams">explicit</str>
33
+ <str name="q.alt">*:*</str>
34
+ <str name="mm">2&lt;-1 5&lt;-2 6&lt;90%</str>
35
+ <int name="qs">1</int>
36
+ <int name="ps">2</int>
37
+ <float name="tie">0.01</float>
38
+ <!-- this qf and pf are used by default, if not otherwise specified by
39
+ client. The default blacklight_config will use these for the
40
+ "keywords" search. See the author_qf/author_pf, title_qf, etc
41
+ below, which the default blacklight_config will specify for
42
+ those searches. You may also be interested in:
43
+ http://wiki.apache.org/solr/LocalParams
44
+ -->
45
+ <str name="qf">
46
+ id
47
+ full_title_tsim
48
+ short_title_tsim
49
+ alternative_title_tsim
50
+ active_fedora_model_ssi
51
+ title_tsim
52
+ author_tsim
53
+ subject_tsim
54
+ all_text_timv
55
+ </str>
56
+ <str name="pf">
57
+ all_text_timv^10
58
+ </str>
59
+
60
+ <str name="author_qf">
61
+ author_tsim
62
+ </str>
63
+ <str name="author_pf">
64
+ </str>
65
+ <str name="title_qf">
66
+ title_tsim
67
+ full_title_tsim
68
+ short_title_tsim
69
+ alternative_title_tsim
70
+ </str>
71
+ <str name="title_pf">
72
+ </str>
73
+ <str name="subject_qf">
74
+ subject_tsim
75
+ </str>
76
+ <str name="subject_pf">
77
+ </str>
78
+
79
+ <str name="fl">
80
+ *,
81
+ score
82
+ </str>
83
+
84
+ <str name="facet">true</str>
85
+ <str name="facet.mincount">1</str>
86
+ <str name="facet.limit">10</str>
87
+ <str name="facet.field">active_fedora_model_ssi</str>
88
+ <str name="facet.field">subject_ssim</str>
89
+
90
+ <str name="spellcheck">true</str>
91
+ <str name="spellcheck.dictionary">default</str>
92
+ <str name="spellcheck.onlyMorePopular">true</str>
93
+ <str name="spellcheck.extendedResults">true</str>
94
+ <str name="spellcheck.collate">false</str>
95
+ <str name="spellcheck.count">5</str>
96
+
97
+ </lst>
98
+ <arr name="last-components">
99
+ <str>spellcheck</str>
100
+ </arr>
101
+ </requestHandler>
102
+
103
+ <requestHandler name="/advanced" class="solr.SearchHandler">
104
+ <!-- a lucene request handler for using the JSON Query DSL,
105
+ specifically for advanced search.
106
+ Using a separate requestHandler is a workaround to
107
+ https://issues.apache.org/jira/browse/SOLR-16916, although
108
+ it could be desirable for other reasons as well.
109
+ -->
110
+ <lst name="defaults">
111
+ <str name="defType">lucene</str>
112
+ <str name="echoParams">explicit</str>
113
+ <str name="df">title_tsim</str>
114
+ <str name="qf">
115
+ id
116
+ full_title_tsim
117
+ short_title_tsim
118
+ alternative_title_tsim
119
+ active_fedora_model_ssi
120
+ title_tsim
121
+ author_tsim
122
+ subject_tsim
123
+ all_text_timv
124
+ </str>
125
+ <str name="pf">
126
+ all_text_timv^10
127
+ </str>
128
+
129
+ <str name="author_qf">
130
+ author_tsim
131
+ </str>
132
+ <str name="author_pf">
133
+ </str>
134
+ <str name="title_qf">
135
+ title_tsim
136
+ full_title_tsim
137
+ short_title_tsim
138
+ alternative_title_tsim
139
+ </str>
140
+ <str name="title_pf">
141
+ </str>
142
+ <str name="subject_qf">
143
+ subject_tsim
144
+ </str>
145
+ <str name="subject_pf">
146
+ </str>
147
+
148
+ <str name="fl">
149
+ *,
150
+ score
151
+ </str>
152
+
153
+ <str name="facet">true</str>
154
+ <str name="facet.mincount">1</str>
155
+ <str name="facet.limit">10</str>
156
+ <str name="facet.field">active_fedora_model_ssi</str>
157
+ <str name="facet.field">subject_ssim</str>
158
+
159
+ <str name="spellcheck">true</str>
160
+ <str name="spellcheck.dictionary">default</str>
161
+ <str name="spellcheck.onlyMorePopular">true</str>
162
+ <str name="spellcheck.extendedResults">true</str>
163
+ <str name="spellcheck.collate">false</str>
164
+ <str name="spellcheck.count">5</str>
165
+
166
+ </lst>
167
+ <arr name="last-components">
168
+ <str>spellcheck</str>
169
+ </arr>
170
+ </requestHandler>
171
+
172
+ <requestHandler name="permissions" class="solr.SearchHandler" >
173
+ <lst name="defaults">
174
+ <str name="facet">off</str>
175
+ <str name="echoParams">all</str>
176
+ <str name="rows">1</str>
177
+ <str name="q">{!raw f=id v=$id}</str> <!-- use id=666 instead of q=id:666 -->
178
+ <str name="fl">
179
+ id,
180
+ access_ssim,
181
+ discover_access_group_ssim,discover_access_person_ssim,
182
+ read_access_group_ssim,read_access_person_ssim,
183
+ edit_access_group_ssim,edit_access_person_ssim,
184
+ depositor_ti,
185
+ embargo_release_date_dtsi
186
+ inheritable_access_ssim,
187
+ inheritable_discover_access_group_ssim,inheritable_discover_access_person_ssim,
188
+ inheritable_read_access_group_ssim,inheritable_read_access_person_ssim,
189
+ inheritable_edit_access_group_ssim,inheritable_edit_access_person_ssim,
190
+ inheritable_embargo_release_date_dtsi
191
+ </str>
192
+ </lst>
193
+ </requestHandler>
194
+
195
+ <requestHandler name="standard" class="solr.SearchHandler">
196
+ <lst name="defaults">
197
+ <str name="echoParams">explicit</str>
198
+ <str name="defType">lucene</str>
199
+ </lst>
200
+ </requestHandler>
201
+
202
+
203
+ <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
204
+ <str name="queryAnalyzerFieldType">textSpell</str>
205
+ <!-- Multiple "Spell Checkers" can be declared and used by this component
206
+ (e.g. for title_spell field)
207
+ -->
208
+ <lst name="spellchecker">
209
+ <str name="name">default</str>
210
+ <str name="field">spell</str>
211
+ <str name="spellcheckIndexDir">./spell</str>
212
+ <str name="buildOnOptimize">true</str>
213
+ </lst>
214
+ <lst name="spellchecker">
215
+ <str name="name">author</str>
216
+ <str name="field">author_spell</str>
217
+ <str name="spellcheckIndexDir">./spell_author</str>
218
+ <str name="accuracy">0.7</str>
219
+ <str name="buildOnOptimize">true</str>
220
+ </lst>
221
+ <lst name="spellchecker">
222
+ <str name="name">subject</str>
223
+ <str name="field">subject_spell</str>
224
+ <str name="spellcheckIndexDir">./spell_subject</str>
225
+ <str name="accuracy">0.7</str>
226
+ <str name="buildOnOptimize">true</str>
227
+ </lst>
228
+ <lst name="spellchecker">
229
+ <str name="name">title</str>
230
+ <str name="field">title_spell</str>
231
+ <str name="spellcheckIndexDir">./spell_title</str>
232
+ <str name="accuracy">0.7</str>
233
+ <str name="buildOnOptimize">true</str>
234
+ </lst>
235
+ </searchComponent>
236
+
237
+ <searchComponent name="suggest" class="solr.SuggestComponent">
238
+ <lst name="suggester">
239
+ <str name="name">mySuggester</str>
240
+ <str name="lookupImpl">FuzzyLookupFactory</str>
241
+ <str name="suggestAnalyzerFieldType">textSuggest</str>
242
+ <str name="buildOnCommit">true</str>
243
+ <str name="field">suggest</str>
244
+ </lst>
245
+ </searchComponent>
246
+
247
+ <requestHandler name="/suggest" class="solr.SearchHandler" startup="lazy">
248
+ <lst name="defaults">
249
+ <str name="suggest">true</str>
250
+ <str name="suggest.count">5</str>
251
+ <str name="suggest.dictionary">mySuggester</str>
252
+ </lst>
253
+ <arr name="components">
254
+ <str>suggest</str>
255
+ </arr>
256
+ </requestHandler>
257
+
258
+ <requestHandler name="/replication" class="solr.ReplicationHandler" startup="lazy" />
259
+
260
+ <requestDispatcher handleSelect="true" >
261
+ <requestParsers enableRemoteStreaming="true" multipartUploadLimitInKB="2048" />
262
+ </requestDispatcher>
263
+
264
+ <requestHandler name="/analysis/field" startup="lazy" class="solr.FieldAnalysisRequestHandler" />
265
+ </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>
@@ -0,0 +1,66 @@
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 RSS
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
+ <xsl:template match='/'>
33
+ <rss version="2.0">
34
+ <channel>
35
+ <title>Example Solr RSS 2.0 Feed</title>
36
+ <link>http://localhost:8983/solr</link>
37
+ <description>
38
+ This has been formatted by the sample "example_rss.xsl" transform -
39
+ use your own XSLT to get a nicer RSS feed.
40
+ </description>
41
+ <language>en-us</language>
42
+ <docs>http://localhost:8983/solr</docs>
43
+ <xsl:apply-templates select="response/result/doc"/>
44
+ </channel>
45
+ </rss>
46
+ </xsl:template>
47
+
48
+ <!-- search results xslt -->
49
+ <xsl:template match="doc">
50
+ <xsl:variable name="id" select="str[@name='id']"/>
51
+ <xsl:variable name="timestamp" select="date[@name='timestamp']"/>
52
+ <item>
53
+ <title><xsl:value-of select="str[@name='name']"/></title>
54
+ <link>
55
+ http://localhost:8983/solr/select?q=id:<xsl:value-of select="$id"/>
56
+ </link>
57
+ <description>
58
+ <xsl:value-of select="arr[@name='features']"/>
59
+ </description>
60
+ <pubDate><xsl:value-of select="$timestamp"/></pubDate>
61
+ <guid>
62
+ http://localhost:8983/solr/select?q=id:<xsl:value-of select="$id"/>
63
+ </guid>
64
+ </item>
65
+ </xsl:template>
66
+ </xsl:stylesheet>