blacklight-spotlight 3.3.0 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/spotlight/pages_controller.rb +1 -1
  3. data/app/helpers/spotlight/pages_helper.rb +12 -0
  4. data/app/helpers/spotlight/title_helper.rb +0 -2
  5. data/app/models/sir_trevor_rails/block.rb +85 -0
  6. data/app/models/sir_trevor_rails/blocks/displayable.rb +1 -1
  7. data/app/models/spotlight/page_content/sir_trevor.rb +13 -4
  8. data/app/models/translation.rb +18 -0
  9. data/app/views/shared/_site_sidebar.html.erb +1 -1
  10. data/app/views/spotlight/sir_trevor/blocks/_video_block.html.erb +5 -0
  11. data/config/i18n-tasks.yml +1 -0
  12. data/config/locales/spotlight.de.yml +40 -0
  13. data/lib/generators/spotlight/install_generator.rb +40 -2
  14. data/lib/generators/spotlight/templates/config/initializers/translation.rb +5 -5
  15. data/lib/generators/spotlight/templates/solr/config/schema.xml +32 -50
  16. data/lib/generators/spotlight/templates/solr/config/solrconfig.xml +14 -12
  17. data/lib/spotlight/engine.rb +1 -1
  18. data/lib/spotlight/version.rb +1 -1
  19. data/lib/tasks/spotlight_tasks.rake +20 -0
  20. data/spec/controllers/spotlight/about_pages_controller_spec.rb +1 -3
  21. data/spec/controllers/spotlight/catalog_controller_spec.rb +4 -4
  22. data/spec/controllers/spotlight/contact_forms_controller_spec.rb +2 -2
  23. data/spec/controllers/spotlight/contacts_controller_spec.rb +2 -2
  24. data/spec/controllers/spotlight/exhibits_controller_spec.rb +1 -1
  25. data/spec/controllers/spotlight/feature_pages_controller_spec.rb +2 -2
  26. data/spec/controllers/spotlight/featured_images_controller_spec.rb +4 -4
  27. data/spec/controllers/spotlight/groups_controller_spec.rb +1 -1
  28. data/spec/controllers/spotlight/searches_controller_spec.rb +3 -3
  29. data/spec/controllers/spotlight/solr_controller_spec.rb +1 -1
  30. data/spec/controllers/spotlight/tags_controller_spec.rb +1 -1
  31. data/spec/examples.txt +1506 -1506
  32. data/spec/features/autocomplete_typeahead_spec.rb +3 -2
  33. data/spec/features/exhibit_themes_spec.rb +3 -1
  34. data/spec/i18n_spec.rb +2 -3
  35. data/spec/lib/migration/iiif_spec.rb +2 -2
  36. data/spec/models/sir_trevor_rails/block_spec.rb +72 -0
  37. data/spec/models/solr_document_spec.rb +1 -1
  38. data/spec/models/spotlight/browse_category_search_builder_spec.rb +3 -1
  39. data/spec/models/spotlight/page_spec.rb +0 -10
  40. data/spec/models/translation_spec.rb +12 -0
  41. data/spec/services/spotlight/etl/pipeline_spec.rb +1 -1
  42. data/spec/spec_helper.rb +1 -2
  43. data/spec/support/views/test_view_helpers.rb +1 -0
  44. data/spec/test_app_templates/lib/generators/test_app_generator.rb +3 -1
  45. metadata +98 -11
  46. data/lib/generators/spotlight/templates/config/initializers/sir_trevor_rails.rb +0 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c6d38a0f303034a89f2a514617e5bc17b31ad2bb60a2dd865245a1822d5ef27c
4
- data.tar.gz: 3a1e9f34a1f5bb1486843486dfc9bbb991b0c8504ae69898dbd852828fbb82f9
3
+ metadata.gz: fc89332ff348ea70e49058e10f7ae4ffe6513218603cb2b13741eefdc15c8f24
4
+ data.tar.gz: 76ff697064cedf09069292730e9bc3d7b1beac5a8e80e0ededdebbfc8f0008c5
5
5
  SHA512:
6
- metadata.gz: a9e96166b8445ac6333e6a5fb2647b1688b2007dcdc5907fb81099c5476f6dc49f053a060dbea12c531fb91934ef5f2c3aa6051ae408c1f654155fc6cd7e9816
7
- data.tar.gz: b72e0ccf54ad7969d11167df4aa8139533d4afd0acab8bfe05cd26f54170ca8b52bfe92575224e216dd1af32c537a0a2c2785f2b691567a0c7b176dc2b73e3ba
6
+ metadata.gz: 23cb9a0b04c40a53e75a91a25a7d1ce88a54b80fd5200fdee257081ed524bea31f77264d7a1a7f17ec82f5ede0dacf08c05707ddb122af99a0a071faa06824cf
7
+ data.tar.gz: 87dac4804ad58c1c2b08bd1e582dde8f492a68434f193f679a72737ae73bd6a3b2dcf2cded7281e50fd341d07e7a7b369539a0bf5efcfc981b0de5f1b795e59d
@@ -35,7 +35,7 @@ module Spotlight
35
35
 
36
36
  # GET /pages/1
37
37
  def show
38
- fresh_when([@page.exhibit, @page, request.query_parameters.to_query])
38
+ fresh_when([@page.exhibit, @page])
39
39
  end
40
40
 
41
41
  def preview
@@ -16,6 +16,18 @@ module Spotlight
16
16
  end
17
17
  end
18
18
 
19
+ def sir_trevor_format(text, format: :markdown)
20
+ if format.to_s.to_sym == :html
21
+ sir_trevor_html(text)
22
+ else
23
+ sir_trevor_markdown(text)
24
+ end
25
+ end
26
+
27
+ def sir_trevor_html(text)
28
+ sanitize(text, tags: %w[b i a br p sup])
29
+ end
30
+
19
31
  ##
20
32
  # Override the default #sir_trevor_markdown so we can use
21
33
  # a more complete markdown rendered
@@ -27,10 +27,8 @@ module Spotlight
27
27
  content_tag(:h1, html_content, class: 'page-header')
28
28
  end
29
29
 
30
- # rubocop:disable Naming/AccessorMethodName
31
30
  def set_html_page_title(title = nil)
32
31
  @page_title = strip_tags(t(:'spotlight.html_title', title: title || t(:'.title', default: :'.header'), application_name: application_name)).html_safe
33
32
  end
34
- # rubocop:enable Naming/AccessorMethodName
35
33
  end
36
34
  end
@@ -0,0 +1,85 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'ostruct'
4
+
5
+ module SirTrevorRails
6
+ # Forked from (former) upstream sir-trevor-rails 0.6.2 gem:
7
+ # https://github.com/madebymany/sir-trevor-rails/blob/931b9554f5268158b4da8817477cdc82e4e2e69c/lib/sir_trevor_rails/block.rb
8
+ # Copyright (c) 2013-2014 by ITV plc - http://www.itv.com
9
+ class Block < OpenStruct
10
+ DEFAULT_FORMAT = :markdown
11
+
12
+ def self.from_hash(hash, parent = nil)
13
+ hash = hash.deep_dup.with_indifferent_access
14
+ type_klass(hash).new(hash, parent)
15
+ end
16
+
17
+ def format
18
+ send(:[], :format).present? ? send(:[], :format).to_sym : DEFAULT_FORMAT
19
+ end
20
+
21
+ # Sets a list of custom block types to speed up lookup at runtime.
22
+ def self.custom_block_types
23
+ # You can define your custom block types directly here or in your engine config.
24
+ Spotlight::Engine.config.sir_trevor_widgets
25
+ end
26
+
27
+ def initialize(hash, parent)
28
+ @raw_data = hash
29
+ @parent = parent
30
+ @type = hash[:type].to_sym
31
+ super(hash[:data])
32
+ end
33
+
34
+ attr_reader :parent, :type
35
+
36
+ def to_partial_path
37
+ "sir_trevor/blocks/#{self.class.name.demodulize.underscore}"
38
+ end
39
+
40
+ def as_json(*_attrs)
41
+ {
42
+ type: @type.to_s,
43
+ data: marshal_dump
44
+ }
45
+ end
46
+
47
+ # Infers the block class.
48
+ # Safe lookup that tries to identify user created block class.
49
+ #
50
+ # @param [Symbol] type
51
+ def self.block_class(type)
52
+ type_name = type.to_s.camelize
53
+ block_name = "#{type_name}Block"
54
+ if custom_block_types.include?(type_name)
55
+ begin
56
+ block_name.constantize
57
+ rescue NameError
58
+ block_class!(block_name)
59
+ end
60
+ else
61
+ block_class!(block_name)
62
+ end
63
+ end
64
+
65
+ # Infers the block class.
66
+ # Failover from block_class.
67
+ # Safe lookup against the SirTevor::Blocks namespace
68
+ # If no block is found, create one with given name and inherit from Block class
69
+ #
70
+ # @param [Constant] block_name
71
+ def self.block_class!(block_name)
72
+ SirTrevorRails::Blocks.const_get(block_name)
73
+ rescue NameError
74
+ SirTrevorRails::Blocks.const_set(block_name, Class.new(Block))
75
+ end
76
+
77
+ def self.type_klass(hash)
78
+ if self == Block
79
+ block_class(hash[:type].to_sym)
80
+ else
81
+ self
82
+ end
83
+ end
84
+ end
85
+ end
@@ -14,7 +14,7 @@ module SirTrevorRails
14
14
  end
15
15
 
16
16
  def ordered_items
17
- items.sort_by { |x| x[:weight] }.map { |x| x[:id] }
17
+ items.sort_by { |x| x[:weight].to_i }.map { |x| x[:id] }
18
18
  end
19
19
 
20
20
  private
@@ -5,12 +5,21 @@ module Spotlight
5
5
  # Sir-Trevor created content
6
6
  class SirTrevor
7
7
  def self.parse(page, attribute)
8
- content = page.read_attribute(attribute)
9
- content ||= [].to_json
8
+ blocks = page.read_attribute(attribute)
9
+ blocks ||= [].to_json
10
10
 
11
- return SirTrevorRails::BlockArray.new if content.blank?
11
+ return [] if blocks.blank?
12
12
 
13
- SirTrevorRails::BlockArray.from_json(content, page)
13
+ blocks = JSON.parse(blocks, symbolize_names: true) if blocks.is_a?(String)
14
+
15
+ if blocks.is_a?(Hash)
16
+ blocks = blocks[:data] || blocks['data'] or
17
+ raise IndexError, 'No block data found'
18
+ end
19
+
20
+ blocks.map do |obj|
21
+ SirTrevorRails::Block.from_hash(obj, page)
22
+ end
14
23
  end
15
24
  end
16
25
  end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ unless defined?(Translation)
4
+ Translation = I18n::Backend::ActiveRecord::Translation
5
+ Translation.include Spotlight::CustomTranslationExtension
6
+
7
+ # Work-around for https://github.com/svenfuchs/i18n-active_record/pull/133
8
+ if Translation.respond_to?(:to_hash)
9
+ class << Translation
10
+ alias to_h to_hash
11
+ remove_method :to_hash
12
+ end
13
+
14
+ I18n::Backend::ActiveRecord.define_method(:init_translations) do
15
+ @translations = Translation.to_h
16
+ end
17
+ end
18
+ end
@@ -7,7 +7,7 @@
7
7
  <li class="nav-item"><%= link_to t(:'spotlight.sites.edit.page_title'), spotlight.edit_site_path, class: 'nav-link' %></li>
8
8
  <% end %>
9
9
 
10
- <% if can? :manange, Spotlight::Exhibit %>
10
+ <% if can? :manage, Spotlight::Exhibit %>
11
11
  <li class="nav-item"><%= link_to t(:'spotlight.sites.edit_exhibits.page_title'), spotlight.edit_site_exhibits_path, class: 'nav-link' %></li>
12
12
  <li class="nav-item"><%= link_to t(:'spotlight.admin_users.index.page_title'), spotlight.admin_users_path, class: 'nav-link' %></li>
13
13
  <% end %>
@@ -0,0 +1,5 @@
1
+ <% if video.source == 'vimeo' %>
2
+ <%= render partial: '/spotlight/sir_trevor/blocks/videos/vimeo', vimeo: video %>
3
+ <% elsif video.source == 'youtube' %>
4
+ <%= render partial: '/spotlight/sir_trevor/blocks/videos/youtube', youtube: video %>
5
+ <% end %>
@@ -65,6 +65,7 @@ ignore_unused:
65
65
  - helpers.action.{edit,edit_long,new,view} # app/helpers/spotlight/crud_link_helpers.rb
66
66
  - helpers.action.spotlight/search.edit_long # app/views/spotlight/searches/_search.html.erb
67
67
  - spotlight.about_pages.page_options.published # app/views/spotlight/about_pages/_page_options.html.erb
68
+ - spotlight.job_trackers.show.messages.status.{completed,enqueued,failed,missing,pending} # app/views/spotlight/job_trackers/show.html.erb
68
69
  - helpers.submit.contact_form.create # app/views/spotlight/shared/_report_a_problem.html.erb
69
70
  - activerecord.help.spotlight/exhibit.tag_list # app/views/spotlight/exhibits/_form.html.erb
70
71
  - helpers.label.solr_document.exhibit_tag_list # app/views/spotlight/catalog/_edit_default.html.erb
@@ -0,0 +1,40 @@
1
+ de:
2
+ activemodel:
3
+ attributes:
4
+ spotlight/contact_form:
5
+ email: E-Mail Adresse
6
+ message: Nachricht
7
+ name: Name
8
+ helpers:
9
+ action:
10
+ cancel: Abbrechen
11
+ submit:
12
+ contact_form:
13
+ create: Senden
14
+ created: Vielen Dank. Ihre Feedback wurde gesendet.
15
+ spotlight:
16
+ about_pages:
17
+ contacts:
18
+ header: Kontakt
19
+ header_links:
20
+ contact: Feedback
21
+ shared:
22
+ report_a_problem:
23
+ honeypot_field_explanation: Bitte ignorieren Sie dieses Textfeld. Es wird verwendet, um Spam zu erkennen. Wenn Sie etwas hier eingeben, wird Ihre Nachricht nicht gesendet.
24
+ title: Kontakten Sie Uns
25
+ browse:
26
+ search:
27
+ item_count:
28
+ one: "%{count} Suchergebnisse"
29
+ other: "%{count} Suchergebnisse"
30
+ search_box:
31
+ label: Innerhalb dieser Kategorie suchen
32
+ placeholder: Suchen…
33
+ reset: Zurücksetzen
34
+ submit: Innerhalb dieser Kategorie suchen
35
+ success:
36
+ expand_html: Suche erweitern <a href="%{expand_search_url}">"%{browse_query}"</a>.
37
+ result_number_html: <strong> %{search_size} Suchergebnisse von %{parent_search_count} Gesamteinheiten in dieser Suchkategorie gefunden</strong>.
38
+ zero_results:
39
+ expand_html: <a href="%{clear_search_url}">Suche zurücksetzen</a> oder <a href="%{expand_search_url}"> erweitern "%{browse_query}"</a>.
40
+ result_number: Es können keine Suchergebnisse gefunden werden.
@@ -11,7 +11,7 @@ module Spotlight
11
11
  class_option :mailer_default_url_host, type: :string, default: '' # e.g. localhost:3000
12
12
 
13
13
  # we're not (yet) using webpacker, so we need to re-add sprockets functionality
14
- def add_js
14
+ def add_js_rails6
15
15
  return unless Rails.version.to_i == 6
16
16
 
17
17
  gem 'coffee-rails', '~> 4.2'
@@ -29,6 +29,12 @@ module Spotlight
29
29
  run 'bundle exec rails webpacker:install'
30
30
  end
31
31
 
32
+ def add_js_rails7
33
+ return unless Rails.version.to_i == 7
34
+
35
+ append_to_file 'app/assets/javascripts/application.js', "\n//= require_tree .\n"
36
+ end
37
+
32
38
  def inject_spotlight_routes
33
39
  route "mount Spotlight::Engine, at: 'spotlight'"
34
40
  gsub_file 'config/routes.rb', /^\s*root.*/ do |match|
@@ -44,6 +50,8 @@ module Spotlight
44
50
  end
45
51
 
46
52
  def riiif
53
+ gem 'riiif'
54
+ Bundler.with_clean_env { run 'bundle install' }
47
55
  route "mount Riiif::Engine => '/images', as: 'riiif'"
48
56
  copy_file 'config/initializers/riiif.rb'
49
57
  end
@@ -124,7 +132,7 @@ module Spotlight
124
132
  end
125
133
 
126
134
  def add_osd_viewer
127
- gem 'blacklight-gallery', '~> 3.0'
135
+ gem 'blacklight-gallery', '~> 4.0'
128
136
  bundle_install
129
137
  generate 'blacklight_gallery:install'
130
138
  end
@@ -169,6 +177,36 @@ module Spotlight
169
177
  copy_file 'config/initializers/translation.rb'
170
178
  end
171
179
 
180
+ def configure_queue
181
+ insert_into_file 'config/application.rb', after: "< Rails::Application\n" do
182
+ <<-EOF
183
+ config.active_job.queue_adapter = ENV["RAILS_QUEUE"]&.to_sym || :sidekiq
184
+ EOF
185
+ end
186
+ end
187
+
188
+ def configure_logging
189
+ insert_into_file 'config/application.rb', after: "< Rails::Application\n" do
190
+ <<-EOF
191
+ # Logging
192
+ if ENV["RAILS_LOG_TO_STDOUT"].present?
193
+ config.log_level = :debug
194
+ config.log_formatter = ::Logger::Formatter.new
195
+ # log to stdout
196
+ logger = ActiveSupport::Logger.new(STDOUT)
197
+ logger.formatter = config.log_formatter
198
+ config.logger = ActiveSupport::TaggedLogging.new(logger)
199
+ # Print deprecation notices to the Rails logger.
200
+ config.active_support.deprecation = :log
201
+ # Raise an error on page load if there are pending migrations.
202
+ config.active_record.migration_error = :page_load
203
+ # Highlight code that triggered database queries in logs.
204
+ config.active_record.verbose_query_logs = true
205
+ end
206
+ EOF
207
+ end
208
+ end
209
+
172
210
  private
173
211
 
174
212
  def bundle_install
@@ -3,17 +3,17 @@
3
3
  require 'i18n/backend/active_record'
4
4
  require 'i18n/backend/fallbacks'
5
5
 
6
- Translation = I18n::Backend::ActiveRecord::Translation
7
-
8
6
  ActiveSupport::Reloader.to_prepare do
9
- if Translation.table_exists?
7
+ # Don't allow initializer to break if DB doesn't exist yet
8
+ # see: https://github.com/projectblacklight/spotlight/issues/2133
9
+ if ENV['SKIP_TRANSLATION'].blank?
10
+ raise unless Translation.table_exists?
11
+
10
12
  ##
11
13
  # Sets up the new Spotlight Translation backend, backed by ActiveRecord. To
12
14
  # turn on the ActiveRecord backend, uncomment the following lines.
13
-
14
15
  I18n.backend = I18n::Backend::ActiveRecord.new
15
16
  I18n::Backend::ActiveRecord.include I18n::Backend::Memoize
16
- Translation.include Spotlight::CustomTranslationExtension
17
17
  I18n::Backend::Simple.include I18n::Backend::Memoize
18
18
  I18n::Backend::Simple.include I18n::Backend::Pluralization
19
19
  I18n::Backend::Simple.include I18n::Backend::Fallbacks
@@ -3,14 +3,14 @@
3
3
  <!-- NOTE: various comments and unused configuration possibilities have been purged
4
4
  from this file. Please refer to http://wiki.apache.org/solr/SchemaXml,
5
5
  as well as the default schema file included with Solr -->
6
-
6
+
7
7
  <uniqueKey>id</uniqueKey>
8
-
8
+
9
9
  <fields>
10
10
  <field name="id" type="string" stored="true" indexed="true" multiValued="false" required="true"/>
11
11
  <field name="_version_" type="long" indexed="true" stored="true"/>
12
12
  <field name="timestamp" type="date" indexed="true" stored="true" default="NOW" multiValued="false"/>
13
-
13
+
14
14
  <field name="lat" type="tdouble" stored="true" indexed="true" multiValued="false"/>
15
15
  <field name="lng" type="tdouble" stored="true" indexed="true" multiValued="false"/>
16
16
  <field name="original_pid_tesim" type="pid_text" stored="true" indexed="true" multiValued="true"/>
@@ -36,7 +36,7 @@
36
36
  -->
37
37
  <dynamicField name="*_tsiv" type="text" stored="true" indexed="true" multiValued="false" termVectors="true" termPositions="true" termOffsets="true"/>
38
38
  <dynamicField name="*_tsimv" type="text" stored="true" indexed="true" multiValued="true" termVectors="true" termPositions="true" termOffsets="true"/>
39
-
39
+
40
40
  <!-- English text (_te...) -->
41
41
  <!--
42
42
  <dynamicField name="*_tei" type="text_en" stored="false" indexed="true" multiValued="false"/>
@@ -52,7 +52,7 @@
52
52
  -->
53
53
  <dynamicField name="*_tesiv" type="text_en" stored="true" indexed="true" multiValued="false" termVectors="true" termPositions="true" termOffsets="true"/>
54
54
  <dynamicField name="*_tesimv" type="text_en" stored="true" indexed="true" multiValued="true" termVectors="true" termPositions="true" termOffsets="true"/>
55
-
55
+
56
56
  <!-- string (_s...) -->
57
57
  <!--
58
58
  <dynamicField name="*_si" type="string" stored="false" indexed="true" multiValued="false"/>
@@ -65,7 +65,7 @@
65
65
  <!--
66
66
  <dynamicField name="*_ssort" type="alphaSort" stored="false" indexed="true" multiValued="false"/>
67
67
  -->
68
-
68
+
69
69
  <!-- integer (_i...) -->
70
70
  <!--
71
71
  <dynamicField name="*_ii" type="int" stored="false" indexed="true" multiValued="false"/>
@@ -75,7 +75,7 @@
75
75
  <dynamicField name="*_ism" type="int" stored="true" indexed="false" multiValued="true"/>
76
76
  <dynamicField name="*_isi" type="int" stored="true" indexed="true" multiValued="false"/>
77
77
  <dynamicField name="*_isim" type="int" stored="true" indexed="true" multiValued="true"/>
78
-
78
+
79
79
  <!-- trie integer (_it...) (for faster range queries) -->
80
80
  <!--
81
81
  <dynamicField name="*_iti" type="tint" stored="false" indexed="true" multiValued="false"/>
@@ -85,7 +85,7 @@
85
85
  <dynamicField name="*_itsm" type="tint" stored="true" indexed="false" multiValued="true"/>
86
86
  <dynamicField name="*_itsi" type="tint" stored="true" indexed="true" multiValued="false"/>
87
87
  <dynamicField name="*_itsim" type="tint" stored="true" indexed="true" multiValued="true"/>
88
-
88
+
89
89
  <!-- date (_dt...) -->
90
90
  <!-- The format for this date field is of the form 1995-12-31T23:59:59Z
91
91
  Optional fractional seconds are allowed: 1995-12-31T23:59:59.999Z -->
@@ -97,7 +97,7 @@
97
97
  <dynamicField name="*_dtsm" type="date" stored="true" indexed="false" multiValued="true"/>
98
98
  <dynamicField name="*_dtsi" type="date" stored="true" indexed="true" multiValued="false"/>
99
99
  <dynamicField name="*_dtsim" type="date" stored="true" indexed="true" multiValued="true"/>
100
-
100
+
101
101
  <!-- trie date (_dtt...) (for faster range queries) -->
102
102
  <!--
103
103
  <dynamicField name="*_dtti" type="tdate" stored="false" indexed="true" multiValued="false"/>
@@ -107,7 +107,7 @@
107
107
  <dynamicField name="*_dttsm" type="tdate" stored="true" indexed="false" multiValued="true"/>
108
108
  <dynamicField name="*_dttsi" type="tdate" stored="true" indexed="true" multiValued="false"/>
109
109
  <dynamicField name="*_dttsim" type="tdate" stored="true" indexed="true" multiValued="true"/>
110
-
110
+
111
111
  <!-- long (_l...) -->
112
112
  <!--
113
113
  <dynamicField name="*_li" type="long" stored="false" indexed="true" multiValued="false"/>
@@ -117,7 +117,7 @@
117
117
  <dynamicField name="*_lsm" type="long" stored="true" indexed="false" multiValued="true"/>
118
118
  <dynamicField name="*_lsi" type="long" stored="true" indexed="true" multiValued="false"/>
119
119
  <dynamicField name="*_lsim" type="long" stored="true" indexed="true" multiValued="true"/>
120
-
120
+
121
121
  <!-- trie long (_lt...) (for faster range queries) -->
122
122
  <!--
123
123
  <dynamicField name="*_lti" type="tlong" stored="false" indexed="true" multiValued="false"/>
@@ -127,7 +127,7 @@
127
127
  <dynamicField name="*_ltsm" type="tlong" stored="true" indexed="false" multiValued="true"/>
128
128
  <dynamicField name="*_ltsi" type="tlong" stored="true" indexed="true" multiValued="false"/>
129
129
  <dynamicField name="*_ltsim" type="tlong" stored="true" indexed="true" multiValued="true"/>
130
-
130
+
131
131
  <!-- double (_db...) -->
132
132
  <!--
133
133
  <dynamicField name="*_dbi" type="double" stored="false" indexed="true" multiValued="false"/>
@@ -137,7 +137,7 @@
137
137
  <dynamicField name="*_dbsm" type="double" stored="true" indexed="false" multiValued="true"/>
138
138
  <dynamicField name="*_dbsi" type="double" stored="true" indexed="true" multiValued="false"/>
139
139
  <dynamicField name="*_dbsim" type="double" stored="true" indexed="true" multiValued="true"/>
140
-
140
+
141
141
  <!-- trie double (_dbt...) (for faster range queries) -->
142
142
  <!--
143
143
  <dynamicField name="*_dbti" type="tdouble" stored="false" indexed="true" multiValued="false"/>
@@ -147,7 +147,7 @@
147
147
  <dynamicField name="*_dbtsm" type="tdouble" stored="true" indexed="false" multiValued="true"/>
148
148
  <dynamicField name="*_dbtsi" type="tdouble" stored="true" indexed="true" multiValued="false"/>
149
149
  <dynamicField name="*_dbtsim" type="tdouble" stored="true" indexed="true" multiValued="true"/>
150
-
150
+
151
151
  <!-- float (_f...) -->
152
152
  <!--
153
153
  <dynamicField name="*_fi" type="float" stored="false" indexed="true" multiValued="false"/>
@@ -157,7 +157,7 @@
157
157
  <dynamicField name="*_fsm" type="float" stored="true" indexed="false" multiValued="true"/>
158
158
  <dynamicField name="*_fsi" type="float" stored="true" indexed="true" multiValued="false"/>
159
159
  <dynamicField name="*_fsim" type="float" stored="true" indexed="true" multiValued="true"/>
160
-
160
+
161
161
  <!-- trie float (_ft...) (for faster range queries) -->
162
162
  <!--
163
163
  <dynamicField name="*_fti" type="tfloat" stored="false" indexed="true" multiValued="false"/>
@@ -167,28 +167,13 @@
167
167
  <dynamicField name="*_ftsm" type="tfloat" stored="true" indexed="false" multiValued="true"/>
168
168
  <dynamicField name="*_ftsi" type="tfloat" stored="true" indexed="true" multiValued="false"/>
169
169
  <dynamicField name="*_ftsim" type="tfloat" stored="true" indexed="true" multiValued="true"/>
170
-
170
+
171
171
  <!-- boolean (_b...) -->
172
172
  <!--
173
173
  <dynamicField name="*_bi" type="boolean" stored="false" indexed="true" multiValued="false"/>
174
174
  -->
175
175
  <dynamicField name="*_bs" type="boolean" stored="true" indexed="false" multiValued="false"/>
176
176
  <dynamicField name="*_bsi" type="boolean" stored="true" indexed="true" multiValued="false"/>
177
-
178
- <!-- Type used to index the lat and lon components for the "location" FieldType -->
179
- <!--
180
- <dynamicField name="*_coordinate" type="tdouble" indexed="true" stored="false" />
181
- -->
182
-
183
- <!-- location (_ll...) -->
184
- <!--
185
- <dynamicField name="*_lli" type="location" stored="false" indexed="true" multiValued="false"/>
186
- <dynamicField name="*_llim" type="location" stored="false" indexed="true" multiValued="true"/>
187
- -->
188
- <dynamicField name="*_lls" type="location" stored="true" indexed="false" multiValued="false"/>
189
- <dynamicField name="*_llsm" type="location" stored="true" indexed="false" multiValued="true"/>
190
- <dynamicField name="*_llsi" type="location" stored="true" indexed="true" multiValued="false"/>
191
- <dynamicField name="*_llsim" type="location" stored="true" indexed="true" multiValued="true"/>
192
177
 
193
178
  <!-- you must define copyField source and dest fields explicity or schemaBrowser doesn't work -->
194
179
  <field name="all_text_timv" type="text" stored="false" indexed="true" multiValued="true" termVectors="true" termPositions="true" termOffsets="true"/>
@@ -208,32 +193,32 @@
208
193
 
209
194
  <types>
210
195
  <fieldType name="string" class="solr.StrField" sortMissingLast="true" />
211
- <fieldType name="boolean" class="solr.BoolField" sortMissingLast="true"/>
196
+ <fieldType name="boolean" class="solr.BoolField" sortMissingLast="true"/>
212
197
  <fieldType name="rand" class="solr.RandomSortField" omitNorms="true"/>
213
-
198
+
214
199
  <!-- Default numeric field types. -->
215
200
  <fieldType name="int" class="solr.TrieIntField" precisionStep="0" positionIncrementGap="0"/>
216
201
  <fieldType name="float" class="solr.TrieFloatField" precisionStep="0" positionIncrementGap="0"/>
217
202
  <fieldType name="long" class="solr.TrieLongField" precisionStep="0" positionIncrementGap="0"/>
218
203
  <fieldType name="double" class="solr.TrieDoubleField" precisionStep="0" positionIncrementGap="0"/>
219
-
204
+
220
205
  <!-- trie numeric field types for faster range queries -->
221
206
  <fieldType name="tint" class="solr.TrieIntField" precisionStep="8" positionIncrementGap="0"/>
222
207
  <fieldType name="tfloat" class="solr.TrieFloatField" precisionStep="8" positionIncrementGap="0"/>
223
208
  <fieldType name="tlong" class="solr.TrieLongField" precisionStep="8" positionIncrementGap="0"/>
224
209
  <fieldType name="tdouble" class="solr.TrieDoubleField" precisionStep="8" positionIncrementGap="0"/>
225
-
210
+
226
211
  <!-- The format for this date field is of the form 1995-12-31T23:59:59Z
227
212
  Optional fractional seconds are allowed: 1995-12-31T23:59:59.999Z
228
213
  -->
229
214
  <fieldType name="date" class="solr.TrieDateField" precisionStep="0" positionIncrementGap="0"/>
230
215
  <!-- A Trie based date field for faster date range queries and date faceting. -->
231
216
  <fieldType name="tdate" class="solr.TrieDateField" precisionStep="6" positionIncrementGap="0"/>
232
-
233
-
217
+
218
+
234
219
  <!-- This point type indexes the coordinates as separate fields (subFields)
235
220
  If subFieldType is defined, it references a type, and a dynamic field
236
- definition is created matching *___<typename>. Alternately, if
221
+ definition is created matching *___<typename>. Alternately, if
237
222
  subFieldSuffix is defined, that is used to create the subFields.
238
223
  Example: if subFieldType="double", then the coordinates would be
239
224
  indexed in fields myloc_0___double,myloc_1___double.
@@ -243,17 +228,14 @@
243
228
  users normally should not need to know about them.
244
229
  -->
245
230
  <fieldType name="point" class="solr.PointType" dimension="2" subFieldSuffix="_d"/>
246
-
247
- <!-- A specialized field for geospatial search. If indexed, this fieldType must not be multivalued. -->
248
- <fieldType name="location" class="solr.LatLonType" subFieldSuffix="_coordinate"/>
249
-
231
+
250
232
  <!-- An alternative geospatial field type new to Solr 4. It supports multiValued and polygon shapes.
251
233
  For more information about this and other Spatial fields new to Solr 4, see:
252
234
  http://wiki.apache.org/solr/SolrAdaptersForLuceneSpatial4
253
235
  -->
254
236
  <fieldType name="location_rpt" class="solr.SpatialRecursivePrefixTreeFieldType"
255
237
  geo="true" distErrPct="0.025" maxDistErr="0.000009" distanceUnits="degrees" />
256
-
238
+
257
239
  <fieldType name="text" class="solr.TextField" omitNorms="false">
258
240
  <analyzer>
259
241
  <tokenizer class="solr.ICUTokenizerFactory"/>
@@ -261,7 +243,7 @@
261
243
  <filter class="solr.TrimFilterFactory"/>
262
244
  </analyzer>
263
245
  </fieldType>
264
-
246
+
265
247
  <!-- A text field that only splits on whitespace for exact matching of words -->
266
248
  <fieldType name="text_ws" class="solr.TextField" positionIncrementGap="100">
267
249
  <analyzer>
@@ -269,7 +251,7 @@
269
251
  <filter class="solr.TrimFilterFactory"/>
270
252
  </analyzer>
271
253
  </fieldType>
272
-
254
+
273
255
  <!-- single token analyzed text, for sorting. Punctuation is significant. -->
274
256
  <fieldtype name="alphaSort" class="solr.TextField" sortMissingLast="true" omitNorms="true">
275
257
  <analyzer>
@@ -278,7 +260,7 @@
278
260
  <filter class="solr.TrimFilterFactory" />
279
261
  </analyzer>
280
262
  </fieldtype>
281
-
263
+
282
264
  <!-- A text field with defaults appropriate for English -->
283
265
  <fieldType name="text_en" class="solr.TextField" positionIncrementGap="100">
284
266
  <analyzer>
@@ -321,7 +303,7 @@
321
303
  <tokenizer class="solr.KeywordTokenizerFactory"/>
322
304
  </analyzer>
323
305
  </fieldType>
324
-
306
+
325
307
  <!-- queries for paths match documents at that path, or in descendent paths -->
326
308
  <fieldType name="descendent_path" class="solr.TextField">
327
309
  <analyzer type="index">
@@ -331,7 +313,7 @@
331
313
  <tokenizer class="solr.KeywordTokenizerFactory" />
332
314
  </analyzer>
333
315
  </fieldType>
334
-
316
+
335
317
  <!-- queries for paths match documents at that path, or in ancestor paths -->
336
318
  <fieldType name="ancestor_path" class="solr.TextField">
337
319
  <analyzer type="index">
@@ -341,7 +323,7 @@
341
323
  <tokenizer class="solr.PathHierarchyTokenizerFactory" delimiter="/" />
342
324
  </analyzer>
343
325
  </fieldType>
344
-
326
+
345
327
  </types>
346
-
328
+
347
329
  </schema>