blacklight 3.1.2 → 3.2.0pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. data/.gitignore +5 -2
  2. data/README.md +7 -2
  3. data/VERSION +1 -1
  4. data/app/assets/images/favicon.ico +0 -0
  5. data/app/assets/javascripts/blacklight/blacklight.js +23 -1
  6. data/app/assets/stylesheets/blacklight/_catalog.css.scss +369 -0
  7. data/app/assets/stylesheets/blacklight/_facets.css.scss +117 -0
  8. data/app/assets/stylesheets/blacklight/_folder.css.scss +38 -0
  9. data/app/assets/stylesheets/blacklight/_formatting.css.scss +164 -0
  10. data/app/assets/stylesheets/blacklight/_header.css.scss +36 -0
  11. data/app/assets/stylesheets/blacklight/_layout.css.scss +79 -0
  12. data/app/assets/stylesheets/blacklight/_print.css.scss +54 -0
  13. data/app/assets/stylesheets/blacklight/_search_history.css.scss +44 -0
  14. data/app/assets/stylesheets/blacklight/_susy_framework.css.scss +228 -0
  15. data/app/assets/stylesheets/blacklight/blacklight.css.scss +27 -0
  16. data/app/assets/stylesheets/blacklight/blacklight_defaults.css.scss +48 -0
  17. data/app/controllers/bookmarks_controller.rb +2 -1
  18. data/app/controllers/folder_controller.rb +4 -0
  19. data/app/controllers/saved_searches_controller.rb +4 -0
  20. data/app/controllers/search_history_controller.rb +4 -0
  21. data/app/helpers/blacklight/blacklight_helper_behavior.rb +64 -104
  22. data/app/helpers/blacklight/catalog_helper_behavior.rb +4 -4
  23. data/app/helpers/blacklight/facets_helper_behavior.rb +52 -5
  24. data/app/helpers/blacklight/render_constraints_helper_behavior.rb +14 -59
  25. data/app/helpers/blacklight/search_history_constraints_helper_behavior.rb +56 -0
  26. data/app/helpers/search_history_constraints_helper.rb +3 -0
  27. data/app/models/record_mailer.rb +1 -2
  28. data/app/views/_flash_msg.html.erb +4 -5
  29. data/app/views/_user_util_links.html.erb +3 -1
  30. data/app/views/bookmarks/index.html.erb +2 -2
  31. data/app/views/catalog/_bookmark_control.html.erb +6 -6
  32. data/app/views/catalog/_facet_layout.html.erb +4 -0
  33. data/app/views/catalog/_facet_limit.html.erb +20 -33
  34. data/app/views/catalog/_facets.html.erb +1 -5
  35. data/app/views/catalog/_folder_control.html.erb +5 -5
  36. data/app/views/catalog/_index_default.html.erb +1 -1
  37. data/app/views/catalog/_search_form.html.erb +4 -3
  38. data/app/views/catalog/_show_default.html.erb +1 -1
  39. data/app/views/catalog/_show_tools.html.erb +6 -6
  40. data/app/views/catalog/_sort_and_per_page.html.erb +1 -1
  41. data/app/views/catalog/index.atom.builder +2 -2
  42. data/app/views/catalog/index.rss.builder +1 -1
  43. data/app/views/catalog/opensearch.xml.builder +10 -0
  44. data/app/views/catalog/show.html.erb +1 -1
  45. data/app/views/folder/_tools.html.erb +4 -4
  46. data/app/views/layouts/blacklight.html.erb +25 -37
  47. data/app/views/record_mailer/email_record.text.erb +1 -1
  48. data/app/views/record_mailer/sms_record.text.erb +2 -2
  49. data/app/views/search_history/index.html.erb +1 -1
  50. data/blacklight.gemspec +11 -9
  51. data/lib/{generators/blacklight/templates/SolrMarc.jar → SolrMarc.jar} +0 -0
  52. data/lib/blacklight.rb +5 -3
  53. data/lib/blacklight/catalog.rb +3 -4
  54. data/lib/blacklight/configurable.rb +54 -39
  55. data/lib/blacklight/configuration.rb +126 -0
  56. data/lib/blacklight/configuration/fields.rb +142 -0
  57. data/lib/blacklight/configuration/search_field.rb +12 -0
  58. data/lib/blacklight/configuration/solr_field.rb +12 -0
  59. data/lib/blacklight/configuration/sort_field.rb +17 -0
  60. data/lib/blacklight/controller.rb +16 -14
  61. data/lib/blacklight/engine.rb +1 -1
  62. data/lib/blacklight/global_configurable.rb +46 -0
  63. data/lib/blacklight/search_fields.rb +21 -54
  64. data/lib/blacklight/solr/document.rb +13 -3
  65. data/lib/blacklight/solr_helper.rb +88 -52
  66. data/lib/blacklight/utils.rb +18 -0
  67. data/lib/generators/blacklight/assets_generator.rb +14 -20
  68. data/lib/generators/blacklight/blacklight_generator.rb +14 -6
  69. data/lib/generators/blacklight/jetty_generator.rb +1 -1
  70. data/lib/generators/blacklight/templates/assets/standard.css.scss +51 -0
  71. data/lib/generators/blacklight/templates/catalog_controller.rb +148 -0
  72. data/lib/generators/blacklight/templates/config/blacklight_config.rb +2 -239
  73. data/lib/generators/blacklight/templates/config/sass.rb +5 -0
  74. data/lib/generators/blacklight/templates/solr_conf/schema.xml +514 -164
  75. data/lib/generators/blacklight/templates/solr_conf/solrconfig.xml +1591 -323
  76. data/lib/generators/blacklight/templates/solr_document.rb +2 -0
  77. data/lib/railties/all_tests.rake +36 -3
  78. data/lib/railties/blacklight_cucumber.rake +6 -4
  79. data/lib/railties/blacklight_rspec.rake +5 -4
  80. data/test_support/bin/run-tests.sh +2 -13
  81. data/test_support/bin/test.sh +30 -23
  82. data/test_support/features/did_you_mean.feature +14 -13
  83. data/test_support/features/step_definitions/saved_searches_steps.rb +1 -1
  84. data/test_support/features/step_definitions/search_steps.rb +4 -4
  85. data/test_support/spec/controllers/application_controller_spec.rb +3 -13
  86. data/test_support/spec/controllers/catalog_controller_spec.rb +102 -24
  87. data/test_support/spec/controllers/folder_controller_spec.rb +7 -1
  88. data/test_support/spec/helpers/blacklight_helper_spec.rb +45 -34
  89. data/test_support/spec/helpers/facets_helper_spec.rb +68 -0
  90. data/test_support/spec/helpers/html_head_helper_spec.rb +37 -0
  91. data/test_support/spec/helpers/{render_constraints_helper_spec.rb → search_history_constraints_helper_spec.rb} +26 -7
  92. data/test_support/spec/lib/blacklight_configurable_spec.rb +92 -0
  93. data/test_support/spec/lib/blacklight_configuration_spec.rb +295 -0
  94. data/test_support/spec/lib/{configurable_spec.rb → global_configurable_spec.rb} +2 -2
  95. data/test_support/spec/lib/search_fields_spec.rb +26 -29
  96. data/test_support/spec/{helpers → lib}/solr_helper_spec.rb +268 -287
  97. data/test_support/spec/lib/tasks/solr_marc_task_spec.rb +1 -1
  98. data/test_support/spec/lib/utils_spec.rb +58 -0
  99. data/test_support/spec/models/solr_docment_spec.rb +4 -8
  100. data/test_support/spec/views/catalog/_facets.html.erb_spec.rb +27 -170
  101. data/test_support/spec/views/catalog/_index_default.erb_spec.rb +38 -20
  102. data/test_support/spec/views/catalog/_show_default.erb_spec.rb +38 -19
  103. data/test_support/spec/views/catalog/index.atom.builder_spec.rb +19 -1
  104. metadata +148 -145
  105. data/app/assets/stylesheets/blacklight/blacklight.css +0 -493
  106. data/app/assets/stylesheets/yui.css +0 -31
  107. data/app/views/catalog/opensearch.xml.erb +0 -11
  108. data/doc/Atom-Responses.md +0 -90
  109. data/doc/CUSTOMIZING.md +0 -121
  110. data/doc/Extending-blacklight-with-the-document-extension-framework.md +0 -1
  111. data/doc/Extending-or-Modifying-Blacklight-Search-Behavior.md +0 -131
  112. data/doc/Features.md +0 -147
  113. data/doc/Integration-with-Rails-Footnotes.md +0 -20
  114. data/doc/Pagination.md +0 -38
  115. data/doc/Quickstart.md +0 -97
  116. data/doc/Upgrading-Guide.md +0 -98
  117. data/doc/User-Authentication.md +0 -54
  118. data/doc/Using-a-custom-solr-uniquekey-field.md +0 -36
  119. data/lib/blacklight/comma_link_renderer.rb +0 -28
  120. data/lib/railties/jetty_solr_server.rb +0 -108
  121. data/test_support/spec/views/catalog/show.html.erb_spec.rb +0 -101
@@ -1,240 +1,3 @@
1
1
  # -*- encoding : utf-8 -*-
2
- # You can configure Blacklight from here.
3
- #
4
- # Blacklight.configure(:environment) do |config| end
5
- #
6
- # :shared (or leave it blank) is used by all environments.
7
- # You can override a shared key by using that key in a particular
8
- # environment's configuration.
9
- #
10
- # If you have no configuration beyond :shared for an environment, you
11
- # do not need to call configure() for that envirnoment.
12
- #
13
- # For specific environments:
14
- #
15
- # Blacklight.configure(:test) {}
16
- # Blacklight.configure(:development) {}
17
- # Blacklight.configure(:production) {}
18
- #
19
-
20
- Blacklight.configure(:shared) do |config|
21
-
22
- config[:default_solr_params] = {
23
- :qt => "search",
24
- :per_page => 10
25
- }
26
-
27
- # solr field configuration for search results/index views
28
- config[:index] = {
29
- :show_link => "title_display",
30
- :record_display_type => "format"
31
- }
32
-
33
- # solr field configuration for document/show views
34
- config[:show] = {
35
- :html_title => "title_display",
36
- :heading => "title_display",
37
- :display_type => "format"
38
- }
39
-
40
-
41
- # solr fields that will be treated as facets by the blacklight application
42
- # The ordering of the field names is the order of the display
43
- # TODO: Reorganize facet data structures supplied in config to make simpler
44
- # for human reading/writing, kind of like search_fields. Eg,
45
- # config[:facet] << {:field_name => "format", :label => "Format", :limit => 10}
46
- config[:facet] = {
47
- :field_names => (facet_fields = [
48
- "format",
49
- "pub_date",
50
- "subject_topic_facet",
51
- "language_facet",
52
- "lc_1letter_facet",
53
- "subject_geo_facet",
54
- "subject_era_facet"
55
- ]),
56
- :labels => {
57
- "format" => "Format",
58
- "pub_date" => "Publication Year",
59
- "subject_topic_facet" => "Topic",
60
- "language_facet" => "Language",
61
- "lc_1letter_facet" => "Call Number",
62
- "subject_era_facet" => "Era",
63
- "subject_geo_facet" => "Region"
64
- },
65
- # Setting a limit will trigger Blacklight's 'more' facet values link.
66
- # * If left unset, then all facet values returned by solr will be displayed.
67
- # * If set to an integer, then "f.somefield.facet.limit" will be added to
68
- # solr request, with actual solr request being +1 your configured limit --
69
- # you configure the number of items you actually want _displayed_ in a page.
70
- # * If set to 'true', then no additional parameters will be sent to solr,
71
- # but any 'sniffed' request limit parameters will be used for paging, with
72
- # paging at requested limit -1. Can sniff from facet.limit or
73
- # f.specific_field.facet.limit solr request params. This 'true' config
74
- # can be used if you set limits in :default_solr_params, or as defaults
75
- # on the solr side in the request handler itself. Request handler defaults
76
- # sniffing requires solr requests to be made with "echoParams=all", for
77
- # app code to actually have it echo'd back to see it.
78
- :limits => {
79
- "subject_topic_facet" => 20,
80
- "language_facet" => true
81
- }
82
- }
83
-
84
- # Have BL send all facet field names to Solr, which has been the default
85
- # previously. Simply remove these lines if you'd rather use Solr request
86
- # handler defaults, or have no facets.
87
- config[:default_solr_params] ||= {}
88
- config[:default_solr_params][:"facet.field"] = facet_fields
89
-
90
- # solr fields to be displayed in the index (search results) view
91
- # The ordering of the field names is the order of the display
92
- config[:index_fields] = {
93
- :field_names => [
94
- "title_display",
95
- "title_vern_display",
96
- "author_display",
97
- "author_vern_display",
98
- "format",
99
- "language_facet",
100
- "published_display",
101
- "published_vern_display",
102
- "lc_callnum_display"
103
- ],
104
- :labels => {
105
- "title_display" => "Title:",
106
- "title_vern_display" => "Title:",
107
- "author_display" => "Author:",
108
- "author_vern_display" => "Author:",
109
- "format" => "Format:",
110
- "language_facet" => "Language:",
111
- "published_display" => "Published:",
112
- "published_vern_display" => "Published:",
113
- "lc_callnum_display" => "Call number:"
114
- }
115
- }
116
-
117
- # solr fields to be displayed in the show (single result) view
118
- # The ordering of the field names is the order of the display
119
- config[:show_fields] = {
120
- :field_names => [
121
- "title_display",
122
- "title_vern_display",
123
- "subtitle_display",
124
- "subtitle_vern_display",
125
- "author_display",
126
- "author_vern_display",
127
- "format",
128
- "url_fulltext_display",
129
- "url_suppl_display",
130
- "material_type_display",
131
- "language_facet",
132
- "published_display",
133
- "published_vern_display",
134
- "lc_callnum_display",
135
- "isbn_t"
136
- ],
137
- :labels => {
138
- "title_display" => "Title:",
139
- "title_vern_display" => "Title:",
140
- "subtitle_display" => "Subtitle:",
141
- "subtitle_vern_display" => "Subtitle:",
142
- "author_display" => "Author:",
143
- "author_vern_display" => "Author:",
144
- "format" => "Format:",
145
- "url_fulltext_display" => "URL:",
146
- "url_suppl_display" => "More Information:",
147
- "material_type_display" => "Physical description:",
148
- "language_facet" => "Language:",
149
- "published_display" => "Published:",
150
- "published_vern_display" => "Published:",
151
- "lc_callnum_display" => "Call number:",
152
- "isbn_t" => "ISBN:"
153
- }
154
- }
155
-
156
-
157
- # "fielded" search configuration. Used by pulldown among other places.
158
- # For supported keys in hash, see rdoc for Blacklight::SearchFields
159
- #
160
- # Search fields will inherit the :qt solr request handler from
161
- # config[:default_solr_parameters], OR can specify a different one
162
- # with a :qt key/value. Below examples inherit, except for subject
163
- # that specifies the same :qt as default for our own internal
164
- # testing purposes.
165
- #
166
- # The :key is what will be used to identify this BL search field internally,
167
- # as well as in URLs -- so changing it after deployment may break bookmarked
168
- # urls. A display label will be automatically calculated from the :key,
169
- # or can be specified manually to be different.
170
- config[:search_fields] ||= []
171
-
172
- # This one uses all the defaults set by the solr request handler. Which
173
- # solr request handler? The one set in config[:default_solr_parameters][:qt],
174
- # since we aren't specifying it otherwise.
175
- config[:search_fields] << {
176
- :key => "all_fields",
177
- :display_label => 'All Fields'
178
- }
179
-
180
- # Now we see how to over-ride Solr request handler defaults, in this
181
- # case for a BL "search field", which is really a dismax aggregate
182
- # of Solr search fields.
183
- config[:search_fields] << {
184
- :key => 'title',
185
- # solr_parameters hash are sent to Solr as ordinary url query params.
186
- :solr_parameters => {
187
- :"spellcheck.dictionary" => "title"
188
- },
189
- # :solr_local_parameters will be sent using Solr LocalParams
190
- # syntax, as eg {! qf=$title_qf }. This is neccesary to use
191
- # Solr parameter de-referencing like $title_qf.
192
- # See: http://wiki.apache.org/solr/LocalParams
193
- :solr_local_parameters => {
194
- :qf => "$title_qf",
195
- :pf => "$title_pf"
196
- }
197
- }
198
- config[:search_fields] << {
199
- :key =>'author',
200
- :solr_parameters => {
201
- :"spellcheck.dictionary" => "author"
202
- },
203
- :solr_local_parameters => {
204
- :qf => "$author_qf",
205
- :pf => "$author_pf"
206
- }
207
- }
208
-
209
- # Specifying a :qt only to show it's possible, and so our internal automated
210
- # tests can test it. In this case it's the same as
211
- # config[:default_solr_parameters][:qt], so isn't actually neccesary.
212
- config[:search_fields] << {
213
- :key => 'subject',
214
- :qt=> 'search',
215
- :solr_parameters => {
216
- :"spellcheck.dictionary" => "subject"
217
- },
218
- :solr_local_parameters => {
219
- :qf => "$subject_qf",
220
- :pf => "$subject_pf"
221
- }
222
- }
223
-
224
- # "sort results by" select (pulldown)
225
- # label in pulldown is followed by the name of the SOLR field to sort by and
226
- # whether the sort is ascending or descending (it must be asc or desc
227
- # except in the relevancy case).
228
- # label is key, solr field is value
229
- config[:sort_fields] ||= []
230
- config[:sort_fields] << ['relevance', 'score desc, pub_date_sort desc, title_sort asc']
231
- config[:sort_fields] << ['year', 'pub_date_sort desc, title_sort asc']
232
- config[:sort_fields] << ['author', 'author_sort asc, title_sort asc']
233
- config[:sort_fields] << ['title', 'title_sort asc, pub_date_sort desc']
234
-
235
- # If there are more than this many search results, no spelling ("did you
236
- # mean") suggestion is offered.
237
- config[:spell_max] = 5
238
-
239
- end
240
-
2
+ # This file has been deprecated and replaced by per-controller configuration
3
+ # See CatalogController
@@ -0,0 +1,5 @@
1
+ Rails.configuration.sass.tap do |config|
2
+ config.load_paths << "#{Gem.loaded_specs['compass'].full_gem_path}/frameworks/compass/stylesheets"
3
+ end
4
+
5
+
@@ -1,30 +1,84 @@
1
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
+
2
19
  <!--
3
- For information on how to customize this file, please see
4
- http://wiki.apache.org/solr/SchemaXml. The page also has a link to an
5
- extensively commented version of this file.
20
+ This is the Solr schema file. This file should be named "schema.xml" and
21
+ should be in the conf directory under the solr home
22
+ (i.e. ./solr/conf/schema.xml by default)
23
+ or located where the classloader for the Solr webapp can find it.
24
+
25
+ This example schema is the recommended starting point for users.
26
+ It should be kept correct and concise, usable out-of-the-box.
27
+
28
+ For more information, on how to customize this file, please see
29
+ http://wiki.apache.org/solr/SchemaXml
30
+
31
+ PERFORMANCE NOTE: this schema includes many optional features and should not
32
+ be used for benchmarking. To improve performance one could
33
+ - set stored="false" for all fields possible (esp large fields) when you
34
+ only need to search on the field but don't need to return the original
35
+ value.
36
+ - set indexed="false" if you don't need to search on the field, but only
37
+ return the field as a result of searching on other indexed fields.
38
+ - remove all unneeded copyField statements
39
+ - for best index size and searching performance, set "index" to false
40
+ for all general text fields, use copyField to copy them to the
41
+ catchall "text" field, and use that for searching.
42
+ - For maximum indexing performance, use the StreamingUpdateSolrServer
43
+ java client.
44
+ - Remember to run the JVM in server mode, and use a higher logging level
45
+ that avoids logging every request
6
46
  -->
7
- <schema name="Blacklight Demo Index" version="1.2">
47
+
48
+ <schema name="Blacklight Demo Index" version="1.4">
8
49
  <!-- attribute "name" is the name of this schema and is only used for display purposes.
9
50
  Applications should change this to reflect the nature of the search collection.
10
- version="1.2" is Solr's version number for the schema syntax and semantics. It should
51
+ version="1.4" is Solr's version number for the schema syntax and semantics. It should
11
52
  not normally be changed by applications.
12
53
  1.0: multiValued attribute did not exist, all fields are multiValued by nature
13
54
  1.1: multiValued attribute introduced, false by default
14
55
  1.2: omitTermFreqAndPositions attribute introduced, true by default except for text fields.
15
56
  1.3: removed optional field compress feature
57
+ 1.4: default auto-phrase (QueryParser feature) to off
16
58
  -->
59
+
17
60
  <types>
61
+ <!-- field type definitions. The "name" attribute is
62
+ just a label to be used by field definitions. The "class"
63
+ attribute and any other attributes determine the real
64
+ behavior of the fieldType.
65
+ Class names starting with "solr" refer to java classes in the
66
+ org.apache.solr.analysis package.
67
+ -->
68
+
18
69
  <!-- The StrField type is not analyzed, but indexed/stored verbatim. -->
19
70
  <fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/>
71
+
20
72
  <!-- boolean type: "true" or "false" -->
21
73
  <fieldType name="boolean" class="solr.BoolField" sortMissingLast="true" omitNorms="true"/>
22
74
  <!--Binary data type. The data should be sent/retrieved in as Base64 encoded Strings -->
23
75
  <fieldtype name="binary" class="solr.BinaryField"/>
24
-
76
+
25
77
  <!-- The optional sortMissingLast and sortMissingFirst attributes are
26
- currently supported on types that are sorted internally as strings.
27
- This includes "string","boolean","sint","slong","sfloat","sdouble","pdate"
78
+ currently supported on types that are sorted internally as strings
79
+ and on numeric types.
80
+ This includes "string","boolean", and, as of 3.5 (and 4.x),
81
+ int, float, long, date, double, including the "Trie" variants.
28
82
  - If sortMissingLast="true", then a sort on this field will cause documents
29
83
  without the field to come after documents with the field,
30
84
  regardless of the requested sort order (asc or desc).
@@ -34,9 +88,9 @@
34
88
  - If sortMissingLast="false" and sortMissingFirst="false" (the default),
35
89
  then default lucene sorting will be used which places docs without the
36
90
  field first in an ascending sort and last in a descending sort.
37
- -->
38
-
39
- <!--
91
+ -->
92
+
93
+ <!--
40
94
  Default numeric field types. For faster range queries, consider the tint/tfloat/tlong/tdouble types.
41
95
  -->
42
96
  <fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
@@ -44,11 +98,7 @@
44
98
  <fieldType name="long" class="solr.TrieLongField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
45
99
  <fieldType name="double" class="solr.TrieDoubleField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
46
100
 
47
- <!-- included for backwards compat, same as "pint" below. For backwards
48
- compat only, see notes at "pint" -->
49
- <fieldType name="integer" class="solr.IntField" omitNorms="true"/>
50
-
51
- <!--
101
+ <!--
52
102
  Numeric field types that index each value at various levels of precision
53
103
  to accelerate range queries when the number of values between the range
54
104
  endpoints is large. See the javadoc for NumericRangeQuery for internal
@@ -63,7 +113,7 @@
63
113
  <fieldType name="tlong" class="solr.TrieLongField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
64
114
  <fieldType name="tdouble" class="solr.TrieDoubleField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
65
115
 
66
- <!-- The format for this date field is of the form 1995-12-31T23:59:59Z, and
116
+ <!-- The format for this date field is of the form 1995-12-31T23:59:59Z, and
67
117
  is a more restricted form of the canonical representation of dateTime
68
118
  http://www.w3.org/TR/xmlschema-2/#dateTime
69
119
  The trailing "Z" designates UTC time and is mandatory.
@@ -90,6 +140,7 @@
90
140
  <!-- A Trie based date field for faster date range queries and date faceting. -->
91
141
  <fieldType name="tdate" class="solr.TrieDateField" omitNorms="true" precisionStep="6" positionIncrementGap="0"/>
92
142
 
143
+
93
144
  <!--
94
145
  Note:
95
146
  These should only be used for compatibility with existing indexes (created with older Solr versions)
@@ -105,10 +156,11 @@
105
156
  <fieldType name="pdouble" class="solr.DoubleField" omitNorms="true"/>
106
157
  <fieldType name="pdate" class="solr.DateField" sortMissingLast="true" omitNorms="true"/>
107
158
 
159
+
108
160
  <!--
109
161
  Note:
110
- These should only be used for compatibility with existing indexes (created with older Solr versions)
111
- or if "sortMissingFirst" or "sortMissingLast" functionality is needed. Use Trie based fields instead.
162
+ These should only be used for compatibility with existing indexes (created with older Solr versions).
163
+ Use Trie based fields instead. As of Solr 3.5 and 4.x, Trie based fields support sortMissingFirst/Last
112
164
 
113
165
  Numeric field types that manipulate the value into
114
166
  a string value that isn't human-readable in its internal form,
@@ -119,7 +171,8 @@
119
171
  <fieldType name="slong" class="solr.SortableLongField" sortMissingLast="true" omitNorms="true"/>
120
172
  <fieldType name="sfloat" class="solr.SortableFloatField" sortMissingLast="true" omitNorms="true"/>
121
173
  <fieldType name="sdouble" class="solr.SortableDoubleField" sortMissingLast="true" omitNorms="true"/>
122
-
174
+
175
+
123
176
  <!-- The "RandomSortField" is not used to store or search any
124
177
  data. You can declare fields of this type it in your schema
125
178
  to generate pseudo-random orderings of your docs for sorting
@@ -133,7 +186,6 @@
133
186
  -->
134
187
  <fieldType name="random" class="solr.RandomSortField" indexed="true" />
135
188
 
136
-
137
189
  <!-- solr.TextField allows the specification of custom text analyzers
138
190
  specified as a tokenizer and a list of token filters. Different
139
191
  analyzers may be specified for indexing and querying.
@@ -145,69 +197,179 @@
145
197
  For more info on customizing your analyzer chain, please see
146
198
  http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters
147
199
  -->
148
- <fieldType name="text" class="solr.TextField" positionIncrementGap="100">
149
- <analyzer type="index">
200
+ <fieldType name="text" class="solr.TextField" positionIncrementGap="100">
201
+ <analyzer>
202
+ <tokenizer class="solr.StandardTokenizerFactory"/>
203
+ <filter class="solr.ICUFoldingFilterFactory" />
204
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
205
+ <filter class="solr.SnowballPorterFilterFactory" language="English" />
206
+ </analyzer>
207
+ </fieldType>
208
+
209
+ <!-- One can also specify an existing Analyzer class that has a
210
+ default constructor via the class attribute on the analyzer element
211
+ <fieldType name="text_greek" class="solr.TextField">
212
+ <analyzer class="org.apache.lucene.analysis.el.GreekAnalyzer"/>
213
+ </fieldType>
214
+ -->
215
+
216
+ <!-- A text field that only splits on whitespace for exact matching of words -->
217
+ <fieldType name="text_ws" class="solr.TextField" positionIncrementGap="100">
218
+ <analyzer>
150
219
  <tokenizer class="solr.WhitespaceTokenizerFactory"/>
151
- <!-- custom filter from bob@umich -->
152
- <filter class="schema.UnicodeNormalizationFilterFactory" version="icu4j" composed="false" remove_diacritics="true" remove_modifiers="true" fold="true" />
153
- <!-- cusotm filter from bob@umich, tokenizes CJK char-by-char. Not
154
- sure how good that is, but it's probably better than tokenizing
155
- only at whitespace. -->
156
- <filter class="schema.CJKFilterFactory" bigrams="false"/>
220
+ </analyzer>
221
+ </fieldType>
222
+
223
+ <!-- A general text field that has reasonable, generic
224
+ cross-language defaults: it tokenizes with StandardTokenizer,
225
+ removes stop words from case-insensitive "stopwords.txt"
226
+ (empty by default), and down cases. At query time only, it
227
+ also applies synonyms. -->
228
+ <fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
229
+ <analyzer type="index">
230
+ <tokenizer class="solr.StandardTokenizerFactory"/>
157
231
  <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
158
- <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
232
+ <!-- in this example, we will only use synonyms at query time
233
+ <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
234
+ -->
159
235
  <filter class="solr.LowerCaseFilterFactory"/>
160
- <filter class="solr.SnowballPorterFilterFactory" language="English" protected="protwords.txt"/> <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
161
236
  </analyzer>
162
237
  <analyzer type="query">
163
- <tokenizer class="solr.WhitespaceTokenizerFactory"/>
164
- <filter class="schema.UnicodeNormalizationFilterFactory" version="icu4j" composed="false" remove_diacritics="true" remove_modifiers="true" fold="true" />
165
- <filter class="schema.CJKFilterFactory" bigrams="false"/>
166
- <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
238
+ <tokenizer class="solr.StandardTokenizerFactory"/>
167
239
  <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
168
- <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
240
+ <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
169
241
  <filter class="solr.LowerCaseFilterFactory"/>
170
- <filter class="solr.SnowballPorterFilterFactory" language="English" protected="protwords.txt"/> <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
171
242
  </analyzer>
172
243
  </fieldType>
173
244
 
174
- <!-- Analyzed Text, no Stemming or Synonyms -->
175
- <fieldtype name="textNoStem" class="solr.TextField" positionIncrementGap="100">
245
+ <!-- A text field with defaults appropriate for English: it
246
+ tokenizes with StandardTokenizer, removes English stop words
247
+ (stopwords_en.txt), down cases, protects words from protwords.txt, and
248
+ finally applies Porter's stemming. The query time analyzer
249
+ also applies synonyms from synonyms.txt. -->
250
+ <fieldType name="text_en" class="solr.TextField" positionIncrementGap="100">
176
251
  <analyzer type="index">
177
- <tokenizer class="solr.WhitespaceTokenizerFactory" />
178
- <filter class="schema.UnicodeNormalizationFilterFactory" version="icu4j" composed="false" remove_diacritics="true" remove_modifiers="true" fold="true" />
179
- <filter class="schema.CJKFilterFactory" bigrams="false"/>
180
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
181
- <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1" />
182
- <filter class="solr.LowerCaseFilterFactory" />
183
- <filter class="solr.RemoveDuplicatesTokenFilterFactory" />
252
+ <tokenizer class="solr.StandardTokenizerFactory"/>
253
+ <!-- in this example, we will only use synonyms at query time
254
+ <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
255
+ -->
256
+ <!-- Case insensitive stop word removal.
257
+ add enablePositionIncrements=true in both the index and query
258
+ analyzers to leave a 'gap' for more accurate phrase queries.
259
+ -->
260
+ <filter class="solr.StopFilterFactory"
261
+ ignoreCase="true"
262
+ words="stopwords_en.txt"
263
+ enablePositionIncrements="true"
264
+ />
265
+ <filter class="solr.LowerCaseFilterFactory"/>
266
+ <filter class="solr.EnglishPossessiveFilterFactory"/>
267
+ <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
268
+ <!-- Optionally you may want to use this less aggressive stemmer instead of PorterStemFilterFactory:
269
+ <filter class="solr.EnglishMinimalStemFilterFactory"/>
270
+ -->
271
+ <filter class="solr.PorterStemFilterFactory"/>
184
272
  </analyzer>
185
273
  <analyzer type="query">
186
- <tokenizer class="solr.WhitespaceTokenizerFactory" />
187
- <filter class="schema.UnicodeNormalizationFilterFactory" version="icu4j" composed="false" remove_diacritics="true" remove_modifiers="true" fold="true" />
188
- <filter class="schema.CJKFilterFactory" bigrams="false"/>
189
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
190
- <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1" />
191
- <filter class="solr.LowerCaseFilterFactory" />
192
- <filter class="solr.RemoveDuplicatesTokenFilterFactory" />
274
+ <tokenizer class="solr.StandardTokenizerFactory"/>
275
+ <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
276
+ <filter class="solr.StopFilterFactory"
277
+ ignoreCase="true"
278
+ words="stopwords_en.txt"
279
+ enablePositionIncrements="true"
280
+ />
281
+ <filter class="solr.LowerCaseFilterFactory"/>
282
+ <filter class="solr.EnglishPossessiveFilterFactory"/>
283
+ <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
284
+ <!-- Optionally you may want to use this less aggressive stemmer instead of PorterStemFilterFactory:
285
+ <filter class="solr.EnglishMinimalStemFilterFactory"/>
286
+ -->
287
+ <filter class="solr.PorterStemFilterFactory"/>
193
288
  </analyzer>
194
- </fieldtype>
289
+ </fieldType>
195
290
 
196
- <!-- Less flexible matching, but less false matches. Probably not ideal for product names, but may be good for SKUs. Can insert dashes in the wrong place and still match. -->
197
- <fieldType name="textTight" class="solr.TextField" positionIncrementGap="100" >
291
+ <!-- A text field with defaults appropriate for English, plus
292
+ aggressive word-splitting and autophrase features enabled.
293
+ This field is just like text_en, except it adds
294
+ WordDelimiterFilter to enable splitting and matching of
295
+ words on case-change, alpha numeric boundaries, and
296
+ non-alphanumeric chars. This means certain compound word
297
+ cases will work, for example query "wi fi" will match
298
+ document "WiFi" or "wi-fi". However, other cases will still
299
+ not match, for example if the query is "wifi" and the
300
+ document is "wi fi" or if the query is "wi-fi" and the
301
+ document is "wifi".
302
+ -->
303
+ <fieldType name="text_en_splitting" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true">
304
+ <analyzer type="index">
305
+ <tokenizer class="solr.WhitespaceTokenizerFactory"/>
306
+ <!-- in this example, we will only use synonyms at query time
307
+ <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
308
+ -->
309
+ <!-- Case insensitive stop word removal.
310
+ add enablePositionIncrements=true in both the index and query
311
+ analyzers to leave a 'gap' for more accurate phrase queries.
312
+ -->
313
+ <filter class="solr.StopFilterFactory"
314
+ ignoreCase="true"
315
+ words="stopwords_en.txt"
316
+ enablePositionIncrements="true"
317
+ />
318
+ <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
319
+ <filter class="solr.LowerCaseFilterFactory"/>
320
+ <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
321
+ <filter class="solr.PorterStemFilterFactory"/>
322
+ </analyzer>
323
+ <analyzer type="query">
324
+ <tokenizer class="solr.WhitespaceTokenizerFactory"/>
325
+ <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
326
+ <filter class="solr.StopFilterFactory"
327
+ ignoreCase="true"
328
+ words="stopwords_en.txt"
329
+ enablePositionIncrements="true"
330
+ />
331
+ <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
332
+ <filter class="solr.LowerCaseFilterFactory"/>
333
+ <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
334
+ <filter class="solr.PorterStemFilterFactory"/>
335
+ </analyzer>
336
+ </fieldType>
337
+
338
+ <!-- Less flexible matching, but less false matches. Probably not ideal for product names,
339
+ but may be good for SKUs. Can insert dashes in the wrong place and still match. -->
340
+ <fieldType name="text_en_splitting_tight" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true">
198
341
  <analyzer>
199
342
  <tokenizer class="solr.WhitespaceTokenizerFactory"/>
200
343
  <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="false"/>
201
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
344
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords_en.txt"/>
202
345
  <filter class="solr.WordDelimiterFilterFactory" generateWordParts="0" generateNumberParts="0" catenateWords="1" catenateNumbers="1" catenateAll="0"/>
203
346
  <filter class="solr.LowerCaseFilterFactory"/>
204
- <filter class="solr.SnowballPorterFilterFactory" language="English" protected="protwords.txt"/>
347
+ <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
348
+ <filter class="solr.EnglishMinimalStemFilterFactory"/>
205
349
  <!-- this filter can remove any duplicate tokens that appear at the same position - sometimes
206
350
  possible with WordDelimiterFilter in conjuncton with stemming. -->
207
351
  <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
208
352
  </analyzer>
209
353
  </fieldType>
210
354
 
355
+ <!-- Just like text_general except it reverses the characters of
356
+ each token, to enable more efficient leading wildcard queries. -->
357
+ <fieldType name="text_general_rev" class="solr.TextField" positionIncrementGap="100">
358
+ <analyzer type="index">
359
+ <tokenizer class="solr.StandardTokenizerFactory"/>
360
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
361
+ <filter class="solr.LowerCaseFilterFactory"/>
362
+ <filter class="solr.ReversedWildcardFilterFactory" withOriginal="true"
363
+ maxPosAsterisk="3" maxPosQuestion="2" maxFractionAsterisk="0.33"/>
364
+ </analyzer>
365
+ <analyzer type="query">
366
+ <tokenizer class="solr.StandardTokenizerFactory"/>
367
+ <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
368
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
369
+ <filter class="solr.LowerCaseFilterFactory"/>
370
+ </analyzer>
371
+ </fieldType>
372
+
211
373
  <fieldType name="textSpell" class="solr.TextField" positionIncrementGap="100" >
212
374
  <analyzer>
213
375
  <tokenizer class="solr.StandardTokenizerFactory"/>
@@ -218,122 +380,310 @@
218
380
  </analyzer>
219
381
  </fieldType>
220
382
 
383
+ <!-- charFilter + WhitespaceTokenizer -->
384
+ <!--
385
+ <fieldType name="text_char_norm" class="solr.TextField" positionIncrementGap="100" >
386
+ <analyzer>
387
+ <charFilter class="solr.MappingCharFilterFactory" mapping="mapping-ISOLatin1Accent.txt"/>
388
+ <tokenizer class="solr.WhitespaceTokenizerFactory"/>
389
+ </analyzer>
390
+ </fieldType>
391
+ -->
392
+
393
+ <!-- This is an example of using the KeywordTokenizer along
394
+ With various TokenFilterFactories to produce a sortable field
395
+ that does not include some properties of the source text
396
+ -->
221
397
  <fieldType name="alphaOnlySort" class="solr.TextField" sortMissingLast="true" omitNorms="true">
222
398
  <analyzer>
223
399
  <!-- KeywordTokenizer does no actual tokenizing, so the entire
224
400
  input string is preserved as a single token
225
401
  -->
226
402
  <tokenizer class="solr.KeywordTokenizerFactory"/>
227
- <filter class="schema.UnicodeNormalizationFilterFactory" version="icu4j" composed="false" remove_diacritics="true" remove_modifiers="true" fold="true" />
403
+ <!-- The LowerCase TokenFilter does what you expect, which can be
404
+ when you want your sorting to be case insensitive
405
+ -->
228
406
  <filter class="solr.LowerCaseFilterFactory" />
407
+ <!-- The TrimFilter removes any leading or trailing whitespace -->
229
408
  <filter class="solr.TrimFilterFactory" />
230
- <!--
231
- <filter class="solr.PatternReplaceFilterFactory" pattern="([^a-z\d])" replacement="" replace="all" />
232
- -->
409
+ <!-- The PatternReplaceFilter gives you the flexibility to use
410
+ Java Regular expression to replace any sequence of characters
411
+ matching a pattern with an arbitrary replacement string,
412
+ which may include back references to portions of the original
413
+ string matched by the pattern.
414
+
415
+ See the Java Regular Expression documentation for more
416
+ information on pattern and replacement string syntax.
417
+
418
+ http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/package-summary.html
419
+ -->
420
+ <filter class="solr.PatternReplaceFilterFactory"
421
+ pattern="([^a-z])" replacement="" replace="all"
422
+ />
233
423
  </analyzer>
234
424
  </fieldType>
235
- </types>
236
-
237
- <fields>
238
- <!-- NOTE: this is not a full list of fields in the index; dynamic fields are also used -->
239
- <field name="id" type="string" indexed="true" stored="true" required="true" />
240
- <field name="timestamp" type="date" indexed="true" stored="true" default="NOW" multiValued="false"/>
241
- <!-- default, catch all search field -->
242
- <field name="text" type="text" indexed="true" stored="false" multiValued="true"/>
243
-
244
- <!-- these display fields are NOT multi-valued -->
245
- <field name="marc_display" type="string" indexed="false" stored="true" multiValued="false"/>
246
- <field name="title_display" type="string" indexed="false" stored="true" multiValued="false"/>
247
- <field name="title_vern_display" type="string" indexed="false" stored="true" multiValued="false"/>
248
- <field name="subtitle_display" type="string" indexed="false" stored="true" multiValued="false"/>
249
- <field name="subtitle_vern_display" type="string" indexed="false" stored="true" multiValued="false"/>
250
- <field name="author_display" type="string" indexed="false" stored="true" multiValued="false"/>
251
- <field name="author_vern_display" type="string" indexed="false" stored="true" multiValued="false"/>
252
-
253
- <!-- these fields are also used for display, so they must be stored -->
254
- <field name="isbn_t" type="text" indexed="true" stored="true" multiValued="true"/>
255
- <field name="language_facet" type="string" indexed="true" stored="true" multiValued="true" />
256
- <field name="subject_topic_facet" type="string" indexed="true" stored="true" multiValued="true" />
257
- <field name="subject_era_facet" type="string" indexed="true" stored="true" multiValued="true" />
258
- <field name="subject_geo_facet" type="string" indexed="true" stored="true" multiValued="true" />
259
- <!-- pub_date is used for facet and display so it must be indexed and stored -->
260
- <field name="pub_date" type="string" indexed="true" stored="true" multiValued="true"/>
261
- <!-- pub_date sort uses new trie-based int fields, which are recommended for any int and are displayable, sortable, and range-query-able. In addition,
262
- we use 'tint' for faster range-queries. -->
263
- <field name="pub_date_sort" type="tint" indexed="true" stored="true" multiValued="false"/>
264
-
265
- <!-- format is used for facet, display, and choosing which partial to use for the show view, so it must be stored and indexed -->
266
- <field name="format" type="string" indexed="true" stored="true"/>
267
-
268
- <dynamicField name="*_i" type="int" indexed="true" stored="true"/>
269
- <dynamicField name="*_s" type="string" indexed="true" stored="true" multiValued="true"/>
270
- <dynamicField name="*_l" type="long" indexed="true" stored="true"/>
271
- <dynamicField name="*_t" type="text" indexed="true" stored="false" multiValued="true"/>
272
- <dynamicField name="*_b" type="boolean" indexed="true" stored="true"/>
273
- <dynamicField name="*_f" type="float" indexed="true" stored="true"/>
274
- <dynamicField name="*_d" type="double" indexed="true" stored="true"/>
275
- <dynamicField name="*_dt" type="date" indexed="true" stored="true"/>
276
- <dynamicField name="random*" type="random" />
277
-
278
- <dynamicField name="*_facet" type="string" indexed="true" stored="false" multiValued="true" />
279
- <dynamicField name="*_display" type="string" indexed="false" stored="true" multiValued="true" />
280
- <dynamicField name="*_sort" type="alphaOnlySort" indexed="true" stored="false"/>
281
- <dynamicField name="*_unstem_search" type="textNoStem" indexed="true" stored="false" multiValued="true" />
282
- <dynamicField name="*spell" type="textSpell" indexed="true" stored="false" multiValued="true"/>
283
425
 
284
- </fields>
285
-
286
- <uniqueKey>id</uniqueKey>
287
- <defaultSearchField>text</defaultSearchField>
288
- <solrQueryParser defaultOperator="OR"/>
289
-
290
- <!-- Copy Fields -->
291
-
292
- <!-- unstemmed fields -->
293
- <copyField source="title_t" dest="title_unstem_search"/>
294
- <copyField source="subtitle_t" dest="subtitle_unstem_search"/>
295
- <copyField source="title_addl_t" dest="title_addl_unstem_search"/>
296
- <copyField source="title_added_entry_t" dest="title_added_entry_unstem_search"/>
297
- <copyField source="title_series_t" dest="title_series_unstem_search"/>
298
- <copyField source="author_t" dest="author_unstem_search"/>
299
- <copyField source="author_addl_t" dest="author_addl_unstem_search"/>
300
- <copyField source="subject_t" dest="subject_unstem_search"/>
301
- <copyField source="subject_addl_t" dest="subject_addl_unstem_search"/>
302
- <copyField source="subject_topic_facet" dest="subject_topic_unstem_search"/>
303
-
304
- <!-- sort fields -->
305
- <copyField source="pub_date" dest="pub_date_sort"/>
306
-
307
-
308
- <!-- spellcheck fields -->
309
- <!-- default spell check; should match fields for default request handler -->
310
- <!-- it won't work with a copy of a copy field -->
311
- <copyField source="*_t" dest="spell"/>
312
- <copyField source="*_facet" dest="spell"/>
313
- <!-- title spell check; should match fields for title request handler -->
314
- <copyField source="title_t" dest="title_spell"/>
315
- <copyField source="subtitle_t" dest="title_spell"/>
316
- <copyField source="addl_titles_t" dest="title_spell"/>
317
- <copyField source="title_added_entry_t" dest="title_spell"/>
318
- <copyField source="title_series_t" dest="title_spell"/>
319
- <!-- author spell check; should match fields for author request handler -->
320
- <copyField source="author_t" dest="author_spell"/>
321
- <copyField source="author_addl_t" dest="author_spell"/>
322
- <!-- subject spell check; should match fields for subject request handler -->
323
- <copyField source="subject_topic_facet" dest="subject_spell"/>
324
- <copyField source="subject_t" dest="subject_spell"/>
325
- <copyField source="subject_addl_t" dest="subject_spell"/>
326
-
327
- <!-- OpenSearch query field should match request handler search fields -->
328
- <copyField source="title_t" dest="opensearch_display"/>
329
- <copyField source="subtitle_t" dest="opensearch_display"/>
330
- <copyField source="addl_titles_t" dest="opensearch_display"/>
331
- <copyField source="title_added_entry_t" dest="opensearch_display"/>
332
- <copyField source="title_series_t" dest="opensearch_display"/>
333
- <copyField source="author_t" dest="opensearch_display"/>
334
- <copyField source="author_addl_t" dest="opensearch_display"/>
335
- <copyField source="subject_topic_facet" dest="opensearch_display"/>
336
- <copyField source="subject_t" dest="opensearch_display"/>
337
- <copyField source="subject_addl_t" dest="opensearch_display"/>
426
+ <fieldtype name="phonetic" stored="false" indexed="true" class="solr.TextField" >
427
+ <analyzer>
428
+ <tokenizer class="solr.StandardTokenizerFactory"/>
429
+ <filter class="solr.DoubleMetaphoneFilterFactory" inject="false"/>
430
+ </analyzer>
431
+ </fieldtype>
432
+
433
+ <fieldtype name="payloads" stored="false" indexed="true" class="solr.TextField" >
434
+ <analyzer>
435
+ <tokenizer class="solr.WhitespaceTokenizerFactory"/>
436
+ <!--
437
+ The DelimitedPayloadTokenFilter can put payloads on tokens... for example,
438
+ a token of "foo|1.4" would be indexed as "foo" with a payload of 1.4f
439
+ Attributes of the DelimitedPayloadTokenFilterFactory :
440
+ "delimiter" - a one character delimiter. Default is | (pipe)
441
+ "encoder" - how to encode the following value into a playload
442
+ float -> org.apache.lucene.analysis.payloads.FloatEncoder,
443
+ integer -> o.a.l.a.p.IntegerEncoder
444
+ identity -> o.a.l.a.p.IdentityEncoder
445
+ Fully Qualified class name implementing PayloadEncoder, Encoder must have a no arg constructor.
446
+ -->
447
+ <filter class="solr.DelimitedPayloadTokenFilterFactory" encoder="float"/>
448
+ </analyzer>
449
+ </fieldtype>
450
+
451
+ <!-- lowercases the entire field value, keeping it as a single token. -->
452
+ <fieldType name="lowercase" class="solr.TextField" positionIncrementGap="100">
453
+ <analyzer>
454
+ <tokenizer class="solr.KeywordTokenizerFactory"/>
455
+ <filter class="solr.LowerCaseFilterFactory" />
456
+ </analyzer>
457
+ </fieldType>
458
+
459
+ <fieldType name="text_path" class="solr.TextField" positionIncrementGap="100">
460
+ <analyzer>
461
+ <tokenizer class="solr.PathHierarchyTokenizerFactory"/>
462
+ </analyzer>
463
+ </fieldType>
464
+
465
+ <!-- since fields of this type are by default not stored or indexed,
466
+ any data added to them will be ignored outright. -->
467
+ <fieldtype name="ignored" stored="false" indexed="false" multiValued="true" class="solr.StrField" />
468
+
469
+ <!-- This point type indexes the coordinates as separate fields (subFields)
470
+ If subFieldType is defined, it references a type, and a dynamic field
471
+ definition is created matching *___<typename>. Alternately, if
472
+ subFieldSuffix is defined, that is used to create the subFields.
473
+ Example: if subFieldType="double", then the coordinates would be
474
+ indexed in fields myloc_0___double,myloc_1___double.
475
+ Example: if subFieldSuffix="_d" then the coordinates would be indexed
476
+ in fields myloc_0_d,myloc_1_d
477
+ The subFields are an implementation detail of the fieldType, and end
478
+ users normally should not need to know about them.
479
+ -->
480
+ <fieldType name="point" class="solr.PointType" dimension="2" subFieldSuffix="_d"/>
481
+
482
+ <!-- A specialized field for geospatial search. If indexed, this fieldType must not be multivalued. -->
483
+ <fieldType name="location" class="solr.LatLonType" subFieldSuffix="_coordinate"/>
484
+
485
+ <!--
486
+ A Geohash is a compact representation of a latitude longitude pair in a single field.
487
+ See http://wiki.apache.org/solr/SpatialSearch
488
+ -->
489
+ <fieldtype name="geohash" class="solr.GeoHashField"/>
490
+ </types>
491
+
492
+
493
+ <fields>
494
+ <!-- Valid attributes for fields:
495
+ name: mandatory - the name for the field
496
+ type: mandatory - the name of a previously defined type from the
497
+ <types> section
498
+ indexed: true if this field should be indexed (searchable or sortable)
499
+ stored: true if this field should be retrievable
500
+ multiValued: true if this field may contain multiple values per document
501
+ omitNorms: (expert) set to true to omit the norms associated with
502
+ this field (this disables length normalization and index-time
503
+ boosting for the field, and saves some memory). Only full-text
504
+ fields or fields that need an index-time boost need norms.
505
+ termVectors: [false] set to true to store the term vector for a
506
+ given field.
507
+ When using MoreLikeThis, fields used for similarity should be
508
+ stored for best performance.
509
+ termPositions: Store position information with the term vector.
510
+ This will increase storage costs.
511
+ termOffsets: Store offset information with the term vector. This
512
+ will increase storage costs.
513
+ default: a value that should be used if no value is specified
514
+ when adding a document.
515
+ -->
516
+
517
+ <!-- NOTE: this is not a full list of fields in the index; dynamic fields are also used -->
518
+ <field name="id" type="string" indexed="true" stored="true" required="true" />
519
+ <field name="timestamp" type="date" indexed="true" stored="true" default="NOW" multiValued="false"/>
520
+ <!-- default, catch all search field -->
521
+ <field name="text" type="text" indexed="true" stored="false" multiValued="true"/>
522
+
523
+ <!-- these display fields are NOT multi-valued -->
524
+ <field name="marc_display" type="string" indexed="false" stored="true" multiValued="false"/>
525
+ <field name="title_display" type="string" indexed="false" stored="true" multiValued="false"/>
526
+ <field name="title_vern_display" type="string" indexed="false" stored="true" multiValued="false"/>
527
+ <field name="subtitle_display" type="string" indexed="false" stored="true" multiValued="false"/>
528
+ <field name="subtitle_vern_display" type="string" indexed="false" stored="true" multiValued="false"/>
529
+ <field name="author_display" type="string" indexed="false" stored="true" multiValued="false"/>
530
+ <field name="author_vern_display" type="string" indexed="false" stored="true" multiValued="false"/>
531
+
532
+ <!-- these fields are also used for display, so they must be stored -->
533
+ <field name="isbn_t" type="text" indexed="true" stored="true" multiValued="true"/>
534
+ <field name="language_facet" type="string" indexed="true" stored="true" multiValued="true" />
535
+ <field name="subject_topic_facet" type="string" indexed="true" stored="true" multiValued="true" />
536
+ <field name="subject_era_facet" type="string" indexed="true" stored="true" multiValued="true" />
537
+ <field name="subject_geo_facet" type="string" indexed="true" stored="true" multiValued="true" />
538
+ <!-- pub_date is used for facet and display so it must be indexed and stored -->
539
+ <field name="pub_date" type="string" indexed="true" stored="true" multiValued="true"/>
540
+ <!-- pub_date sort uses new trie-based int fields, which are recommended for any int and are displayable, sortable, and range-quer
541
+ we use 'tint' for faster range-queries. -->
542
+ <field name="pub_date_sort" type="tint" indexed="true" stored="true" multiValued="false"/>
543
+
544
+ <!-- format is used for facet, display, and choosing which partial to use for the show view, so it must be stored and indexed -->
545
+ <field name="format" type="string" indexed="true" stored="true"/>
546
+
547
+
548
+
549
+ <!-- Dynamic field definitions. If a field name is not found, dynamicFields
550
+ will be used if the name matches any of the patterns.
551
+ RESTRICTION: the glob-like pattern in the name attribute must have
552
+ a "*" only at the start or the end.
553
+ EXAMPLE: name="*_i" will match any field ending in _i (like myid_i, z_i)
554
+ Longer patterns will be matched first. if equal size patterns
555
+ both match, the first appearing in the schema will be used. -->
556
+ <dynamicField name="*_i" type="int" indexed="true" stored="true"/>
557
+ <dynamicField name="*_s" type="string" indexed="true" stored="true"/>
558
+ <dynamicField name="*_l" type="long" indexed="true" stored="true"/>
559
+ <dynamicField name="*_t" type="text" indexed="true" stored="true" multiValued="true"/>
560
+ <dynamicField name="*_txt" type="text_general" indexed="true" stored="true" multiValued="true"/>
561
+ <dynamicField name="*_b" type="boolean" indexed="true" stored="true"/>
562
+ <dynamicField name="*_f" type="float" indexed="true" stored="true"/>
563
+ <dynamicField name="*_d" type="double" indexed="true" stored="true"/>
564
+
565
+ <!-- Type used to index the lat and lon components for the "location" FieldType -->
566
+ <dynamicField name="*_coordinate" type="tdouble" indexed="true" stored="false"/>
567
+
568
+ <dynamicField name="*_dt" type="date" indexed="true" stored="true"/>
569
+ <dynamicField name="*_p" type="location" indexed="true" stored="true"/>
570
+
571
+ <!-- some trie-coded dynamic fields for faster range queries -->
572
+ <dynamicField name="*_ti" type="tint" indexed="true" stored="true"/>
573
+ <dynamicField name="*_tl" type="tlong" indexed="true" stored="true"/>
574
+ <dynamicField name="*_tf" type="tfloat" indexed="true" stored="true"/>
575
+ <dynamicField name="*_td" type="tdouble" indexed="true" stored="true"/>
576
+ <dynamicField name="*_tdt" type="tdate" indexed="true" stored="true"/>
577
+
578
+ <dynamicField name="*_pi" type="pint" indexed="true" stored="true"/>
579
+
580
+ <dynamicField name="ignored_*" type="ignored" multiValued="true"/>
581
+ <dynamicField name="attr_*" type="text_general" indexed="true" stored="true" multiValued="true"/>
582
+
583
+ <dynamicField name="random_*" type="random" />
584
+
585
+ <dynamicField name="*_display" type="string" indexed="false" stored="true" multiValued="true" />
586
+ <dynamicField name="*_facet" type="string" indexed="true" stored="false" multiValued="true" />
587
+ <dynamicField name="*_sort" type="alphaOnlySort" indexed="true" stored="false" multiValued="false" />
588
+ <dynamicField name="*_unstem_search" type="text_general" indexed="true" stored="false" multiValued="true" />
589
+ <dynamicField name="*spell" type="textSpell" indexed="true" stored="false" multiValued="true" />
590
+
591
+ <!-- uncomment the following to ignore any fields that don't already match an existing
592
+ field name or dynamic field, rather than reporting them as an error.
593
+ alternately, change the type="ignored" to some other type e.g. "text" if you want
594
+ unknown fields indexed and/or stored by default -->
595
+ <!--dynamicField name="*" type="ignored" multiValued="true" /-->
596
+
597
+ </fields>
598
+
599
+ <!-- Field to use to determine and enforce document uniqueness.
600
+ Unless this field is marked with required="false", it will be a required field
601
+ -->
602
+ <uniqueKey>id</uniqueKey>
603
+
604
+ <!-- field for the QueryParser to use when an explicit fieldname is absent -->
605
+ <defaultSearchField>text</defaultSearchField>
606
+
607
+ <!-- SolrQueryParser configuration: defaultOperator="AND|OR" -->
608
+ <solrQueryParser defaultOperator="OR"/>
609
+
610
+ <!-- copyField commands copy one field to another at the time a document
611
+ is added to the index. It's used either to index the same field differently,
612
+ or to add multiple fields to the same field for easier/faster searching. -->
613
+ <!-- Copy Fields -->
614
+
615
+ <!-- unstemmed fields -->
616
+ <copyField source="title_t" dest="title_unstem_search"/>
617
+ <copyField source="subtitle_t" dest="subtitle_unstem_search"/>
618
+ <copyField source="title_addl_t" dest="title_addl_unstem_search"/>
619
+ <copyField source="title_added_entry_t" dest="title_added_entry_unstem_search"/>
620
+ <copyField source="title_series_t" dest="title_series_unstem_search"/>
621
+ <copyField source="author_t" dest="author_unstem_search"/>
622
+ <copyField source="author_addl_t" dest="author_addl_unstem_search"/>
623
+ <copyField source="subject_t" dest="subject_unstem_search"/>
624
+ <copyField source="subject_addl_t" dest="subject_addl_unstem_search"/>
625
+ <copyField source="subject_topic_facet" dest="subject_topic_unstem_search"/>
626
+
627
+ <!-- sort fields -->
628
+ <copyField source="pub_date" dest="pub_date_sort"/>
629
+
630
+
631
+ <!-- spellcheck fields -->
632
+ <!-- default spell check; should match fields for default request handler -->
633
+ <!-- it won't work with a copy of a copy field -->
634
+ <copyField source="*_t" dest="spell"/>
635
+ <copyField source="*_facet" dest="spell"/>
636
+ <!-- title spell check; should match fields for title request handler -->
637
+ <copyField source="title_t" dest="title_spell"/>
638
+ <copyField source="subtitle_t" dest="title_spell"/>
639
+ <copyField source="addl_titles_t" dest="title_spell"/>
640
+ <copyField source="title_added_entry_t" dest="title_spell"/>
641
+ <copyField source="title_series_t" dest="title_spell"/>
642
+ <!-- author spell check; should match fields for author request handler -->
643
+ <copyField source="author_t" dest="author_spell"/>
644
+ <copyField source="author_addl_t" dest="author_spell"/>
645
+ <!-- subject spell check; should match fields for subject request handler -->
646
+ <copyField source="subject_topic_facet" dest="subject_spell"/>
647
+ <copyField source="subject_t" dest="subject_spell"/>
648
+ <copyField source="subject_addl_t" dest="subject_spell"/>
649
+
650
+ <!-- OpenSearch query field should match request handler search fields -->
651
+ <copyField source="title_t" dest="opensearch_display"/>
652
+ <copyField source="subtitle_t" dest="opensearch_display"/>
653
+ <copyField source="addl_titles_t" dest="opensearch_display"/>
654
+ <copyField source="title_added_entry_t" dest="opensearch_display"/>
655
+ <copyField source="title_series_t" dest="opensearch_display"/>
656
+ <copyField source="author_t" dest="opensearch_display"/>
657
+ <copyField source="author_addl_t" dest="opensearch_display"/>
658
+ <copyField source="subject_topic_facet" dest="opensearch_display"/>
659
+ <copyField source="subject_t" dest="opensearch_display"/>
660
+ <copyField source="subject_addl_t" dest="opensearch_display"/>
661
+
662
+
663
+ <!-- Above, multiple source fields are copied to the [text] field.
664
+ Another way to map multiple source fields to the same
665
+ destination field is to use the dynamic field syntax.
666
+ copyField also supports a maxChars to copy setting. -->
667
+
668
+ <!-- <copyField source="*_t" dest="text" maxChars="3000"/> -->
669
+
670
+ <!-- copy name to alphaNameSort, a field designed for sorting by name -->
671
+ <!-- <copyField source="name" dest="alphaNameSort"/> -->
672
+
673
+
674
+ <!-- Similarity is the scoring routine for each document vs. a query.
675
+ A custom similarity may be specified here, but the default is fine
676
+ for most applications. -->
677
+ <!-- <similarity class="org.apache.lucene.search.DefaultSimilarity"/> -->
678
+ <!-- ... OR ...
679
+ Specify a SimilarityFactory class name implementation
680
+ allowing parameters to be used.
681
+ -->
682
+ <!--
683
+ <similarity class="com.example.solr.CustomSimilarityFactory">
684
+ <str name="paramkey">param value</str>
685
+ </similarity>
686
+ -->
687
+
338
688
 
339
689
  </schema>