blacklight 6.21.0 → 7.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (420) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.npmignore +23 -0
  4. data/.rubocop.yml +40 -16
  5. data/.rubocop_todo.yml +479 -375
  6. data/.solr_wrapper.yml +9 -2
  7. data/.travis.yml +23 -27
  8. data/Gemfile +3 -4
  9. data/README.md +22 -5
  10. data/Rakefile +3 -2
  11. data/VERSION +1 -1
  12. data/Vagrantfile +2 -0
  13. data/app/assets/images/blacklight/list.svg +1 -0
  14. data/app/assets/images/blacklight/search.svg +1 -0
  15. data/app/assets/javascripts/blacklight/blacklight.js +497 -57
  16. data/app/assets/stylesheets/blacklight/_balanced_list.scss +7 -12
  17. data/app/assets/stylesheets/blacklight/_blacklight_base.scss +18 -15
  18. data/app/assets/stylesheets/blacklight/_bookmark.scss +1 -13
  19. data/app/assets/stylesheets/blacklight/_bootstrap_overrides.scss +27 -0
  20. data/app/assets/stylesheets/blacklight/_constraints.scss +17 -25
  21. data/app/assets/stylesheets/blacklight/_controls.scss +8 -16
  22. data/app/assets/stylesheets/blacklight/_facets.scss +64 -93
  23. data/app/assets/stylesheets/blacklight/_header.scss +35 -48
  24. data/app/assets/stylesheets/blacklight/_icons.scss +35 -0
  25. data/app/assets/stylesheets/blacklight/_layout.scss +0 -10
  26. data/app/assets/stylesheets/blacklight/_mixins.scss +15 -0
  27. data/app/assets/stylesheets/blacklight/_modal.scss +9 -17
  28. data/app/assets/stylesheets/blacklight/_pagination.scss +2 -17
  29. data/app/assets/stylesheets/blacklight/_search_form.scss +7 -0
  30. data/app/assets/stylesheets/blacklight/_search_history.scss +5 -13
  31. data/app/assets/stylesheets/blacklight/_search_results.scss +9 -8
  32. data/app/assets/stylesheets/blacklight/_twitter_typeahead.scss +1 -2
  33. data/app/assets/stylesheets/blacklight/blacklight.scss +1 -1
  34. data/app/builders/blacklight/action_builder.rb +57 -0
  35. data/app/controllers/bookmarks_controller.rb +2 -2
  36. data/app/controllers/catalog_controller.rb +2 -2
  37. data/app/controllers/concerns/blacklight/base.rb +0 -33
  38. data/app/controllers/concerns/blacklight/bookmarks.rb +19 -30
  39. data/app/controllers/concerns/blacklight/catalog.rb +263 -210
  40. data/app/controllers/concerns/blacklight/controller.rb +102 -124
  41. data/app/controllers/concerns/blacklight/default_component_configuration.rb +12 -43
  42. data/app/controllers/concerns/blacklight/facet.rb +3 -0
  43. data/app/controllers/concerns/blacklight/search_context.rb +11 -11
  44. data/app/controllers/concerns/blacklight/search_fields.rb +4 -14
  45. data/app/controllers/concerns/blacklight/search_history.rb +1 -6
  46. data/app/controllers/concerns/blacklight/token_based_user.rb +5 -7
  47. data/app/helpers/blacklight/blacklight_helper_behavior.rb +36 -118
  48. data/app/helpers/blacklight/catalog_helper_behavior.rb +94 -88
  49. data/app/helpers/blacklight/component_helper_behavior.rb +19 -19
  50. data/app/helpers/blacklight/configuration_helper_behavior.rb +30 -57
  51. data/app/helpers/blacklight/facets_helper_behavior.rb +55 -51
  52. data/app/helpers/blacklight/hash_as_hidden_fields_helper_behavior.rb +9 -11
  53. data/app/helpers/blacklight/icon_helper_behavior.rb +18 -0
  54. data/app/helpers/blacklight/layout_helper_behavior.rb +3 -10
  55. data/app/helpers/blacklight/render_constraints_helper_behavior.rb +8 -6
  56. data/app/helpers/blacklight/render_partials_helper_behavior.rb +195 -0
  57. data/app/helpers/blacklight/search_history_constraints_helper_behavior.rb +19 -11
  58. data/app/helpers/blacklight/suggest_helper_behavior.rb +1 -0
  59. data/app/helpers/blacklight/url_helper_behavior.rb +50 -41
  60. data/app/{assets/javascripts → javascript}/blacklight/autocomplete.js +3 -2
  61. data/app/javascript/blacklight/bookmark_toggle.js +25 -0
  62. data/app/{assets/javascripts → javascript}/blacklight/checkbox_submit.js +66 -71
  63. data/app/{assets/javascripts → javascript}/blacklight/collapsable.js +1 -1
  64. data/app/javascript/blacklight/core.js +41 -0
  65. data/app/{assets/javascripts → javascript}/blacklight/facet_load.js +6 -6
  66. data/app/{assets/javascripts/blacklight/ajax_modal.js → javascript/blacklight/modal.js} +62 -64
  67. data/app/{assets/javascripts → javascript}/blacklight/search_context.js +10 -3
  68. data/app/models/blacklight/facet_paginator.rb +3 -3
  69. data/app/models/blacklight/icon.rb +56 -0
  70. data/app/models/blacklight/solr/facet_paginator.rb +3 -3
  71. data/app/models/blacklight/suggest_search.rb +1 -1
  72. data/app/models/bookmark.rb +5 -10
  73. data/app/models/concerns/blacklight/configurable.rb +13 -13
  74. data/app/models/concerns/blacklight/document.rb +23 -39
  75. data/app/models/concerns/blacklight/document/active_model_shim.rb +8 -11
  76. data/app/models/concerns/blacklight/document/cache_key.rb +1 -1
  77. data/app/models/concerns/blacklight/document/dublin_core.rb +2 -2
  78. data/app/models/concerns/blacklight/document/email.rb +1 -1
  79. data/app/models/concerns/blacklight/document/extensions.rb +5 -5
  80. data/app/models/concerns/blacklight/document/semantic_fields.rb +9 -9
  81. data/app/models/concerns/blacklight/document/sms.rb +1 -1
  82. data/app/models/concerns/blacklight/solr/document.rb +8 -8
  83. data/app/models/concerns/blacklight/user.rb +7 -6
  84. data/app/models/record_mailer.rb +5 -6
  85. data/app/models/search.rb +5 -7
  86. data/app/presenters/blacklight/document_presenter.rb +25 -140
  87. data/app/presenters/blacklight/field_presenter.rb +7 -5
  88. data/app/presenters/blacklight/index_presenter.rb +41 -70
  89. data/app/presenters/blacklight/json_presenter.rb +10 -14
  90. data/app/presenters/blacklight/link_alternate_presenter.rb +3 -1
  91. data/app/presenters/blacklight/rendering/abstract_step.rb +7 -5
  92. data/app/presenters/blacklight/rendering/helper_method.rb +10 -8
  93. data/app/presenters/blacklight/rendering/join.rb +5 -3
  94. data/app/presenters/blacklight/rendering/link_to_facet.rb +23 -19
  95. data/app/presenters/blacklight/rendering/microdata.rb +6 -3
  96. data/app/presenters/blacklight/rendering/pipeline.rb +7 -5
  97. data/app/presenters/blacklight/rendering/terminator.rb +2 -0
  98. data/app/presenters/blacklight/search_bar_presenter.rb +39 -0
  99. data/app/presenters/blacklight/show_presenter.rb +26 -72
  100. data/app/presenters/blacklight/thumbnail_presenter.rb +74 -0
  101. data/app/services/blacklight/document_factory.rb +13 -0
  102. data/app/services/blacklight/field_retriever.rb +26 -24
  103. data/app/services/blacklight/search_service.rb +152 -0
  104. data/app/values/blacklight/types.rb +31 -0
  105. data/app/views/blacklight/nav/_bookmark.html.erb +2 -2
  106. data/app/views/blacklight/nav/_search_history.html.erb +1 -1
  107. data/app/views/bookmarks/_tools.html.erb +2 -2
  108. data/app/views/bookmarks/index.html.erb +12 -13
  109. data/app/views/catalog/_bookmark_control.html.erb +26 -10
  110. data/app/views/catalog/_citation.html.erb +18 -23
  111. data/app/views/catalog/_constraints.html.erb +6 -7
  112. data/app/views/catalog/_constraints_element.html.erb +6 -6
  113. data/app/views/catalog/_did_you_mean.html.erb +1 -1
  114. data/app/views/catalog/{_document_default.atom.builder → _document.atom.builder} +19 -18
  115. data/app/views/catalog/_document.html.erb +5 -3
  116. data/app/views/catalog/{_document_default.rss.builder → _document.rss.builder} +2 -0
  117. data/app/views/catalog/_document_action.html.erb +2 -1
  118. data/app/views/catalog/_email_form.html.erb +8 -4
  119. data/app/views/catalog/_facet_index_navigation.html.erb +5 -4
  120. data/app/views/catalog/_facet_layout.html.erb +6 -10
  121. data/app/views/catalog/_facet_limit.html.erb +3 -2
  122. data/app/views/catalog/_facet_pagination.html.erb +8 -8
  123. data/app/views/catalog/_facet_pivot.html.erb +2 -2
  124. data/app/views/catalog/_facets.html.erb +9 -12
  125. data/app/views/catalog/_field.json.jbuilder +10 -0
  126. data/app/views/catalog/{_group_default.html.erb → _group.html.erb} +1 -1
  127. data/app/views/catalog/_home_text.html.erb +32 -36
  128. data/app/views/catalog/_index.html.erb +10 -0
  129. data/app/views/catalog/{_index_header_default.html.erb → _index_header.html.erb} +3 -3
  130. data/app/views/catalog/_per_page_widget.html.erb +6 -7
  131. data/app/views/catalog/_previous_next_doc.html.erb +6 -14
  132. data/app/views/catalog/_results_pagination.html.erb +2 -2
  133. data/app/views/catalog/_search_form.html.erb +12 -8
  134. data/app/views/catalog/_search_header.html.erb +0 -3
  135. data/app/views/catalog/_search_results.html.erb +6 -2
  136. data/app/views/catalog/_show.html.erb +8 -0
  137. data/app/views/catalog/{_show_header_default.html.erb → _show_header.html.erb} +0 -0
  138. data/app/views/catalog/_show_main_content.html.erb +4 -4
  139. data/app/views/catalog/_show_more_like_this.html.erb +1 -1
  140. data/app/views/catalog/_show_sidebar.html.erb +3 -3
  141. data/app/views/catalog/_show_tools.html.erb +10 -12
  142. data/app/views/catalog/_sms_form.html.erb +8 -4
  143. data/app/views/catalog/_sort_and_per_page.html.erb +3 -3
  144. data/app/views/catalog/_sort_widget.html.erb +7 -7
  145. data/app/views/catalog/_thumbnail.html.erb +5 -0
  146. data/app/views/catalog/_view_type_group.html.erb +2 -2
  147. data/app/views/catalog/_zero_results.html.erb +1 -1
  148. data/app/views/catalog/citation.html.erb +1 -1
  149. data/app/views/catalog/citation.js.erb +9 -1
  150. data/app/views/catalog/email.html.erb +5 -3
  151. data/app/views/catalog/email_success.html.erb +12 -8
  152. data/app/views/catalog/facet.html.erb +10 -8
  153. data/app/views/catalog/facet.json.jbuilder +2 -0
  154. data/app/views/catalog/index.atom.builder +13 -16
  155. data/app/views/catalog/index.html.erb +9 -11
  156. data/app/views/catalog/index.json.jbuilder +84 -3
  157. data/app/views/catalog/index.rss.builder +7 -5
  158. data/app/views/catalog/opensearch.xml.builder +12 -10
  159. data/app/views/catalog/show.html.erb +11 -6
  160. data/app/views/catalog/show.json.jbuilder +21 -0
  161. data/app/views/catalog/sms.html.erb +3 -1
  162. data/app/views/catalog/sms_success.html.erb +12 -8
  163. data/app/views/kaminari/blacklight/_first_page.html.erb +2 -2
  164. data/app/views/kaminari/blacklight/_gap.html.erb +2 -2
  165. data/app/views/kaminari/blacklight/_last_page.html.erb +2 -2
  166. data/app/views/kaminari/blacklight/_next_page.html.erb +5 -5
  167. data/app/views/kaminari/blacklight/_page.html.erb +5 -3
  168. data/app/views/kaminari/blacklight/_prev_page.html.erb +4 -4
  169. data/app/views/kaminari/blacklight_compact/_paginator.html.erb +4 -4
  170. data/app/views/layouts/blacklight.html.erb +14 -41
  171. data/app/views/layouts/blacklight/base.html.erb +35 -0
  172. data/app/views/layouts/catalog_result.html.erb +11 -0
  173. data/app/views/search_history/index.html.erb +16 -21
  174. data/app/views/{_flash_msg.html.erb → shared/_flash_msg.html.erb} +0 -0
  175. data/app/views/shared/_header_navbar.html.erb +8 -13
  176. data/app/views/shared/_modal.html.erb +6 -0
  177. data/app/views/shared/_user_util_links.html.erb +22 -0
  178. data/blacklight.gemspec +8 -10
  179. data/config/i18n-tasks.yml +17 -0
  180. data/config/locales/blacklight.de.yml +71 -82
  181. data/config/locales/blacklight.en.yml +15 -27
  182. data/config/locales/blacklight.es.yml +14 -26
  183. data/config/locales/blacklight.fr.yml +16 -33
  184. data/config/locales/blacklight.hu.yml +212 -0
  185. data/config/locales/blacklight.it.yml +15 -26
  186. data/config/locales/blacklight.nl.yml +212 -0
  187. data/config/locales/blacklight.pt-BR.yml +24 -29
  188. data/config/locales/blacklight.sq.yml +4 -28
  189. data/config/locales/blacklight.zh.yml +3 -25
  190. data/config/routes.rb +2 -10
  191. data/db/migrate/20140202020202_create_bookmarks.rb +0 -1
  192. data/db/migrate/20140320000000_add_polymorphic_type_to_bookmarks.rb +1 -1
  193. data/lib/blacklight.rb +6 -4
  194. data/lib/blacklight/abstract_repository.rb +9 -9
  195. data/lib/blacklight/configuration.rb +99 -88
  196. data/lib/blacklight/configuration/context.rb +12 -1
  197. data/lib/blacklight/configuration/facet_field.rb +16 -9
  198. data/lib/blacklight/configuration/field.rb +32 -3
  199. data/lib/blacklight/configuration/fields.rb +15 -17
  200. data/lib/blacklight/configuration/null_field.rb +2 -0
  201. data/lib/blacklight/configuration/search_field.rb +2 -2
  202. data/lib/blacklight/configuration/sort_field.rb +2 -2
  203. data/lib/blacklight/configuration/view_config.rb +4 -0
  204. data/lib/blacklight/engine.rb +8 -9
  205. data/lib/blacklight/exceptions.rb +4 -7
  206. data/lib/blacklight/{utils.rb → nested_open_struct_with_hash_access.rb} +9 -81
  207. data/lib/blacklight/open_struct_with_hash_access.rb +49 -0
  208. data/lib/blacklight/parameters.rb +1 -1
  209. data/lib/blacklight/routes/exportable.rb +1 -3
  210. data/lib/blacklight/routes/searchable.rb +3 -3
  211. data/lib/blacklight/runtime_registry.rb +2 -0
  212. data/lib/blacklight/search_builder.rb +28 -35
  213. data/lib/blacklight/search_state.rb +10 -8
  214. data/lib/blacklight/solr/repository.rb +4 -3
  215. data/lib/blacklight/solr/request.rb +1 -1
  216. data/lib/blacklight/solr/response.rb +29 -30
  217. data/lib/blacklight/solr/response/facets.rb +29 -31
  218. data/lib/blacklight/solr/response/group.rb +3 -3
  219. data/lib/blacklight/solr/response/group_response.rb +1 -1
  220. data/lib/blacklight/solr/response/more_like_this.rb +2 -2
  221. data/lib/blacklight/solr/response/response.rb +2 -2
  222. data/lib/blacklight/solr/response/spelling.rb +4 -3
  223. data/lib/blacklight/solr/search_builder_behavior.rb +25 -29
  224. data/lib/blacklight/version.rb +1 -1
  225. data/lib/generators/blacklight/assets_generator.rb +13 -12
  226. data/lib/generators/blacklight/controller_generator.rb +4 -5
  227. data/lib/generators/blacklight/document_generator.rb +1 -1
  228. data/lib/generators/blacklight/install_generator.rb +17 -27
  229. data/lib/generators/blacklight/search_builder_generator.rb +1 -1
  230. data/lib/generators/blacklight/{solr5_generator.rb → solr_generator.rb} +12 -6
  231. data/lib/generators/blacklight/templates/.solr_wrapper.yml +5 -0
  232. data/lib/generators/blacklight/templates/alternate_controller.rb +4 -4
  233. data/lib/generators/blacklight/templates/blacklight.scss +0 -2
  234. data/lib/generators/blacklight/templates/catalog_controller.rb +57 -50
  235. data/lib/generators/blacklight/templates/config/blacklight.yml +1 -13
  236. data/{solr → lib/generators/blacklight/templates/solr}/conf/_rest_managed.json +0 -0
  237. data/{solr → lib/generators/blacklight/templates/solr}/conf/admin-extra.html +0 -0
  238. data/{solr → lib/generators/blacklight/templates/solr}/conf/elevate.xml +0 -0
  239. data/{solr → lib/generators/blacklight/templates/solr}/conf/mapping-ISOLatin1Accent.txt +0 -0
  240. data/{solr → lib/generators/blacklight/templates/solr}/conf/protwords.txt +0 -0
  241. data/lib/generators/blacklight/templates/solr/conf/schema.xml +388 -0
  242. data/{solr → lib/generators/blacklight/templates/solr}/conf/scripts.conf +0 -0
  243. data/lib/generators/blacklight/templates/solr/conf/solrconfig.xml +195 -0
  244. data/{solr → lib/generators/blacklight/templates/solr}/conf/spellings.txt +0 -0
  245. data/{solr → lib/generators/blacklight/templates/solr}/conf/stopwords.txt +0 -0
  246. data/{solr → lib/generators/blacklight/templates/solr}/conf/stopwords_en.txt +0 -0
  247. data/{solr → lib/generators/blacklight/templates/solr}/conf/synonyms.txt +0 -0
  248. data/{solr → lib/generators/blacklight/templates/solr}/conf/xslt/example.xsl +0 -0
  249. data/{solr → lib/generators/blacklight/templates/solr}/conf/xslt/example_atom.xsl +0 -0
  250. data/{solr → lib/generators/blacklight/templates/solr}/conf/xslt/example_rss.xsl +0 -0
  251. data/{solr → lib/generators/blacklight/templates/solr}/conf/xslt/luke.xsl +0 -0
  252. data/lib/generators/blacklight/test_support_generator.rb +10 -10
  253. data/lib/generators/blacklight/user_generator.rb +5 -6
  254. data/lib/railties/blacklight.rake +7 -6
  255. data/package-lock.json +2195 -0
  256. data/package.json +29 -0
  257. data/spec/controllers/alternate_controller_spec.rb +5 -4
  258. data/spec/controllers/application_controller_spec.rb +1 -5
  259. data/spec/controllers/blacklight/base_spec.rb +6 -3
  260. data/spec/controllers/blacklight/catalog/component_configuration_spec.rb +11 -7
  261. data/spec/controllers/blacklight/facet_spec.rb +1 -2
  262. data/spec/controllers/blacklight/search_fields_spec.rb +25 -34
  263. data/spec/controllers/bookmarks_controller_spec.rb +13 -13
  264. data/spec/controllers/catalog_controller_spec.rb +332 -164
  265. data/spec/controllers/search_history_controller_spec.rb +6 -6
  266. data/spec/features/alternate_controller_spec.rb +4 -4
  267. data/spec/features/autocomplete_spec.rb +4 -2
  268. data/spec/features/bookmarks_spec.rb +10 -10
  269. data/spec/features/did_you_mean_spec.rb +7 -12
  270. data/spec/features/facets_spec.rb +16 -16
  271. data/spec/features/record_view_spec.rb +12 -18
  272. data/spec/features/search_context_spec.rb +6 -7
  273. data/spec/features/search_crawler_spec.rb +3 -5
  274. data/spec/features/search_filters_spec.rb +80 -80
  275. data/spec/features/search_formats_spec.rb +1 -1
  276. data/spec/features/search_history_spec.rb +6 -29
  277. data/spec/features/search_pagination_spec.rb +4 -2
  278. data/spec/features/search_results_spec.rb +14 -12
  279. data/spec/features/search_sort_spec.rb +2 -2
  280. data/spec/features/search_spec.rb +7 -12
  281. data/spec/features/sitelinks_search_box.rb +4 -4
  282. data/{solr → spec/fixtures}/sample_solr_documents.yml +688 -688
  283. data/spec/helpers/{configuration_helper_spec.rb → blacklight/configuration_helper_behavior_spec.rb} +97 -92
  284. data/spec/helpers/{facets_helper_spec.rb → blacklight/facets_helper_behavior_spec.rb} +72 -67
  285. data/spec/helpers/{hash_as_hidden_fields_spec.rb → blacklight/hash_as_hidden_fields_behavior_spec.rb} +2 -2
  286. data/spec/helpers/blacklight/icon_helper_behavior_spec.rb +10 -0
  287. data/spec/helpers/{layout_helper_spec.rb → blacklight/layout_helper_behavior_spec.rb} +5 -15
  288. data/spec/helpers/{render_constraints_helper_spec.rb → blacklight/render_constraints_helper_behavior_spec.rb} +10 -6
  289. data/spec/helpers/blacklight/render_partials_helper_behavior_spec.rb +92 -0
  290. data/spec/helpers/{search_history_constraints_helper_spec.rb → blacklight/search_history_constraints_helper_behavior_spec.rb} +29 -30
  291. data/spec/helpers/{suggest_helper_spec.rb → blacklight/suggest_helper_behavior_spec.rb} +9 -2
  292. data/spec/helpers/{url_helper_spec.rb → blacklight/url_helper_behavior_spec.rb} +56 -54
  293. data/spec/helpers/blacklight_helper_spec.rb +62 -151
  294. data/spec/helpers/catalog_helper_spec.rb +80 -96
  295. data/spec/i18n_spec.rb +18 -0
  296. data/spec/integration/generators/blacklight/{solr5_generator_spec.rb → solr_generator_spec.rb} +21 -13
  297. data/spec/lib/blacklight/configuration/facet_field_spec.rb +13 -0
  298. data/spec/lib/blacklight/configuration/field_spec.rb +15 -0
  299. data/spec/lib/blacklight/nested_open_struct_with_hash_access_spec.rb +17 -0
  300. data/spec/lib/blacklight/open_struct_with_hash_access_spec.rb +148 -0
  301. data/spec/lib/blacklight/parameters_spec.rb +4 -2
  302. data/spec/lib/blacklight/search_state_spec.rb +53 -36
  303. data/spec/lib/blacklight_spec.rb +14 -15
  304. data/spec/lib/tasks/blacklight_task_spec.rb +4 -6
  305. data/spec/models/blacklight/configurable_spec.rb +24 -27
  306. data/spec/models/blacklight/configuration/context_spec.rb +9 -10
  307. data/spec/models/blacklight/configuration_spec.rb +188 -165
  308. data/spec/models/blacklight/document/active_model_shim_spec.rb +15 -6
  309. data/spec/models/blacklight/document/cache_key_spec.rb +9 -2
  310. data/spec/models/blacklight/document/dublin_core_spec.rb +17 -20
  311. data/spec/models/blacklight/document/email_spec.rb +10 -10
  312. data/spec/models/blacklight/document/sms_spec.rb +10 -10
  313. data/spec/models/blacklight/document_spec.rb +10 -22
  314. data/spec/models/blacklight/facet_paginator_spec.rb +40 -30
  315. data/spec/models/blacklight/icon_spec.rb +44 -0
  316. data/spec/models/blacklight/search_builder_spec.rb +41 -26
  317. data/spec/models/blacklight/solr/document_spec.rb +224 -216
  318. data/spec/models/blacklight/solr/facet_paginator_spec.rb +6 -4
  319. data/spec/models/blacklight/solr/repository_spec.rb +50 -42
  320. data/spec/models/blacklight/solr/request_spec.rb +17 -18
  321. data/spec/models/blacklight/solr/response/facets_spec.rb +58 -58
  322. data/spec/models/blacklight/solr/response/group_response_spec.rb +16 -22
  323. data/spec/models/blacklight/solr/response/group_spec.rb +18 -25
  324. data/spec/models/blacklight/solr/response_spec.rb +56 -55
  325. data/spec/models/blacklight/solr/search_builder_spec.rb +150 -164
  326. data/spec/models/blacklight/suggest/response_spec.rb +1 -0
  327. data/spec/models/blacklight/suggest_search_spec.rb +4 -4
  328. data/spec/models/blacklight/user_spec.rb +9 -11
  329. data/spec/models/bookmark_spec.rb +7 -6
  330. data/spec/models/record_mailer_spec.rb +23 -21
  331. data/spec/models/search_spec.rb +19 -18
  332. data/spec/models/solr_document_spec.rb +33 -5
  333. data/spec/presenters/blacklight/document_presenter_spec.rb +86 -0
  334. data/spec/presenters/{index_presenter_spec.rb → blacklight/index_presenter_spec.rb} +25 -62
  335. data/spec/presenters/blacklight/json_presenter_spec.rb +59 -0
  336. data/spec/presenters/blacklight/link_alternate_presenter_spec.rb +3 -0
  337. data/spec/presenters/blacklight/search_bar_presenter_spec.rb +79 -0
  338. data/spec/presenters/{show_presenter_spec.rb → blacklight/show_presenter_spec.rb} +47 -62
  339. data/spec/presenters/pipeline_spec.rb +18 -11
  340. data/spec/presenters/thumbnail_presenter_spec.rb +174 -0
  341. data/spec/routing/catalog_routing_spec.rb +13 -31
  342. data/spec/services/blacklight/search_service_spec.rb +488 -0
  343. data/spec/spec_helper.rb +22 -15
  344. data/spec/support/features.rb +1 -1
  345. data/spec/support/features/session_helpers.rb +4 -4
  346. data/spec/test_app_templates/Gemfile.extra +2 -5
  347. data/spec/test_app_templates/lib/generators/test_app_generator.rb +12 -13
  348. data/spec/views/catalog/_constraints.html.erb_spec.rb +3 -6
  349. data/spec/views/catalog/_constraints_element.html.erb_spec.rb +17 -13
  350. data/spec/views/catalog/_document.html.erb_spec.rb +11 -11
  351. data/spec/views/catalog/_document_list.html.erb_spec.rb +2 -1
  352. data/spec/views/catalog/_facet_index_navigation.html.erb_spec.rb +5 -5
  353. data/spec/views/catalog/_facet_layout.html.erb_spec.rb +6 -6
  354. data/spec/views/catalog/_facets.html.erb_spec.rb +10 -12
  355. data/spec/views/catalog/{_index_default.erb_spec.rb → _index.html.erb_spec.rb} +14 -15
  356. data/spec/views/catalog/{_index_header_default.html.erb_spec.rb → _index_header.html.erb_spec.rb} +6 -9
  357. data/spec/views/catalog/_paginate_compact.html.erb_spec.rb +7 -30
  358. data/spec/views/catalog/_search_header.erb_spec.rb +1 -3
  359. data/spec/views/catalog/{_show_default.erb_spec.rb → _show.html.erb_spec.rb} +13 -14
  360. data/spec/views/catalog/_show_sidebar.erb_spec.rb +6 -9
  361. data/spec/views/catalog/_show_tools.html.erb_spec.rb +5 -5
  362. data/spec/views/catalog/_sort_and_per_page.html.erb_spec.rb +1 -2
  363. data/spec/views/catalog/_sort_widget.html.erb_spec.rb +3 -1
  364. data/spec/views/catalog/{_thumbnail_default.erb_spec.rb → _thumbnail.html.erb_spec.rb} +7 -9
  365. data/spec/views/catalog/_view_type_group.html.erb_spec.rb +12 -10
  366. data/spec/views/catalog/email_success.html.erb_spec.rb +8 -0
  367. data/spec/views/catalog/facet.html.erb_spec.rb +4 -3
  368. data/spec/views/catalog/facet.json.jbuilder_spec.rb +3 -2
  369. data/spec/views/catalog/index.atom.builder_spec.rb +11 -6
  370. data/spec/views/catalog/index.html.erb_spec.rb +6 -8
  371. data/spec/views/catalog/index.json.jbuilder_spec.rb +119 -26
  372. data/spec/views/catalog/opensearch.xml.builder_spec.rb +1 -1
  373. data/spec/views/catalog/show.html.erb_spec.rb +8 -8
  374. data/spec/views/catalog/show.json.jbuilder_spec.rb +40 -0
  375. data/spec/views/catalog/sms_success.html.erb_spec.rb +8 -0
  376. data/spec/views/{_user_util_links.html.erb_spec.rb → shared/_user_util_links.html.erb_spec.rb} +4 -7
  377. data/tasks/blacklight.rake +8 -4
  378. data/template.demo.rb +3 -11
  379. metadata +175 -195
  380. data/app/assets/javascripts/blacklight/autofocus.js +0 -16
  381. data/app/assets/javascripts/blacklight/bookmark_toggle.js +0 -23
  382. data/app/assets/javascripts/blacklight/core.js +0 -30
  383. data/app/controllers/concerns/blacklight/request_builders.rb +0 -77
  384. data/app/controllers/concerns/blacklight/saved_searches.rb +0 -70
  385. data/app/controllers/concerns/blacklight/search_helper.rb +0 -161
  386. data/app/controllers/concerns/blacklight/suggest.rb +0 -25
  387. data/app/controllers/saved_searches_controller.rb +0 -4
  388. data/app/controllers/suggest_controller.rb +0 -4
  389. data/app/helpers/blacklight/deprecated_url_helper_behavior.rb +0 -57
  390. data/app/helpers/blacklight/render_partials_helper.rb +0 -205
  391. data/app/helpers/blacklight_configuration_helper.rb +0 -4
  392. data/app/helpers/blacklight_url_helper.rb +0 -4
  393. data/app/helpers/component_helper.rb +0 -4
  394. data/app/helpers/facets_helper.rb +0 -4
  395. data/app/helpers/hash_as_hidden_fields_helper.rb +0 -4
  396. data/app/helpers/layout_helper.rb +0 -4
  397. data/app/helpers/render_constraints_helper.rb +0 -4
  398. data/app/helpers/search_history_constraints_helper.rb +0 -4
  399. data/app/helpers/suggest_helper.rb +0 -4
  400. data/app/models/concerns/blacklight/solr/document/more_like_this.rb +0 -6
  401. data/app/views/_user_util_links.html.erb +0 -26
  402. data/app/views/blacklight/nav/_saved_searches.html.erb +0 -1
  403. data/app/views/catalog/_index_default.html.erb +0 -12
  404. data/app/views/catalog/_show_default.html.erb +0 -10
  405. data/app/views/catalog/_thumbnail_default.html.erb +0 -5
  406. data/app/views/saved_searches/index.html.erb +0 -32
  407. data/app/views/shared/_ajax_modal.html.erb +0 -6
  408. data/lib/generators/blacklight/solr4_generator.rb +0 -31
  409. data/lib/generators/blacklight/templates/config/jetty.yml +0 -13
  410. data/solr/conf/schema.xml +0 -627
  411. data/solr/conf/solrconfig.xml +0 -411
  412. data/spec/controllers/blacklight/search_helper_spec.rb +0 -489
  413. data/spec/controllers/saved_searches_controller_spec.rb +0 -32
  414. data/spec/controllers/suggest_controller_spec.rb +0 -17
  415. data/spec/features/saved_searches_spec.rb +0 -47
  416. data/spec/helpers/deprecated_url_helper_behavior_spec.rb +0 -101
  417. data/spec/lib/blacklight/utils_spec.rb +0 -167
  418. data/spec/models/blacklight/solr/document/more_like_this_spec.rb +0 -18
  419. data/spec/presenters/document_presenter_spec.rb +0 -438
  420. data/spec/support/backport_test.rb +0 -14
@@ -1,205 +0,0 @@
1
- # frozen_string_literal: true
2
- module Blacklight::RenderPartialsHelper
3
- ##
4
- # Render the document index view
5
- #
6
- # @param [Array<SolrDocument>] documents list of documents to render
7
- # @param [Hash] locals to pass to the render call
8
- # @return [String]
9
- def render_document_index documents = nil, locals = {}
10
- documents ||= @document_list
11
- render_document_index_with_view(document_index_view_type, documents, locals)
12
- end
13
-
14
- ##
15
- # Render the document index for a grouped response
16
- def render_grouped_document_index
17
- render 'catalog/group_default'
18
- end
19
-
20
- ##
21
- # Return the list of partials for a given solr document
22
- # @param [SolrDocument] doc solr document to render partials for
23
- # @param [Array<String>] partials list of partials to render
24
- # @param [Hash] locals local variables to pass to the render call
25
- # @return [String]
26
- def render_document_partials(doc, partials = [], locals = {})
27
- safe_join(partials.map do |action_name|
28
- render_document_partial(doc, action_name, locals)
29
- end, "\n")
30
- end
31
-
32
- ##
33
- # Given a doc and a base name for a partial, this method will attempt to render
34
- # an appropriate partial based on the document format and view type.
35
- #
36
- # If a partial that matches the document format is not found,
37
- # render a default partial for the base name.
38
- #
39
- # @see #document_partial_path_templates
40
- #
41
- # @param [SolrDocument] doc
42
- # @param [String] base_name base name for the partial
43
- # @param [Hash] locals local variables to pass through to the partials
44
- def render_document_partial(doc, base_name, locals = {})
45
- format = document_partial_name(doc, base_name)
46
-
47
- view_type = document_index_view_type
48
- template = cached_view ['show', view_type, base_name, format].join('_') do
49
- find_document_show_template_with_view(view_type, base_name, format, locals)
50
- end
51
- if template
52
- template.render(self, locals.merge(document: doc))
53
- else
54
- ''
55
- end
56
- end
57
-
58
- ##
59
- # Render the document index for the given view type with the
60
- # list of documents.
61
- #
62
- # This method will interpolate the list of templates with
63
- # the current view, and gracefully handles missing templates.
64
- #
65
- # @see #document_index_path_templates
66
- #
67
- # @param [String] view type
68
- # @param [Array<SolrDocument>] documents list of documents to render
69
- # @param [Hash] locals to pass to the render call
70
- # @return [String]
71
- def render_document_index_with_view view, documents, locals = {}
72
- template = cached_view ['index', view].join('_') do
73
- find_document_index_template_with_view(view, locals)
74
- end
75
-
76
- if template
77
- template.render(self, locals.merge(documents: documents))
78
- else
79
- ''
80
- end
81
- end
82
-
83
- ##
84
- # A list of document partial templates to attempt to render
85
- #
86
- # @see #render_document_index_with_view
87
- # @return [Array<String>]
88
- def document_index_path_templates
89
- # first, the legacy template names for backwards compatbility
90
- # followed by the new, inheritable style
91
- # finally, a controller-specific path for non-catalog subclasses
92
- @document_index_path_templates ||= [
93
- "document_%{index_view_type}",
94
- "catalog/document_%{index_view_type}",
95
- "catalog/document_list"
96
- ]
97
- end
98
-
99
- protected
100
-
101
- ##
102
- # Return a partial name for rendering a document
103
- # this method can be overridden in order to transform the value
104
- # (e.g. 'PdfBook' => 'pdf_book')
105
- #
106
- # @param [SolrDocument] document
107
- # @param [String, Array] display_type a value suggestive of a partial
108
- # @return [String] the name of the partial to render
109
- # @example
110
- # type_field_to_partial_name(['a book-article'])
111
- # => 'a_book_article'
112
- if Rails.version >= '5.0.0'
113
- def type_field_to_partial_name(document, display_type)
114
- # using "_" as sep. to more closely follow the views file naming conventions
115
- # parameterize uses "-" as the default sep. which throws errors
116
- underscore = '_'.freeze
117
- Array(display_type).join(' '.freeze).tr('-'.freeze, underscore).parameterize(separator: underscore)
118
- end
119
- else
120
- def type_field_to_partial_name(document, display_type)
121
- # using "_" as sep. to more closely follow the views file naming conventions
122
- # parameterize uses "-" as the default sep. which throws errors
123
- underscore = '_'.freeze
124
- Array(display_type).join(' '.freeze).tr('-'.freeze, underscore).parameterize(underscore)
125
- end
126
- end
127
-
128
- ##
129
- # Return a normalized partial name for rendering a single document
130
- #
131
- # @param [SolrDocument] document
132
- # @param [Symbol] base_name base name for the partial
133
- # @return [String]
134
- def document_partial_name(document, base_name = nil)
135
- view_config = blacklight_config.view_config(:show)
136
-
137
- display_type = if base_name and view_config.key? :"#{base_name}_display_type_field"
138
- document[view_config[:"#{base_name}_display_type_field"]]
139
- end
140
-
141
- display_type ||= document[view_config.display_type_field]
142
-
143
- display_type ||= 'default'
144
-
145
- type_field_to_partial_name(document, display_type)
146
- end
147
-
148
- ##
149
- # A list of document partial templates to try to render for a document
150
- #
151
- # The partial names will be interpolated with the following variables:
152
- # - action_name: (e.g. index, show)
153
- # - index_view_type: (the current view type, e.g. list, gallery)
154
- # - format: the document's format (e.g. book)
155
- #
156
- # @see #render_document_partial
157
- def document_partial_path_templates
158
- # first, the legacy template names for backwards compatbility
159
- # followed by the new, inheritable style
160
- # finally, a controller-specific path for non-catalog subclasses
161
- @partial_path_templates ||= [
162
- "%{action_name}_%{index_view_type}_%{format}",
163
- "%{action_name}_%{index_view_type}_default",
164
- "%{action_name}_%{format}",
165
- "%{action_name}_default",
166
- "catalog/%{action_name}_%{format}",
167
- "catalog/_%{action_name}_partials/%{format}",
168
- "catalog/_%{action_name}_partials/default"
169
- ]
170
- end
171
-
172
- private
173
-
174
- def find_document_show_template_with_view view_type, base_name, format, locals
175
- document_partial_path_templates.each do |str|
176
- partial = str % { action_name: base_name, format: format, index_view_type: view_type }
177
- logger.debug "Looking for document partial #{partial}"
178
- template = lookup_context.find_all(partial, lookup_context.prefixes + [""], true, locals.keys + [:document], {}).first
179
- return template if template
180
- end
181
- nil
182
- end
183
-
184
- def find_document_index_template_with_view view, locals
185
- document_index_path_templates.each do |str|
186
- partial = str % { index_view_type: view }
187
- logger.debug "Looking for document index partial #{partial}"
188
- template = lookup_context.find_all(partial, lookup_context.prefixes + [""], true, locals.keys + [:documents], {}).first
189
- return template if template
190
- end
191
- nil
192
- end
193
-
194
- ##
195
- # @param key fetches or writes data to a cache, using the given key.
196
- # @yield the block to evaluate (and cache) if there is a cache miss
197
- def cached_view key
198
- @view_cache ||= {}
199
- if @view_cache.key?(key)
200
- @view_cache[key]
201
- else
202
- @view_cache[key] = yield
203
- end
204
- end
205
- end
@@ -1,4 +0,0 @@
1
- # frozen_string_literal: true
2
- module BlacklightConfigurationHelper
3
- include Blacklight::ConfigurationHelperBehavior
4
- end
@@ -1,4 +0,0 @@
1
- # frozen_string_literal: true
2
- module BlacklightUrlHelper
3
- include Blacklight::UrlHelperBehavior
4
- end
@@ -1,4 +0,0 @@
1
- # frozen_string_literal: true
2
- module ComponentHelper
3
- include Blacklight::ComponentHelperBehavior
4
- end
@@ -1,4 +0,0 @@
1
- # frozen_string_literal: true
2
- module FacetsHelper
3
- include Blacklight::FacetsHelperBehavior
4
- end
@@ -1,4 +0,0 @@
1
- # frozen_string_literal: true
2
- module HashAsHiddenFieldsHelper
3
- include Blacklight::HashAsHiddenFieldsHelperBehavior
4
- end
@@ -1,4 +0,0 @@
1
- # frozen_string_literal: true
2
- module LayoutHelper
3
- include Blacklight::LayoutHelperBehavior
4
- end
@@ -1,4 +0,0 @@
1
- # frozen_string_literal: true
2
- module RenderConstraintsHelper
3
- include Blacklight::RenderConstraintsHelperBehavior
4
- end
@@ -1,4 +0,0 @@
1
- # frozen_string_literal: true
2
- module SearchHistoryConstraintsHelper
3
- include Blacklight::SearchHistoryConstraintsHelperBehavior
4
- end
@@ -1,4 +0,0 @@
1
- # frozen_string_literal: true
2
- module SuggestHelper
3
- include Blacklight::SuggestHelperBehavior
4
- end
@@ -1,6 +0,0 @@
1
- # frozen_string_literal: true
2
- module Blacklight::Solr::Document::MoreLikeThis
3
- def more_like_this
4
- response.more_like(self).map { |doc| self.class.new(doc, response) }
5
- end
6
- end
@@ -1,26 +0,0 @@
1
- <div class="navbar-right">
2
- <ul class="nav navbar-nav">
3
- <%= render_nav_actions do |config, action|%>
4
- <li><%= action %></li>
5
- <% end %>
6
- </ul>
7
-
8
- <% if has_user_authentication_provider? %>
9
- <ul class="nav navbar-nav">
10
- <% if current_user %>
11
- <li>
12
- <%= link_to t('blacklight.header_links.logout'), destroy_user_session_path %>
13
- </li>
14
- <% unless current_user.to_s.blank? -%>
15
- <li>
16
- <%= link_to current_user, edit_user_registration_path %>
17
- </li>
18
- <% end %>
19
- <% else %>
20
- <li>
21
- <%= link_to t('blacklight.header_links.login'), new_user_session_path %>
22
- </li>
23
- <% end %>
24
- </ul>
25
- <% end %>
26
- </div>
@@ -1 +0,0 @@
1
- <%= link_to t('blacklight.header_links.saved_searches'), blacklight.saved_searches_path %>
@@ -1,12 +0,0 @@
1
- <% doc_presenter = index_presenter(document) %>
2
- <%# default partial to display solr document fields in catalog index view -%>
3
- <dl class="document-metadata dl-horizontal dl-invert">
4
-
5
- <% index_fields(document).each do |field_name, field| -%>
6
- <% if should_render_index_field? document, field %>
7
- <dt class="blacklight-<%= field_name.parameterize %>"><%= render_index_field_label document, field: field_name %></dt>
8
- <dd class="blacklight-<%= field_name.parameterize %>"><%= doc_presenter.field_value field %></dd>
9
- <% end -%>
10
- <% end -%>
11
-
12
- </dl>
@@ -1,10 +0,0 @@
1
- <% doc_presenter = show_presenter(document) %>
2
- <%# default partial to display solr document fields in catalog show view -%>
3
- <dl class="dl-horizontal dl-invert">
4
- <% document_show_fields(document).each do |field_name, field| -%>
5
- <% if should_render_show_field? document, field %>
6
- <dt class="blacklight-<%= field_name.parameterize %>"><%= render_document_show_field_label document, field: field_name %></dt>
7
- <dd class="blacklight-<%= field_name.parameterize %>"><%= doc_presenter.field_value field %></dd>
8
- <% end -%>
9
- <% end -%>
10
- </dl>
@@ -1,5 +0,0 @@
1
- <%- if has_thumbnail?(document) && tn = render_thumbnail_tag(document, {}, :counter => document_counter_with_offset(document_counter)) %>
2
- <div class="document-thumbnail">
3
- <%= tn %>
4
- </div>
5
- <%- end %>
@@ -1,32 +0,0 @@
1
- <% @page_title = t('blacklight.saved_searches.page_title', :application_name => application_name) %>
2
-
3
- <div id="content" class="col-md-9">
4
-
5
- <h2 class='page-heading'><%= t('blacklight.saved_searches.title') %></h2>
6
-
7
- <%- if current_or_guest_user.blank? -%>
8
-
9
- <h3 class='section-heading'><%= t('blacklight.saved_searches.need_login') %></h3>
10
-
11
- <%- elsif @searches.blank? -%>
12
-
13
- <h3 class='section-heading'><%= t('blacklight.saved_searches.no_searches') %></h3>
14
-
15
- <%- else -%>
16
- <p>
17
- <%= link_to t('blacklight.saved_searches.clear.action_title'), blacklight.clear_saved_searches_path, :method => :delete, :data => { :confirm => t('blacklight.saved_searches.clear.action_confirm') } %>
18
- </p>
19
-
20
- <h3 class='section-heading'><%= t('blacklight.saved_searches.list_title') %></h3>
21
- <table class="table table-striped">
22
- <%- @searches.each do |search| -%>
23
- <tr>
24
- <td><%= link_to_previous_search(search.query_params) %></td>
25
- <td><%= button_to t('blacklight.saved_searches.delete'), blacklight.forget_search_path(search.id), :class => 'btn btn-danger' %></td>
26
- </tr>
27
- <%- end -%>
28
- </table>
29
-
30
- <%- end -%>
31
-
32
- </div>
@@ -1,6 +0,0 @@
1
- <div id="ajax-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="modal menu" aria-hidden="true">
2
- <div class="modal-dialog">
3
- <div class="modal-content">
4
- </div>
5
- </div>
6
- </div>
@@ -1,31 +0,0 @@
1
- # frozen_string_literal: true
2
- require 'rails/generators'
3
-
4
- module Blacklight
5
- class Solr4Generator < Rails::Generators::Base
6
- source_root File.expand_path('../templates', __FILE__)
7
-
8
- class_option :jettywrapper, type: :boolean, default: false, desc: "Use jettywrapper to download and control Jetty"
9
-
10
- desc <<-EOS
11
- This generator makes the following changes to your application:
12
- 1. Installs jettywrapper into your application
13
- 2. Adds rsolr to your Gemfile
14
- EOS
15
-
16
- def install_jettywrapper
17
- return unless options[:jettywrapper]
18
-
19
- gem "jettywrapper".dup, ">= 2.0"
20
- copy_file "config/jetty.yml", "config/jetty.yml"
21
-
22
- append_to_file "Rakefile",
23
- "\nZIP_URL = \"https://github.com/projectblacklight/blacklight-jetty/archive/v4.10.4.zip\"\n" \
24
- "require 'jettywrapper'\n"
25
- end
26
-
27
- def add_rsolr_gem
28
- gem "rsolr".dup, '>= 1.0', '< 3'
29
- end
30
- end
31
- end
@@ -1,13 +0,0 @@
1
- development:
2
- startup_wait: 15
3
- jetty_port: 8983
4
- java_version: ">= 1.7"
5
- test:
6
- startup_wait: 60
7
- jetty_port: <%= ENV['TEST_JETTY_PORT'] || 8983 %>
8
- <%= ENV['TEST_JETTY_PATH'] ? "jetty_home: " + ENV['TEST_JETTY_PATH'] : '' %>
9
- java_version: ">= 1.7"
10
- production:
11
- startup_wait: 15
12
- jetty_port: 8983
13
- java_version: ">= 1.7"
data/solr/conf/schema.xml DELETED
@@ -1,627 +0,0 @@
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 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
46
- -->
47
-
48
- <schema name="Blacklight Demo Index" version="1.5">
49
- <!-- attribute "name" is the name of this schema and is only used for display purposes.
50
- Applications should change this to reflect the nature of the search collection.
51
- version="1.4" is Solr's version number for the schema syntax and semantics. It should
52
- not normally be changed by applications.
53
- 1.0: multiValued attribute did not exist, all fields are multiValued by nature
54
- 1.1: multiValued attribute introduced, false by default
55
- 1.2: omitTermFreqAndPositions attribute introduced, true by default except for text fields.
56
- 1.3: removed optional field compress feature
57
- 1.4: default auto-phrase (QueryParser feature) to off
58
- -->
59
-
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
-
69
- <!-- The StrField type is not analyzed, but indexed/stored verbatim. -->
70
- <fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/>
71
-
72
- <!-- boolean type: "true" or "false" -->
73
- <fieldType name="boolean" class="solr.BoolField" sortMissingLast="true" omitNorms="true"/>
74
- <!--Binary data type. The data should be sent/retrieved in as Base64 encoded Strings -->
75
- <fieldtype name="binary" class="solr.BinaryField"/>
76
-
77
- <!-- The optional sortMissingLast and sortMissingFirst attributes are
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.
82
- - If sortMissingLast="true", then a sort on this field will cause documents
83
- without the field to come after documents with the field,
84
- regardless of the requested sort order (asc or desc).
85
- - If sortMissingFirst="true", then a sort on this field will cause documents
86
- without the field to come before documents with the field,
87
- regardless of the requested sort order.
88
- - If sortMissingLast="false" and sortMissingFirst="false" (the default),
89
- then default lucene sorting will be used which places docs without the
90
- field first in an ascending sort and last in a descending sort.
91
- -->
92
-
93
- <!--
94
- Default numeric field types. For faster range queries, consider the tint/tfloat/tlong/tdouble types.
95
- -->
96
- <fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
97
- <fieldType name="float" class="solr.TrieFloatField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
98
- <fieldType name="long" class="solr.TrieLongField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
99
- <fieldType name="double" class="solr.TrieDoubleField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
100
-
101
- <!--
102
- Numeric field types that index each value at various levels of precision
103
- to accelerate range queries when the number of values between the range
104
- endpoints is large. See the javadoc for NumericRangeQuery for internal
105
- implementation details.
106
-
107
- Smaller precisionStep values (specified in bits) will lead to more tokens
108
- indexed per value, slightly larger index size, and faster range queries.
109
- A precisionStep of 0 disables indexing at different precision levels.
110
- -->
111
- <fieldType name="tint" class="solr.TrieIntField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
112
- <fieldType name="tfloat" class="solr.TrieFloatField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
113
- <fieldType name="tlong" class="solr.TrieLongField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
114
- <fieldType name="tdouble" class="solr.TrieDoubleField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
115
-
116
- <!-- The format for this date field is of the form 1995-12-31T23:59:59Z, and
117
- is a more restricted form of the canonical representation of dateTime
118
- http://www.w3.org/TR/xmlschema-2/#dateTime
119
- The trailing "Z" designates UTC time and is mandatory.
120
- Optional fractional seconds are allowed: 1995-12-31T23:59:59.999Z
121
- All other components are mandatory.
122
-
123
- Expressions can also be used to denote calculations that should be
124
- performed relative to "NOW" to determine the value, ie...
125
-
126
- NOW/HOUR
127
- ... Round to the start of the current hour
128
- NOW-1DAY
129
- ... Exactly 1 day prior to now
130
- NOW/DAY+6MONTHS+3DAYS
131
- ... 6 months and 3 days in the future from the start of
132
- the current day
133
-
134
- Consult the DateField javadocs for more information.
135
-
136
- Note: For faster range queries, consider the tdate type
137
- -->
138
- <fieldType name="date" class="solr.TrieDateField" omitNorms="true" precisionStep="0" positionIncrementGap="0"/>
139
-
140
- <!-- A Trie based date field for faster date range queries and date faceting. -->
141
- <fieldType name="tdate" class="solr.TrieDateField" omitNorms="true" precisionStep="6" positionIncrementGap="0"/>
142
-
143
- <!-- The "RandomSortField" is not used to store or search any
144
- data. You can declare fields of this type it in your schema
145
- to generate pseudo-random orderings of your docs for sorting
146
- purposes. The ordering is generated based on the field name
147
- and the version of the index, As long as the index version
148
- remains unchanged, and the same field name is reused,
149
- the ordering of the docs will be consistent.
150
- If you want different psuedo-random orderings of documents,
151
- for the same version of the index, use a dynamicField and
152
- change the name
153
- -->
154
- <fieldType name="random" class="solr.RandomSortField" indexed="true" />
155
-
156
- <!-- solr.TextField allows the specification of custom text analyzers
157
- specified as a tokenizer and a list of token filters. Different
158
- analyzers may be specified for indexing and querying.
159
-
160
- The optional positionIncrementGap puts space between multiple fields of
161
- this type on the same document, with the purpose of preventing false phrase
162
- matching across fields.
163
-
164
- For more info on customizing your analyzer chain, please see
165
- http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters
166
- -->
167
- <fieldType name="text" class="solr.TextField" positionIncrementGap="100">
168
- <analyzer>
169
- <tokenizer class="solr.StandardTokenizerFactory"/>
170
- <filter class="solr.ICUFoldingFilterFactory" />
171
- <filter class="solr.SnowballPorterFilterFactory" language="English" />
172
- </analyzer>
173
- </fieldType>
174
-
175
- <!-- One can also specify an existing Analyzer class that has a
176
- default constructor via the class attribute on the analyzer element
177
- <fieldType name="text_greek" class="solr.TextField">
178
- <analyzer class="org.apache.lucene.analysis.el.GreekAnalyzer"/>
179
- </fieldType>
180
- -->
181
-
182
- <!-- A text field that only splits on whitespace for exact matching of words -->
183
- <fieldType name="text_ws" class="solr.TextField" positionIncrementGap="100">
184
- <analyzer>
185
- <tokenizer class="solr.WhitespaceTokenizerFactory"/>
186
- </analyzer>
187
- </fieldType>
188
-
189
- <!-- A general text field that has reasonable, generic
190
- cross-language defaults: it tokenizes with StandardTokenizer,
191
- removes stop words from case-insensitive "stopwords.txt"
192
- (empty by default), and down cases. At query time only, it
193
- also applies synonyms. -->
194
- <fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
195
- <analyzer type="index">
196
- <tokenizer class="solr.StandardTokenizerFactory"/>
197
- <!-- in this example, we will only use synonyms at query time
198
- <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
199
- -->
200
- <filter class="solr.LowerCaseFilterFactory"/>
201
- </analyzer>
202
- <analyzer type="query">
203
- <tokenizer class="solr.StandardTokenizerFactory"/>
204
- <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
205
- <filter class="solr.LowerCaseFilterFactory"/>
206
- </analyzer>
207
- </fieldType>
208
-
209
- <!-- A text field with defaults appropriate for English: it
210
- tokenizes with StandardTokenizer, removes English stop words
211
- (stopwords_en.txt), down cases, protects words from protwords.txt, and
212
- finally applies Porter's stemming. The query time analyzer
213
- also applies synonyms from synonyms.txt. -->
214
- <fieldType name="text_en" class="solr.TextField" positionIncrementGap="100">
215
- <analyzer type="index">
216
- <tokenizer class="solr.StandardTokenizerFactory"/>
217
- <!-- in this example, we will only use synonyms at query time
218
- <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
219
- -->
220
- <filter class="solr.LowerCaseFilterFactory"/>
221
- <filter class="solr.EnglishPossessiveFilterFactory"/>
222
- <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
223
- <!-- Optionally you may want to use this less aggressive stemmer instead of PorterStemFilterFactory:
224
- <filter class="solr.EnglishMinimalStemFilterFactory"/>
225
- -->
226
- <filter class="solr.PorterStemFilterFactory"/>
227
- </analyzer>
228
- <analyzer type="query">
229
- <tokenizer class="solr.StandardTokenizerFactory"/>
230
- <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
231
- <filter class="solr.LowerCaseFilterFactory"/>
232
- <filter class="solr.EnglishPossessiveFilterFactory"/>
233
- <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
234
- <!-- Optionally you may want to use this less aggressive stemmer instead of PorterStemFilterFactory:
235
- <filter class="solr.EnglishMinimalStemFilterFactory"/>
236
- -->
237
- <filter class="solr.PorterStemFilterFactory"/>
238
- </analyzer>
239
- </fieldType>
240
-
241
- <!-- A text field with defaults appropriate for English, plus
242
- aggressive word-splitting and autophrase features enabled.
243
- This field is just like text_en, except it adds
244
- WordDelimiterFilter to enable splitting and matching of
245
- words on case-change, alpha numeric boundaries, and
246
- non-alphanumeric chars. This means certain compound word
247
- cases will work, for example query "wi fi" will match
248
- document "WiFi" or "wi-fi". However, other cases will still
249
- not match, for example if the query is "wifi" and the
250
- document is "wi fi" or if the query is "wi-fi" and the
251
- document is "wifi".
252
- -->
253
- <fieldType name="text_en_splitting" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true">
254
- <analyzer type="index">
255
- <tokenizer class="solr.WhitespaceTokenizerFactory"/>
256
- <!-- in this example, we will only use synonyms at query time
257
- <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
258
- -->
259
- <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
260
- <filter class="solr.LowerCaseFilterFactory"/>
261
- <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
262
- <filter class="solr.PorterStemFilterFactory"/>
263
- </analyzer>
264
- <analyzer type="query">
265
- <tokenizer class="solr.WhitespaceTokenizerFactory"/>
266
- <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
267
- <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
268
- <filter class="solr.LowerCaseFilterFactory"/>
269
- <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
270
- <filter class="solr.PorterStemFilterFactory"/>
271
- </analyzer>
272
- </fieldType>
273
-
274
- <!-- Less flexible matching, but less false matches. Probably not ideal for product names,
275
- but may be good for SKUs. Can insert dashes in the wrong place and still match. -->
276
- <fieldType name="text_en_splitting_tight" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true">
277
- <analyzer>
278
- <tokenizer class="solr.WhitespaceTokenizerFactory"/>
279
- <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="false"/>
280
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords_en.txt"/>
281
- <filter class="solr.WordDelimiterFilterFactory" generateWordParts="0" generateNumberParts="0" catenateWords="1" catenateNumbers="1" catenateAll="0"/>
282
- <filter class="solr.LowerCaseFilterFactory"/>
283
- <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
284
- <filter class="solr.EnglishMinimalStemFilterFactory"/>
285
- <!-- this filter can remove any duplicate tokens that appear at the same position - sometimes
286
- possible with WordDelimiterFilter in conjuncton with stemming. -->
287
- <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
288
- </analyzer>
289
- </fieldType>
290
-
291
- <!-- Just like text_general except it reverses the characters of
292
- each token, to enable more efficient leading wildcard queries. -->
293
- <fieldType name="text_general_rev" class="solr.TextField" positionIncrementGap="100">
294
- <analyzer type="index">
295
- <tokenizer class="solr.StandardTokenizerFactory"/>
296
- <filter class="solr.LowerCaseFilterFactory"/>
297
- <filter class="solr.ReversedWildcardFilterFactory" withOriginal="true"
298
- maxPosAsterisk="3" maxPosQuestion="2" maxFractionAsterisk="0.33"/>
299
- </analyzer>
300
- <analyzer type="query">
301
- <tokenizer class="solr.StandardTokenizerFactory"/>
302
- <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
303
- <filter class="solr.LowerCaseFilterFactory"/>
304
- </analyzer>
305
- </fieldType>
306
-
307
- <fieldType name="textSpell" class="solr.TextField" positionIncrementGap="100" >
308
- <analyzer>
309
- <tokenizer class="solr.StandardTokenizerFactory"/>
310
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
311
- <filter class="solr.LowerCaseFilterFactory"/>
312
- <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
313
- </analyzer>
314
- </fieldType>
315
-
316
- <fieldType class="solr.TextField" name="textSuggest" positionIncrementGap="100">
317
- <analyzer>
318
- <tokenizer class="solr.KeywordTokenizerFactory"/>
319
- <filter class="solr.LowerCaseFilterFactory"/>
320
- <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
321
- </analyzer>
322
- </fieldType>
323
-
324
- <!-- charFilter + WhitespaceTokenizer -->
325
- <!--
326
- <fieldType name="text_char_norm" class="solr.TextField" positionIncrementGap="100" >
327
- <analyzer>
328
- <charFilter class="solr.MappingCharFilterFactory" mapping="mapping-ISOLatin1Accent.txt"/>
329
- <tokenizer class="solr.WhitespaceTokenizerFactory"/>
330
- </analyzer>
331
- </fieldType>
332
- -->
333
-
334
- <!-- This is an example of using the KeywordTokenizer along
335
- With various TokenFilterFactories to produce a sortable field
336
- that does not include some properties of the source text
337
- -->
338
- <fieldType name="alphaOnlySort" class="solr.TextField" sortMissingLast="true" omitNorms="true">
339
- <analyzer>
340
- <!-- KeywordTokenizer does no actual tokenizing, so the entire
341
- input string is preserved as a single token
342
- -->
343
- <tokenizer class="solr.KeywordTokenizerFactory"/>
344
- <!-- The LowerCase TokenFilter does what you expect, which can be
345
- when you want your sorting to be case insensitive
346
- -->
347
- <filter class="solr.LowerCaseFilterFactory" />
348
- <!-- The TrimFilter removes any leading or trailing whitespace -->
349
- <filter class="solr.TrimFilterFactory" />
350
- <!-- The PatternReplaceFilter gives you the flexibility to use
351
- Java Regular expression to replace any sequence of characters
352
- matching a pattern with an arbitrary replacement string,
353
- which may include back references to portions of the original
354
- string matched by the pattern.
355
-
356
- See the Java Regular Expression documentation for more
357
- information on pattern and replacement string syntax.
358
-
359
- http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/package-summary.html
360
- -->
361
- <filter class="solr.PatternReplaceFilterFactory"
362
- pattern="([^a-z])" replacement="" replace="all"
363
- />
364
- </analyzer>
365
- </fieldType>
366
-
367
- <fieldtype name="phonetic" stored="false" indexed="true" class="solr.TextField" >
368
- <analyzer>
369
- <tokenizer class="solr.StandardTokenizerFactory"/>
370
- <filter class="solr.DoubleMetaphoneFilterFactory" inject="false"/>
371
- </analyzer>
372
- </fieldtype>
373
-
374
- <fieldtype name="payloads" stored="false" indexed="true" class="solr.TextField" >
375
- <analyzer>
376
- <tokenizer class="solr.WhitespaceTokenizerFactory"/>
377
- <!--
378
- The DelimitedPayloadTokenFilter can put payloads on tokens... for example,
379
- a token of "foo|1.4" would be indexed as "foo" with a payload of 1.4f
380
- Attributes of the DelimitedPayloadTokenFilterFactory :
381
- "delimiter" - a one character delimiter. Default is | (pipe)
382
- "encoder" - how to encode the following value into a playload
383
- float -> org.apache.lucene.analysis.payloads.FloatEncoder,
384
- integer -> o.a.l.a.p.IntegerEncoder
385
- identity -> o.a.l.a.p.IdentityEncoder
386
- Fully Qualified class name implementing PayloadEncoder, Encoder must have a no arg constructor.
387
- -->
388
- <filter class="solr.DelimitedPayloadTokenFilterFactory" encoder="float"/>
389
- </analyzer>
390
- </fieldtype>
391
-
392
- <!-- lowercases the entire field value, keeping it as a single token. -->
393
- <fieldType name="lowercase" class="solr.TextField" positionIncrementGap="100">
394
- <analyzer>
395
- <tokenizer class="solr.KeywordTokenizerFactory"/>
396
- <filter class="solr.LowerCaseFilterFactory" />
397
- </analyzer>
398
- </fieldType>
399
-
400
- <fieldType name="text_path" class="solr.TextField" positionIncrementGap="100">
401
- <analyzer>
402
- <tokenizer class="solr.PathHierarchyTokenizerFactory"/>
403
- </analyzer>
404
- </fieldType>
405
-
406
- <!-- since fields of this type are by default not stored or indexed,
407
- any data added to them will be ignored outright. -->
408
- <fieldtype name="ignored" stored="false" indexed="false" multiValued="true" class="solr.StrField" />
409
-
410
- <!-- This point type indexes the coordinates as separate fields (subFields)
411
- If subFieldType is defined, it references a type, and a dynamic field
412
- definition is created matching *___<typename>. Alternately, if
413
- subFieldSuffix is defined, that is used to create the subFields.
414
- Example: if subFieldType="double", then the coordinates would be
415
- indexed in fields myloc_0___double,myloc_1___double.
416
- Example: if subFieldSuffix="_d" then the coordinates would be indexed
417
- in fields myloc_0_d,myloc_1_d
418
- The subFields are an implementation detail of the fieldType, and end
419
- users normally should not need to know about them.
420
- -->
421
- <fieldType name="point" class="solr.PointType" dimension="2" subFieldSuffix="_d"/>
422
-
423
- <!-- A specialized field for geospatial search. If indexed, this fieldType must not be multivalued. -->
424
- <fieldType name="location" class="solr.LatLonType" subFieldSuffix="_coordinate"/>
425
-
426
- <!--
427
- A Geohash is a compact representation of a latitude longitude pair in a single field.
428
- See http://wiki.apache.org/solr/SpatialSearch
429
- -->
430
- <fieldtype name="geohash" class="solr.GeoHashField"/>
431
- </types>
432
-
433
-
434
- <fields>
435
- <!-- Valid attributes for fields:
436
- name: mandatory - the name for the field
437
- type: mandatory - the name of a previously defined type from the
438
- <types> section
439
- indexed: true if this field should be indexed (searchable or sortable)
440
- stored: true if this field should be retrievable
441
- multiValued: true if this field may contain multiple values per document
442
- omitNorms: (expert) set to true to omit the norms associated with
443
- this field (this disables length normalization and index-time
444
- boosting for the field, and saves some memory). Only full-text
445
- fields or fields that need an index-time boost need norms.
446
- termVectors: [false] set to true to store the term vector for a
447
- given field.
448
- When using MoreLikeThis, fields used for similarity should be
449
- stored for best performance.
450
- termPositions: Store position information with the term vector.
451
- This will increase storage costs.
452
- termOffsets: Store offset information with the term vector. This
453
- will increase storage costs.
454
- default: a value that should be used if no value is specified
455
- when adding a document.
456
- -->
457
-
458
- <!-- NOTE: this is not a full list of fields in the index; dynamic fields are also used -->
459
- <field name="id" type="string" indexed="true" stored="true" required="true" />
460
- <field name="_version_" type="long" indexed="true" stored="true" multiValued="false" />
461
- <field name="timestamp" type="date" indexed="true" stored="true" default="NOW" multiValued="false"/>
462
- <!-- default, catch all search field -->
463
- <field name="text" type="text" indexed="true" stored="false" multiValued="true"/>
464
-
465
- <!-- these display fields are NOT multi-valued -->
466
- <field name="marc_display" type="string" indexed="false" stored="true" multiValued="false"/>
467
- <field name="title_display" type="string" indexed="false" stored="true" multiValued="false"/>
468
- <field name="title_vern_display" type="string" indexed="false" stored="true" multiValued="false"/>
469
- <field name="subtitle_display" type="string" indexed="false" stored="true" multiValued="false"/>
470
- <field name="subtitle_vern_display" type="string" indexed="false" stored="true" multiValued="false"/>
471
- <field name="author_display" type="string" indexed="false" stored="true" multiValued="false"/>
472
- <field name="author_vern_display" type="string" indexed="false" stored="true" multiValued="false"/>
473
-
474
- <!-- these fields are also used for display, so they must be stored -->
475
- <field name="isbn_t" type="text" indexed="true" stored="true" multiValued="true"/>
476
- <field name="language_facet" type="string" indexed="true" stored="true" multiValued="true" />
477
- <field name="subject_topic_facet" type="string" indexed="true" stored="true" multiValued="true" />
478
- <field name="subject_era_facet" type="string" indexed="true" stored="true" multiValued="true" />
479
- <field name="subject_geo_facet" type="string" indexed="true" stored="true" multiValued="true" />
480
- <!-- pub_date is used for facet and display so it must be indexed and stored -->
481
- <field name="pub_date" type="string" indexed="true" stored="true" multiValued="true"/>
482
- <!-- pub_date sort uses new trie-based int fields, which are recommended for any int and are displayable, sortable, and range-quer
483
- we use 'tint' for faster range-queries. -->
484
- <field name="pub_date_sort" type="tint" indexed="true" stored="true" multiValued="false"/>
485
-
486
- <!-- format is used for facet, display, and choosing which partial to use for the show view, so it must be stored and indexed -->
487
- <field name="format" type="string" indexed="true" stored="true"/>
488
-
489
-
490
-
491
- <!-- Dynamic field definitions. If a field name is not found, dynamicFields
492
- will be used if the name matches any of the patterns.
493
- RESTRICTION: the glob-like pattern in the name attribute must have
494
- a "*" only at the start or the end.
495
- EXAMPLE: name="*_i" will match any field ending in _i (like myid_i, z_i)
496
- Longer patterns will be matched first. if equal size patterns
497
- both match, the first appearing in the schema will be used. -->
498
- <dynamicField name="*_i" type="int" indexed="true" stored="true"/>
499
- <dynamicField name="*_s" type="string" indexed="true" stored="true"/>
500
- <dynamicField name="*_l" type="long" indexed="true" stored="true"/>
501
- <dynamicField name="*_t" type="text" indexed="true" stored="true" multiValued="true"/>
502
- <dynamicField name="*_txt" type="text_general" indexed="true" stored="true" multiValued="true"/>
503
- <dynamicField name="*_b" type="boolean" indexed="true" stored="true"/>
504
- <dynamicField name="*_f" type="float" indexed="true" stored="true"/>
505
- <dynamicField name="*_d" type="double" indexed="true" stored="true"/>
506
-
507
- <!-- Type used to index the lat and lon components for the "location" FieldType -->
508
- <dynamicField name="*_coordinate" type="tdouble" indexed="true" stored="false"/>
509
-
510
- <dynamicField name="*_dt" type="date" indexed="true" stored="true"/>
511
- <dynamicField name="*_p" type="location" indexed="true" stored="true"/>
512
-
513
- <!-- some trie-coded dynamic fields for faster range queries -->
514
- <dynamicField name="*_ti" type="tint" indexed="true" stored="true"/>
515
- <dynamicField name="*_tl" type="tlong" indexed="true" stored="true"/>
516
- <dynamicField name="*_tf" type="tfloat" indexed="true" stored="true"/>
517
- <dynamicField name="*_td" type="tdouble" indexed="true" stored="true"/>
518
- <dynamicField name="*_tdt" type="tdate" indexed="true" stored="true"/>
519
-
520
- <dynamicField name="ignored_*" type="ignored" multiValued="true"/>
521
- <dynamicField name="attr_*" type="text_general" indexed="true" stored="true" multiValued="true"/>
522
-
523
- <dynamicField name="random_*" type="random" />
524
-
525
- <dynamicField name="*_display" type="string" indexed="false" stored="true" multiValued="true" />
526
- <dynamicField name="*_facet" type="string" indexed="true" stored="false" multiValued="true" />
527
- <dynamicField name="*_sort" type="alphaOnlySort" indexed="true" stored="false" multiValued="false" />
528
- <dynamicField name="*_unstem_search" type="text_general" indexed="true" stored="false" multiValued="true" />
529
- <dynamicField name="*spell" type="textSpell" indexed="true" stored="false" multiValued="true" />
530
- <dynamicField name="*suggest" type="textSuggest" indexed="true" stored="false" multiValued="true" />
531
-
532
- <!-- uncomment the following to ignore any fields that don't already match an existing
533
- field name or dynamic field, rather than reporting them as an error.
534
- alternately, change the type="ignored" to some other type e.g. "text" if you want
535
- unknown fields indexed and/or stored by default -->
536
- <!--dynamicField name="*" type="ignored" multiValued="true" /-->
537
-
538
- </fields>
539
-
540
- <!-- Field to use to determine and enforce document uniqueness.
541
- Unless this field is marked with required="false", it will be a required field
542
- -->
543
- <uniqueKey>id</uniqueKey>
544
-
545
- <!-- copyField commands copy one field to another at the time a document
546
- is added to the index. It's used either to index the same field differently,
547
- or to add multiple fields to the same field for easier/faster searching. -->
548
- <!-- Copy Fields -->
549
-
550
- <!-- unstemmed fields -->
551
- <copyField source="title_t" dest="title_unstem_search"/>
552
- <copyField source="subtitle_t" dest="subtitle_unstem_search"/>
553
- <copyField source="title_addl_t" dest="title_addl_unstem_search"/>
554
- <copyField source="title_added_entry_t" dest="title_added_entry_unstem_search"/>
555
- <copyField source="title_series_t" dest="title_series_unstem_search"/>
556
- <copyField source="author_t" dest="author_unstem_search"/>
557
- <copyField source="author_addl_t" dest="author_addl_unstem_search"/>
558
- <copyField source="subject_t" dest="subject_unstem_search"/>
559
- <copyField source="subject_addl_t" dest="subject_addl_unstem_search"/>
560
- <copyField source="subject_topic_facet" dest="subject_topic_unstem_search"/>
561
-
562
- <!-- sort fields -->
563
- <copyField source="pub_date" dest="pub_date_sort"/>
564
-
565
-
566
- <!-- spellcheck fields -->
567
- <!-- default spell check; should match fields for default request handler -->
568
- <!-- it won't work with a copy of a copy field -->
569
- <copyField source="*_t" dest="spell"/>
570
- <copyField source="*_facet" dest="spell"/>
571
- <!-- title spell check; should match fields for title request handler -->
572
- <copyField source="title_t" dest="title_spell"/>
573
- <copyField source="subtitle_t" dest="title_spell"/>
574
- <copyField source="addl_titles_t" dest="title_spell"/>
575
- <copyField source="title_added_entry_t" dest="title_spell"/>
576
- <copyField source="title_series_t" dest="title_spell"/>
577
- <!-- author spell check; should match fields for author request handler -->
578
- <copyField source="author_t" dest="author_spell"/>
579
- <copyField source="author_addl_t" dest="author_spell"/>
580
- <!-- subject spell check; should match fields for subject request handler -->
581
- <copyField source="subject_topic_facet" dest="subject_spell"/>
582
- <copyField source="subject_t" dest="subject_spell"/>
583
- <copyField source="subject_addl_t" dest="subject_spell"/>
584
-
585
- <!-- OpenSearch query field should match request handler search fields -->
586
- <copyField source="title_t" dest="opensearch_display"/>
587
- <copyField source="subtitle_t" dest="opensearch_display"/>
588
- <copyField source="addl_titles_t" dest="opensearch_display"/>
589
- <copyField source="title_added_entry_t" dest="opensearch_display"/>
590
- <copyField source="title_series_t" dest="opensearch_display"/>
591
- <copyField source="author_t" dest="opensearch_display"/>
592
- <copyField source="author_addl_t" dest="opensearch_display"/>
593
- <copyField source="subject_topic_facet" dest="opensearch_display"/>
594
- <copyField source="subject_t" dest="opensearch_display"/>
595
- <copyField source="subject_addl_t" dest="opensearch_display"/>
596
-
597
- <!-- for suggestions -->
598
- <copyField source="*_t" dest="suggest"/>
599
- <copyField source="*_facet" dest="suggest"/>
600
-
601
- <!-- Above, multiple source fields are copied to the [text] field.
602
- Another way to map multiple source fields to the same
603
- destination field is to use the dynamic field syntax.
604
- copyField also supports a maxChars to copy setting. -->
605
-
606
- <!-- <copyField source="*_t" dest="text" maxChars="3000"/> -->
607
-
608
- <!-- copy name to alphaNameSort, a field designed for sorting by name -->
609
- <!-- <copyField source="name" dest="alphaNameSort"/> -->
610
-
611
-
612
- <!-- Similarity is the scoring routine for each document vs. a query.
613
- A custom similarity may be specified here, but the default is fine
614
- for most applications. -->
615
- <!-- <similarity class="org.apache.lucene.search.DefaultSimilarity"/> -->
616
- <!-- ... OR ...
617
- Specify a SimilarityFactory class name implementation
618
- allowing parameters to be used.
619
- -->
620
- <!--
621
- <similarity class="com.example.solr.CustomSimilarityFactory">
622
- <str name="paramkey">param value</str>
623
- </similarity>
624
- -->
625
-
626
-
627
- </schema>