blacklight_oai_provider 5.0.0 → 6.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +5 -5
  2. data/.rubocop.yml +1 -0
  3. data/.solr_wrapper +1 -1
  4. data/.travis.yml +21 -11
  5. data/Gemfile +3 -0
  6. data/README.md +12 -20
  7. data/Rakefile +0 -2
  8. data/VERSION +1 -1
  9. data/app/controllers/concerns/blacklight_oai_provider/controller.rb +8 -3
  10. data/app/models/concerns/blacklight_oai_provider/solr_document.rb +1 -1
  11. data/blacklight_oai_provider.gemspec +5 -11
  12. data/lib/blacklight_oai_provider.rb +0 -14
  13. data/lib/blacklight_oai_provider/engine.rb +0 -9
  14. data/lib/blacklight_oai_provider/routes.rb +5 -9
  15. data/lib/blacklight_oai_provider/solr_document_provider.rb +3 -2
  16. data/lib/blacklight_oai_provider/solr_document_wrapper.rb +18 -18
  17. data/lib/blacklight_oai_provider/solr_set.rb +5 -3
  18. data/lib/generators/blacklight_oai_provider/install_generator.rb +12 -0
  19. data/lib/railties/blacklight_oai_provider.rake +1 -1
  20. data/solr/conf/schema.xml +322 -563
  21. data/solr/conf/solrconfig.xml +55 -182
  22. data/solr/sample_solr_documents.yml +722 -722
  23. data/spec/controllers/catalog_controller_spec.rb +0 -1
  24. data/spec/lib/blacklight_oai_provider/solr_document_provider_spec.rb +50 -0
  25. data/spec/lib/blacklight_oai_provider/solr_document_wrapper_spec.rb +1 -1
  26. data/spec/lib/blacklight_oai_provider/solr_set_spec.rb +7 -7
  27. data/spec/requests/get_record_spec.rb +10 -0
  28. data/spec/requests/list_identifiers_spec.rb +4 -4
  29. data/spec/requests/list_records_spec.rb +5 -5
  30. data/spec/requests/list_sets_spec.rb +7 -7
  31. data/spec/spec_helper.rb +2 -11
  32. data/spec/test_app_templates/lib/generators/test_app_generator.rb +37 -23
  33. data/spec/test_app_templates/templates/catalog_controller.rb +196 -0
  34. metadata +22 -52
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: b00e5287f2ffa229d20459a1c8817abe39846888
4
- data.tar.gz: 6abf579e82431c293cfcaa57f4317a170bb102ca
2
+ SHA256:
3
+ metadata.gz: 6ceebec774a13c7b3e0651472ef6c78ef01e091cad8e5a2b7cfe4dee8597f883
4
+ data.tar.gz: bea9de1be5db043c9094a66f3be592623a3ef5ed970579e406ccacae1c1246d6
5
5
  SHA512:
6
- metadata.gz: 91e4142e3c0ccd46c65dc7dfbf63fc0e4e9f9034630ca212e23c1a9e7d1663a7ed8da7b7e37ee9a87e8d93bbe4fbff9700ea49e79f0228611d5993c0aba7e91c
7
- data.tar.gz: 1ea843062141a4d0dc0d58e4d964bee245ae539e7241c1f41b0e0d50362ebb1caac5926f36fa9019b75385f4f638027abdc7184956d80e0e09f3137b0783a822
6
+ metadata.gz: aabaa271f67221254df440c532664dbba119e50031f5cf9dffaddbf31453483d354b783dbbd3291a991a8e939b8d5459541d73aeca210eaac28b53a56d49f5bb
7
+ data.tar.gz: 4b5fa537fb35349a6cd5814d16726964bee90f22aeff513868287a50c97d9fda5be7b07343748f0380d478d2d318b8e4ba6580a7845881bbaf0a2a2b58e49d8e
@@ -4,6 +4,7 @@ inherit_from:
4
4
  - .rubocop_todo.yml
5
5
 
6
6
  AllCops:
7
+ TargetRubyVersion: 2.3
7
8
  DisplayCopNames: true
8
9
  Exclude:
9
10
  - "blacklight_oai_provider.gemspec"
@@ -1,7 +1,7 @@
1
1
  # Place any default configuration for solr_wrapper here
2
2
  port: 8983
3
3
  verbose: true
4
- version: 5.5.5
4
+ version: 8.6.2
5
5
  managed: true
6
6
  collection:
7
7
  dir: solr/conf/
@@ -1,16 +1,26 @@
1
+ dist: bionic
2
+ language: ruby
3
+ addons:
4
+ chrome: stable
5
+ before_install:
6
+ - google-chrome-stable --headless --disable-gpu --no-sandbox --remote-debugging-port=9222 http://localhost &
7
+
1
8
  notifications:
2
9
  email: false
3
10
 
4
- language: ruby
5
- sudo: false
6
- rvm:
7
- - 2.3.3
8
- - 2.2
9
- - 2.1
11
+ matrix:
12
+ include:
13
+ - rvm: 2.6.5
14
+ env: "RAILS_VERSION=5.2.3"
15
+ - rvm: 2.5.7
16
+ env: "RAILS_VERSION=5.1.7"
10
17
 
11
- env:
12
- - "RAILS_VERSION=4.2.9"
13
- - "RAILS_VERSION=4.1.16"
18
+ notifications:
19
+ irc: "irc.freenode.org#blacklight"
20
+ email:
21
+ - blacklight-commits@googlegroups.com
14
22
 
15
- before_install:
16
- - gem install bundler
23
+ global_env:
24
+ - NOKOGIRI_USE_SYSTEM_LIBRARIES=true
25
+
26
+ jdk: oraclejdk9
data/Gemfile CHANGED
@@ -27,10 +27,13 @@ else
27
27
  end
28
28
 
29
29
  case ENV['RAILS_VERSION']
30
+ when /^5.[12]/, /^6.0/
31
+ gem 'sass-rails', '~> 5.0'
30
32
  when /^4.2/
31
33
  gem 'responders', '~> 2.0'
32
34
  gem 'sass-rails', '>= 5.0'
33
35
  gem 'coffee-rails', '~> 4.1.0'
36
+ gem 'json', '~> 1.8'
34
37
  when /^4.[01]/
35
38
  gem 'sass-rails', '< 5.0'
36
39
  end
data/README.md CHANGED
@@ -34,16 +34,25 @@ Then run
34
34
  ```ruby
35
35
  rails generate blacklight_oai_provider:install
36
36
  ```
37
- to install the appropriate extensions into your `CatalogController` and `SolrDocument` classes. If you want to do customize the way this installs, instead you may:
37
+ to install the appropriate extensions into your `CatalogController` class, `SolrDocument` class, and routes file. If you want to do customize the way this installs, instead you may:
38
38
 
39
- - add this to your Solr Document model:
39
+ - add this to the SolrDocument model:
40
40
  ```ruby
41
41
  include BlacklightOaiProvider::SolrDocument
42
42
  ```
43
- - add this to your Controller:
43
+ - add this to the Controller:
44
44
  ```ruby
45
45
  include BlacklightOaiProvider::Controller
46
46
  ```
47
+ - add this to `config/routes.rb`
48
+ ```ruby
49
+ concern :oai_provider, BlacklightOaiProvider::Routes.new
50
+
51
+ resource :catalog, only: [:index], as: 'catalog', path: '/catalog', controller: 'catalog' do
52
+ concerns :oai_provider
53
+ ...
54
+ end
55
+ ```
47
56
 
48
57
  ## Configuration
49
58
 
@@ -66,7 +75,6 @@ configure_blacklight do |config|
66
75
  sample_id: '109660'
67
76
  },
68
77
  document: {
69
- model: SolrDocument, # SolrDocument class being used, default: SolrDocument
70
78
  limit: 25 # number of records returned with each request, default: 15
71
79
  set_fields: [ # ability to define ListSets, optional, default: nil
72
80
  { label: 'language', solr_field: 'language_facet' }
@@ -135,23 +143,7 @@ config.oai = {
135
143
  }
136
144
  }
137
145
  ```
138
- ## Injection
139
- This plugin assumes it is in a Blacklight Rails app, uses Blacklight methods, Rails methods, and standard ruby module includes to inject it's behaviors into the app.
140
-
141
- You can turn off this injection if you like, although it will make the plugin less (or non-) functional unless you manually do similar injection. See `lib/blacklight_oai_provider.rb#inject!` to see exactly what's going on.
142
146
 
143
- In any initializer, you can set:
144
- ```ruby
145
- BlacklightOaiProvider.omit_inject = true
146
- ```
147
- to turn off all injection. The plugin will be completely non-functional if you do this, of course. But perhaps you could try to re-use some of it's classes in a non-Blacklight, highly hacked Blacklight, or even non-Rails application this way.
148
-
149
- You can also turn off injection of individual components, which could be more useful:
150
- ```ruby
151
- BlacklightOaiProvider.omit_inject = {
152
- routes: false,
153
- }
154
- ```
155
147
  ## Tests
156
148
  We use `engine_cart` and `solr_wrapper` to run tests on a dummy instance of an app using this plugin.
157
149
 
data/Rakefile CHANGED
@@ -14,8 +14,6 @@ RSpec::Core::RakeTask.new
14
14
  require 'rubocop/rake_task'
15
15
  RuboCop::RakeTask.new(:rubocop)
16
16
 
17
- EngineCart.fingerprint_proc = EngineCart.rails_fingerprint_proc
18
-
19
17
  desc 'Run test suite'
20
18
  task ci: ['engine_cart:generate'] do
21
19
  SolrWrapper.wrap do |solr|
data/VERSION CHANGED
@@ -1 +1 @@
1
- 5.0.0
1
+ 6.1.0
@@ -14,13 +14,12 @@ module BlacklightOaiProvider
14
14
  # Used when we need a second Solr query to get range facets, after the
15
15
  # first found min/max from result set.
16
16
  def oai
17
- options = params.delete_if { |k, _| %w[controller action].include?(k) }
18
17
  body = oai_provider
19
- .process_request(options)
18
+ .process_request(oai_params.to_h)
20
19
  .gsub('<?xml version="1.0" encoding="UTF-8"?>') do |m|
21
20
  "#{m}\n<?xml-stylesheet type=\"text/xsl\" href=\"#{ActionController::Base.helpers.asset_path('blacklight_oai_provider/oai2.xsl')}\"?>\n"
22
21
  end
23
- render text: body, content_type: 'text/xml'
22
+ render xml: body, content_type: 'text/xml'
24
23
  end
25
24
 
26
25
  # Uses Blacklight.config, needs to be modified when
@@ -34,5 +33,11 @@ module BlacklightOaiProvider
34
33
  def oai_provider
35
34
  @oai_provider ||= BlacklightOaiProvider::SolrDocumentProvider.new(self, oai_config)
36
35
  end
36
+
37
+ private
38
+
39
+ def oai_params
40
+ params.permit(:verb, :identifier, :metadataPrefix, :set, :from, :until, :resumptionToken)
41
+ end
37
42
  end
38
43
  end
@@ -3,7 +3,7 @@ module BlacklightOaiProvider
3
3
  extend ActiveSupport::Concern
4
4
 
5
5
  def timestamp
6
- timestamp = get(self.class.timestamp_key)
6
+ timestamp = fetch(self.class.timestamp_key, nil)
7
7
  raise BlacklightOaiProvider::Exceptions::MissingTimestamp if timestamp.blank?
8
8
  Time.zone.parse(timestamp) # Solr timestamps are all in UTC.
9
9
  end
@@ -9,11 +9,6 @@ Gem::Specification.new do |s|
9
9
  s.homepage = "http://projectblacklight.org/"
10
10
  s.summary = "Blacklight Oai Provider plugin"
11
11
 
12
- s.post_install_message = %q{
13
- BlacklightOaiProvider v5.x implements configuration changes. Please visit README for more information.
14
-
15
- }
16
-
17
12
  s.rubyforge_project = "blacklight"
18
13
 
19
14
  s.files = `git ls-files`.split("\n")
@@ -21,15 +16,14 @@ BlacklightOaiProvider v5.x implements configuration changes. Please visit README
21
16
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
22
17
  s.require_paths = ["lib"]
23
18
 
24
- s.add_dependency "rails", "~> 4.0"
25
- s.add_dependency "blacklight", "~> 5.0"
26
- s.add_dependency "oai", "~> 0.4"
27
- s.add_development_dependency 'rspec-rails', "~> 3.0"
19
+ s.add_dependency "blacklight", "~> 6.0"
20
+ s.add_dependency "oai", "~> 1.0"
21
+ s.add_development_dependency 'rspec-rails'
28
22
  s.add_development_dependency 'capybara'
29
23
  s.add_development_dependency 'solr_wrapper'
30
24
  s.add_development_dependency 'engine_cart'
31
- s.add_development_dependency "chromedriver-helper"
32
- s.add_development_dependency "selenium-webdriver"
25
+ s.add_development_dependency 'webdrivers', '~> 3.0'
26
+ s.add_development_dependency 'selenium-webdriver', '>= 3.13.1'
33
27
  s.add_development_dependency 'byebug'
34
28
  s.add_development_dependency 'rubocop', '~> 0.50.0'
35
29
  s.add_development_dependency "rubocop-rspec", '~> 1.18.0'
@@ -12,20 +12,6 @@ module BlacklightOaiProvider
12
12
  require 'blacklight_oai_provider/version'
13
13
  require 'blacklight_oai_provider/engine'
14
14
 
15
- @omit_inject = {}
16
- def self.omit_inject=(value)
17
- value = Hash.new(true) if value == true
18
- @omit_inject = value
19
- end
20
-
21
- def self.omit_inject
22
- @omit_inject
23
- end
24
-
25
- def self.inject!
26
- Blacklight::Routes.send(:include, BlacklightOaiProvider::Routes) unless BlacklightOaiProvider.omit_inject[:routes]
27
- end
28
-
29
15
  # Add element to array only if it's not already there
30
16
  def self.safe_arr_add(array, element)
31
17
  array << element unless array.include?(element)
@@ -4,15 +4,6 @@ require 'rails'
4
4
 
5
5
  module BlacklightOaiProvider
6
6
  class Engine < Rails::Engine
7
- # Do these things in a to_prepare block, to try and make them work
8
- # in development mode with class-reloading. The trick is we can't
9
- # be sure if the controllers we're modifying are being reloaded in
10
- # dev mode, if they are in the BL plugin and haven't been copied to
11
- # local, they won't be. But we do our best.
12
- config.to_prepare do
13
- BlacklightOaiProvider.inject!
14
- end
15
-
16
7
  # Add XSL Stylesheet to list of assets to be precompiled.
17
8
  initializer "blacklight_oai_provider.assets.precompile" do |app|
18
9
  app.config.assets.precompile += %w[blacklight_oai_provider/oai2.xsl]
@@ -1,15 +1,11 @@
1
1
  module BlacklightOaiProvider
2
- module Routes
3
- extend ActiveSupport::Concern
4
-
5
- included do |klass|
6
- klass.default_route_sets.insert(klass.default_route_sets.index(:export), :oai_routing)
2
+ class Routes
3
+ def initialize(defaults = {})
4
+ @defaults = defaults
7
5
  end
8
6
 
9
- def oai_routing(primary_resource)
10
- add_routes do
11
- get "#{primary_resource}/oai", to: "#{primary_resource}#oai", as: 'oai_provider'
12
- end
7
+ def call(mapper, _options = {})
8
+ mapper.match 'oai', action: 'oai', via: [:get, :post]
13
9
  end
14
10
  end
15
11
  end
@@ -8,10 +8,11 @@ module BlacklightOaiProvider
8
8
 
9
9
  self.class.model = SolrDocumentWrapper.new(controller, options[:document])
10
10
 
11
- options[:repository_name] ||= controller.view_context.send(:application_name)
12
- options[:repository_url] ||= controller.view_context.send(:oai_provider_url)
11
+ options[:provider][:repository_name] ||= controller.view_context.application_name
12
+ options[:provider][:repository_url] ||= controller.view_context.oai_catalog_url
13
13
 
14
14
  options[:provider].each do |k, v|
15
+ v = v.call(controller) if v.is_a?(Proc)
15
16
  self.class.send k, v
16
17
  end
17
18
  end
@@ -4,7 +4,7 @@ module BlacklightOaiProvider
4
4
 
5
5
  def initialize(controller, options = {})
6
6
  @controller = controller
7
- @document_model = options[:model] || ::SolrDocument
7
+ @document_model = @controller.blacklight_config.document_model
8
8
  @solr_timestamp = document_model.timestamp_key
9
9
  @timestamp_field = 'timestamp' # method name used by ruby-oai
10
10
  @limit = options[:limit] || 15
@@ -19,32 +19,34 @@ module BlacklightOaiProvider
19
19
  end
20
20
 
21
21
  def earliest
22
- _response, records = @controller.get_search_results(@controller.params, { fl: solr_timestamp, sort: "#{solr_timestamp} asc", rows: 1 })
23
- records.first.timestamp
22
+ builder = @controller.search_builder.merge(fl: solr_timestamp, sort: "#{solr_timestamp} asc", rows: 1)
23
+ response = @controller.repository.search(builder)
24
+ response.documents.first.timestamp
24
25
  end
25
26
 
26
27
  def latest
27
- _response, records = @controller.get_search_results(@controller.params, { fl: solr_timestamp, sort: "#{solr_timestamp} desc", rows: 1 })
28
- records.first.timestamp
28
+ builder = @controller.search_builder.merge(fl: solr_timestamp, sort: "#{solr_timestamp} desc", rows: 1)
29
+ response = @controller.repository.search(builder)
30
+ response.documents.first.timestamp
29
31
  end
30
32
 
31
33
  def find(selector, options = {})
32
34
  return next_set(options[:resumption_token]) if options[:resumption_token]
33
35
 
34
36
  if selector == :all
35
- response, records = @controller.get_search_results(@controller.params, conditions(options))
37
+ response = @controller.repository.search(conditions(options))
36
38
 
37
39
  if limit && response.total > limit
38
40
  return select_partial(BlacklightOaiProvider::ResumptionToken.new(options.merge(last: 0), nil, response.total))
39
41
  end
42
+ response.documents
40
43
  else
41
- _response, records = @controller.get_solr_response_for_doc_id selector.split('/', 2).last
44
+ @controller.fetch(selector).first.documents.first
42
45
  end
43
- records
44
46
  end
45
47
 
46
48
  def select_partial(token)
47
- _response, records = @controller.get_search_results(@controller.params, token_conditions(token))
49
+ records = @controller.repository.search(token_conditions(token)).documents
48
50
 
49
51
  raise ::OAI::ResumptionTokenException unless records
50
52
 
@@ -60,23 +62,21 @@ module BlacklightOaiProvider
60
62
 
61
63
  private
62
64
 
63
- def base_conditions
64
- { sort: "#{solr_timestamp} asc", rows: limit }
65
- end
66
-
67
65
  def token_conditions(token)
68
66
  conditions(token.to_conditions_hash).merge(start: token.last)
69
67
  end
70
68
 
71
69
  def conditions(options) # conditions/query derived from options
72
- filters = []
70
+ query = @controller.search_builder.merge(sort: "#{solr_timestamp} asc", rows: limit).query
71
+
73
72
  if options[:from].present? || options[:until].present?
74
- filters << "#{solr_timestamp}:[#{solr_date(options[:from])} TO #{solr_date(options[:until]).gsub('Z', '.999Z')}]"
73
+ query.append_filter_query(
74
+ "#{solr_timestamp}:[#{solr_date(options[:from])} TO #{solr_date(options[:until]).gsub('Z', '.999Z')}]"
75
+ )
75
76
  end
76
77
 
77
- filters << @set.from_spec(options[:set]) if options[:set].present?
78
-
79
- base_conditions.merge(fq: filters)
78
+ query.append_filter_query(@set.from_spec(options[:set])) if options[:set].present?
79
+ query
80
80
  end
81
81
 
82
82
  def solr_date(time)
@@ -7,7 +7,10 @@ module BlacklightOaiProvider
7
7
 
8
8
  params = { rows: 0, facet: true, 'facet.field' => solr_fields }
9
9
  solr_fields.each { |field| params["f.#{field}.facet.limit"] = -1 } # override any potential blacklight limits
10
- response, _records = @controller.get_search_results(@controller.params, params)
10
+
11
+ builder = @controller.search_builder.merge(params)
12
+ response = @controller.repository.search(builder)
13
+
11
14
  sets_from_facets(response.facet_fields) if response.facet_fields
12
15
  end
13
16
 
@@ -19,8 +22,7 @@ module BlacklightOaiProvider
19
22
  # Returns array of sets for a solr document, or empty array if none are available.
20
23
  def sets_for(record)
21
24
  Array.wrap(@fields).map do |field|
22
- values = record.get(field[:solr_field], sep: nil)
23
- Array.wrap(values).map do |value|
25
+ record.fetch(field[:solr_field], []).map do |value|
24
26
  new("#{field[:label]}:#{value}")
25
27
  end
26
28
  end.flatten
@@ -23,5 +23,17 @@ module BlacklightOaiProvider
23
23
  end
24
24
  end
25
25
  end
26
+
27
+ def inject_blacklight_oai_routes
28
+ file_path = File.join('config', 'routes.rb')
29
+
30
+ inject_into_file file_path, after: 'Rails.application.routes.draw do' do
31
+ "\n concern :oai_provider, BlacklightOaiProvider::Routes.new\n"
32
+ end
33
+
34
+ inject_into_file file_path, after: /resource :catalog,+(.*)do$/ do
35
+ "\n concerns :oai_provider\n"
36
+ end
37
+ end
26
38
  end
27
39
  end
@@ -6,7 +6,7 @@ namespace :blacklight_oai_provider do
6
6
  require 'yaml'
7
7
 
8
8
  docs = YAML.safe_load(File.open(File.join(BlacklightOaiProvider.root, 'solr', 'sample_solr_documents.yml')))
9
- conn = RSolr.connect(Blacklight.solr_config)
9
+ conn = Blacklight.default_index.connection
10
10
  conn.add docs
11
11
  conn.commit
12
12
  end
@@ -1,306 +1,348 @@
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
- -->
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <schema name="Hydra" version="1.5">
3
+ <!-- NOTE: various comments and unused configuration possibilities have been purged
4
+ from this file. Please refer to http://wiki.apache.org/solr/SchemaXml,
5
+ as well as the default schema file included with Solr -->
59
6
 
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
- -->
7
+ <uniqueKey>id</uniqueKey>
68
8
 
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
- -->
9
+ <fields>
10
+ <field name="id" type="string" stored="true" indexed="true" multiValued="false" required="true"/>
11
+ <field name="format" type="string" stored="true" indexed="true" multiValued="true" />
12
+ <field name="_version_" type="long" indexed="true" stored="true"/>
13
+ <field name="timestamp" type="date" indexed="true" stored="true" default="NOW" multiValued="false"/>
92
14
 
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.
15
+ <field name="lat" type="tdouble" stored="true" indexed="true" multiValued="false"/>
16
+ <field name="lng" type="tdouble" stored="true" indexed="true" multiValued="false"/>
17
+ <!-- NOTE: not all possible Solr field types are represented in the dynamic fields -->
18
+
19
+ <!-- text (_t...) -->
20
+
21
+ <dynamicField name="*_ti" type="text" stored="false" indexed="true" multiValued="false"/>
22
+ <dynamicField name="*_tim" type="text" stored="false" indexed="true" multiValued="true"/>
23
+
24
+ <dynamicField name="*_ts" type="text" stored="true" indexed="false" multiValued="false"/>
25
+ <dynamicField name="*_tsm" type="text" stored="true" indexed="false" multiValued="true"/>
26
+ <dynamicField name="*_tsi" type="text" stored="true" indexed="true" multiValued="false"/>
27
+ <dynamicField name="*_tsim" type="text" stored="true" indexed="true" multiValued="true"/>
28
+
29
+ <dynamicField name="*_tiv" type="text" stored="false" indexed="true" multiValued="false" termVectors="true" termPositions="true" termOffsets="true"/>
30
+ <dynamicField name="*_timv" type="text" stored="false" indexed="true" multiValued="true" termVectors="true" termPositions="true" termOffsets="true"/>
31
+
32
+ <dynamicField name="*_tsiv" type="text" stored="true" indexed="true" multiValued="false" termVectors="true" termPositions="true" termOffsets="true"/>
33
+ <dynamicField name="*_tsimv" type="text" stored="true" indexed="true" multiValued="true" termVectors="true" termPositions="true" termOffsets="true"/>
34
+
35
+ <!-- English text (_te...) -->
36
+
37
+ <dynamicField name="*_tei" type="text_en" stored="false" indexed="true" multiValued="false"/>
38
+ <dynamicField name="*_teim" type="text_en" stored="false" indexed="true" multiValued="true"/>
39
+
40
+ <dynamicField name="*_tes" type="text_en" stored="true" indexed="false" multiValued="false"/>
41
+ <dynamicField name="*_tesm" type="text_en" stored="true" indexed="false" multiValued="true"/>
42
+ <dynamicField name="*_tesi" type="text_en" stored="true" indexed="true" multiValued="false"/>
43
+ <dynamicField name="*_tesim" type="text_en" stored="true" indexed="true" multiValued="true"/>
44
+
45
+ <dynamicField name="*_teiv" type="text_en" stored="false" indexed="true" multiValued="false" termVectors="true" termPositions="true" termOffsets="true"/>
46
+ <dynamicField name="*_teimv" type="text_en" stored="false" indexed="true" multiValued="true" termVectors="true" termPositions="true" termOffsets="true"/>
47
+
48
+ <dynamicField name="*_tesiv" type="text_en" stored="true" indexed="true" multiValued="false" termVectors="true" termPositions="true" termOffsets="true"/>
49
+ <dynamicField name="*_tesimv" type="text_en" stored="true" indexed="true" multiValued="true" termVectors="true" termPositions="true" termOffsets="true"/>
50
+
51
+ <!-- string (_s...) -->
52
+
53
+ <dynamicField name="*_si" type="string" stored="false" indexed="true" multiValued="false"/>
54
+ <dynamicField name="*_sim" type="string" stored="false" indexed="true" multiValued="true"/>
55
+
56
+ <dynamicField name="*_ss" type="string" stored="true" indexed="false" multiValued="false"/>
57
+ <dynamicField name="*_ssm" type="string" stored="true" indexed="false" multiValued="true"/>
58
+ <dynamicField name="*_ssi" type="string" stored="true" indexed="true" multiValued="false"/>
59
+ <dynamicField name="*_ssim" type="string" stored="true" indexed="true" multiValued="true"/>
60
+
61
+ <dynamicField name="*_ssort" type="alphaSort" stored="false" indexed="true" multiValued="false"/>
62
+
63
+
64
+ <!-- integer (_i...) -->
65
+
66
+ <dynamicField name="*_ii" type="int" stored="false" indexed="true" multiValued="false"/>
67
+ <dynamicField name="*_iim" type="int" stored="false" indexed="true" multiValued="true"/>
68
+
69
+ <dynamicField name="*_is" type="int" stored="true" indexed="false" multiValued="false"/>
70
+ <dynamicField name="*_ism" type="int" stored="true" indexed="false" multiValued="true"/>
71
+ <dynamicField name="*_isi" type="int" stored="true" indexed="true" multiValued="false"/>
72
+ <dynamicField name="*_isim" type="int" stored="true" indexed="true" multiValued="true"/>
73
+
74
+ <!-- IntegerPointField (_it...) (for faster range queries) -->
75
+
76
+ <dynamicField name="*_iti" type="tint" stored="false" indexed="true" multiValued="false"/>
77
+ <dynamicField name="*_itim" type="tint" stored="false" indexed="true" multiValued="true"/>
78
+
79
+ <dynamicField name="*_its" type="tint" stored="true" indexed="false" multiValued="false"/>
80
+ <dynamicField name="*_itsm" type="tint" stored="true" indexed="false" multiValued="true"/>
81
+ <dynamicField name="*_itsi" type="tint" stored="true" indexed="true" multiValued="false"/>
82
+ <dynamicField name="*_itsim" type="tint" stored="true" indexed="true" multiValued="true"/>
83
+
84
+ <!-- date (_dt...) -->
85
+ <!-- The format for this date field is of the form 1995-12-31T23:59:59Z
86
+ Optional fractional seconds are allowed: 1995-12-31T23:59:59.999Z -->
87
+
88
+ <dynamicField name="*_dti" type="date" stored="false" indexed="true" multiValued="false"/>
89
+ <dynamicField name="*_dtim" type="date" stored="false" indexed="true" multiValued="true"/>
90
+
91
+ <dynamicField name="*_dts" type="date" stored="true" indexed="false" multiValued="false"/>
92
+ <dynamicField name="*_dtsm" type="date" stored="true" indexed="false" multiValued="true"/>
93
+ <dynamicField name="*_dtsi" type="date" stored="true" indexed="true" multiValued="false"/>
94
+ <dynamicField name="*_dtsim" type="date" stored="true" indexed="true" multiValued="true"/>
95
+
96
+ <!-- DatePointField (_dtt...) (for faster range queries) -->
97
+
98
+ <dynamicField name="*_dtti" type="tdate" stored="false" indexed="true" multiValued="false"/>
99
+ <dynamicField name="*_dttim" type="tdate" stored="false" indexed="true" multiValued="true"/>
100
+
101
+ <dynamicField name="*_dtts" type="tdate" stored="true" indexed="false" multiValued="false"/>
102
+ <dynamicField name="*_dttsm" type="tdate" stored="true" indexed="false" multiValued="true"/>
103
+ <dynamicField name="*_dttsi" type="tdate" stored="true" indexed="true" multiValued="false"/>
104
+ <dynamicField name="*_dttsim" type="tdate" stored="true" indexed="true" multiValued="true"/>
105
+
106
+ <!-- long (_l...) -->
107
+
108
+ <dynamicField name="*_li" type="long" stored="false" indexed="true" multiValued="false"/>
109
+ <dynamicField name="*_lim" type="long" stored="false" indexed="true" multiValued="true"/>
110
+
111
+ <dynamicField name="*_ls" type="long" stored="true" indexed="false" multiValued="false"/>
112
+ <dynamicField name="*_lsm" type="long" stored="true" indexed="false" multiValued="true"/>
113
+ <dynamicField name="*_lsi" type="long" stored="true" indexed="true" multiValued="false"/>
114
+ <dynamicField name="*_lsim" type="long" stored="true" indexed="true" multiValued="true"/>
115
+
116
+ <!-- LongPointField (_lt...) (for faster range queries) -->
117
+
118
+ <dynamicField name="*_lti" type="tlong" stored="false" indexed="true" multiValued="false"/>
119
+ <dynamicField name="*_ltim" type="tlong" stored="false" indexed="true" multiValued="true"/>
120
+
121
+ <dynamicField name="*_lts" type="tlong" stored="true" indexed="false" multiValued="false"/>
122
+ <dynamicField name="*_ltsm" type="tlong" stored="true" indexed="false" multiValued="true"/>
123
+ <dynamicField name="*_ltsi" type="tlong" stored="true" indexed="true" multiValued="false"/>
124
+ <dynamicField name="*_ltsim" type="tlong" stored="true" indexed="true" multiValued="true"/>
125
+
126
+ <!-- double (_db...) -->
127
+
128
+ <dynamicField name="*_dbi" type="double" stored="false" indexed="true" multiValued="false"/>
129
+ <dynamicField name="*_dbim" type="double" stored="false" indexed="true" multiValued="true"/>
130
+
131
+ <dynamicField name="*_dbs" type="double" stored="true" indexed="false" multiValued="false"/>
132
+ <dynamicField name="*_dbsm" type="double" stored="true" indexed="false" multiValued="true"/>
133
+ <dynamicField name="*_dbsi" type="double" stored="true" indexed="true" multiValued="false"/>
134
+ <dynamicField name="*_dbsim" type="double" stored="true" indexed="true" multiValued="true"/>
135
+
136
+ <!-- DoublePointField (_dbt...) (for faster range queries) -->
137
+
138
+ <dynamicField name="*_dbti" type="tdouble" stored="false" indexed="true" multiValued="false"/>
139
+ <dynamicField name="*_dbtim" type="tdouble" stored="false" indexed="true" multiValued="true"/>
140
+
141
+ <dynamicField name="*_dbts" type="tdouble" stored="true" indexed="false" multiValued="false"/>
142
+ <dynamicField name="*_dbtsm" type="tdouble" stored="true" indexed="false" multiValued="true"/>
143
+ <dynamicField name="*_dbtsi" type="tdouble" stored="true" indexed="true" multiValued="false"/>
144
+ <dynamicField name="*_dbtsim" type="tdouble" stored="true" indexed="true" multiValued="true"/>
145
+
146
+ <!-- float (_f...) -->
122
147
 
123
- Expressions can also be used to denote calculations that should be
124
- performed relative to "NOW" to determine the value, ie...
148
+ <dynamicField name="*_fi" type="float" stored="false" indexed="true" multiValued="false"/>
149
+ <dynamicField name="*_fim" type="float" stored="false" indexed="true" multiValued="true"/>
125
150
 
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
151
+ <dynamicField name="*_fs" type="float" stored="true" indexed="false" multiValued="false"/>
152
+ <dynamicField name="*_fsm" type="float" stored="true" indexed="false" multiValued="true"/>
153
+ <dynamicField name="*_fsi" type="float" stored="true" indexed="true" multiValued="false"/>
154
+ <dynamicField name="*_fsim" type="float" stored="true" indexed="true" multiValued="true"/>
133
155
 
134
- Consult the DateField javadocs for more information.
156
+ <!-- FloatPointField (_ft...) (for faster range queries) -->
135
157
 
136
- Note: For faster range queries, consider the tdate type
158
+ <dynamicField name="*_fti" type="tfloat" stored="false" indexed="true" multiValued="false"/>
159
+ <dynamicField name="*_ftim" type="tfloat" stored="false" indexed="true" multiValued="true"/>
160
+
161
+ <dynamicField name="*_fts" type="tfloat" stored="true" indexed="false" multiValued="false"/>
162
+ <dynamicField name="*_ftsm" type="tfloat" stored="true" indexed="false" multiValued="true"/>
163
+ <dynamicField name="*_ftsi" type="tfloat" stored="true" indexed="true" multiValued="false"/>
164
+ <dynamicField name="*_ftsim" type="tfloat" stored="true" indexed="true" multiValued="true"/>
165
+
166
+ <!-- boolean (_b...) -->
167
+
168
+ <dynamicField name="*_bi" type="boolean" stored="false" indexed="true" multiValued="false"/>
169
+
170
+ <dynamicField name="*_bs" type="boolean" stored="true" indexed="false" multiValued="false"/>
171
+ <dynamicField name="*_bsi" type="boolean" stored="true" indexed="true" multiValued="false"/>
172
+
173
+ <!-- Type used to index the lat and lon components for the "location" FieldType -->
174
+
175
+ <dynamicField name="*_coordinate" type="tdouble" indexed="true" stored="false" />
176
+
177
+
178
+ <!-- location (_ll...) -->
179
+
180
+ <dynamicField name="*_lli" type="location" stored="false" indexed="true" multiValued="false"/>
181
+ <dynamicField name="*_llim" type="location" stored="false" indexed="true" multiValued="true"/>
182
+
183
+ <dynamicField name="*_lls" type="location" stored="true" indexed="false" multiValued="false"/>
184
+ <dynamicField name="*_llsm" type="location" stored="true" indexed="false" multiValued="true"/>
185
+ <dynamicField name="*_llsi" type="location" stored="true" indexed="true" multiValued="false"/>
186
+ <dynamicField name="*_llsim" type="location" stored="true" indexed="true" multiValued="true"/>
187
+
188
+ <dynamicField name="*_srpt" type="location_rpt" stored="true" indexed="true" multiValued="true" />
189
+ <dynamicField name="*_bbox" type="bbox" stored="true" indexed="true" />
190
+
191
+
192
+ <!-- suggest and spelling -->
193
+ <dynamicField name="*spell" type="textSpell" indexed="true" stored="false" multiValued="true" />
194
+ <dynamicField name="*suggest" type="textSuggest" indexed="true" stored="false" multiValued="true" />
195
+
196
+ <!-- you must define copyField source and dest fields explicity or schemaBrowser doesn't work -->
197
+ <field name="all_text_timv" type="text" stored="false" indexed="true" multiValued="true" termVectors="true" termPositions="true" termOffsets="true"/>
198
+
199
+
200
+ </fields>
201
+
202
+
203
+ <!-- Above, multiple source fields are copied to the [text] field.
204
+ Another way to map multiple source fields to the same
205
+ destination field is to use the dynamic field syntax.
206
+ copyField also supports a maxChars to copy setting. -->
207
+
208
+ <copyField source="*_tsim" dest="all_text_timv" maxChars="3000"/>
209
+ <copyField source="*_tesim" dest="all_text_timv" maxChars="3000"/>
210
+ <copyField source="*_ssim" dest="all_text_timv" maxChars="3000"/>
211
+ <copyField source="*_si" dest="all_text_timv" maxChars="3000"/>
212
+
213
+ <copyField source="*_tsim" dest="suggest"/>
214
+ <copyField source="*_tesim" dest="suggest"/>
215
+ <copyField source="*_ssim" dest="suggest"/>
216
+ <copyField source="*_si" dest="suggest"/>
217
+
218
+ <!-- TODO: Look into if these are actually being used. -->
219
+ <copyField source="*_tsim" dest="spell"/>
220
+ <copyField source="*_tesim" dest="spell"/>
221
+ <copyField source="*_ssim" dest="spell"/>
222
+ <copyField source="*_si" dest="spell"/>
223
+
224
+ <copyField source="author_tsim" dest="author_spell"/>
225
+ <copyField source="subject_ssim" dest="subject_spell"/>
226
+ <copyField source="title_tsim" dest="title_spell"/>
227
+
228
+ <types>
229
+ <fieldType name="string" class="solr.StrField" sortMissingLast="true" />
230
+ <fieldType name="boolean" class="solr.BoolField" sortMissingLast="true"/>
231
+ <fieldType name="rand" class="solr.RandomSortField" omitNorms="true"/>
232
+
233
+ <!-- Default numeric field types. -->
234
+ <fieldType name="int" class="solr.IntPointField" docValues="true"/>
235
+ <fieldType name="float" class="solr.FloatPointField" docValues="true"/>
236
+ <fieldType name="long" class="solr.LongPointField" docValues="true"/>
237
+ <fieldType name="double" class="solr.DoublePointField" docValues="true"/>
238
+
239
+ <!-- PointField numeric field types for faster range queries -->
240
+ <fieldType name="tint" class="solr.IntPointField" docValues="true"/>
241
+ <fieldType name="tfloat" class="solr.FloatPointField" docValues="true"/>
242
+ <fieldType name="tlong" class="solr.LongPointField" docValues="true"/>
243
+ <fieldType name="tdouble" class="solr.DoublePointField" docValues="true"/>
244
+
245
+ <!-- The format for this date field is of the form 1995-12-31T23:59:59Z
246
+ Optional fractional seconds are allowed: 1995-12-31T23:59:59.999Z
137
247
  -->
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
248
+ <fieldType name="date" class="solr.DatePointField" docValues="true"/>
249
+ <!-- A PointField based date field for faster date range queries and date faceting. -->
250
+ <fieldType name="tdate" class="solr.DatePointField" docValues="true"/>
251
+
252
+
253
+ <!-- This point type indexes the coordinates as separate fields (subFields)
254
+ If subFieldType is defined, it references a type, and a dynamic field
255
+ definition is created matching *___<typename>. Alternately, if
256
+ subFieldSuffix is defined, that is used to create the subFields.
257
+ Example: if subFieldType="double", then the coordinates would be
258
+ indexed in fields myloc_0___double,myloc_1___double.
259
+ Example: if subFieldSuffix="_d" then the coordinates would be indexed
260
+ in fields myloc_0_d,myloc_1_d
261
+ The subFields are an implementation detail of the fieldType, and end
262
+ users normally should not need to know about them.
153
263
  -->
154
- <fieldType name="random" class="solr.RandomSortField" indexed="true" />
264
+ <fieldType name="point" class="solr.PointType" dimension="2" subFieldSuffix="_d"/>
155
265
 
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.
266
+ <!-- A specialized field for geospatial search filters and distance sorting. -->
267
+ <fieldType name="location" class="solr.LatLonPointSpatialField" docValues="true"/>
159
268
 
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.
269
+ <!-- An alternative geospatial field type new to Solr 4. It supports multiValued and polygon shapes.
270
+ For more information about this and other Spatial fields new to Solr 4, see:
271
+ http://wiki.apache.org/solr/SolrAdaptersForLuceneSpatial4
272
+ -->
273
+ <fieldType name="location_rpt" class="solr.SpatialRecursivePrefixTreeFieldType"
274
+ geo="true" distErrPct="0.025" maxDistErr="0.001" distanceUnits="kilometers"/>
163
275
 
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>
276
+ <field name="bbox" type="bbox" />
277
+ <fieldType name="bbox" class="solr.BBoxField"
278
+ geo="true" distanceUnits="kilometers" numberType="_bbox_coord" storeSubFields="false"/>
279
+ <fieldType name="_bbox_coord" class="solr.DoublePointField" docValues="true" stored="false"/>
174
280
 
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"/>
281
+ <fieldType name="text" class="solr.TextField" omitNorms="false">
282
+ <analyzer>
283
+ <tokenizer class="solr.ICUTokenizerFactory"/>
284
+ <filter class="solr.ICUFoldingFilterFactory"/> <!-- NFKC, case folding, diacritics removed -->
285
+ <filter class="solr.TrimFilterFactory"/>
286
+ </analyzer>
179
287
  </fieldType>
180
- -->
181
288
 
182
289
  <!-- A text field that only splits on whitespace for exact matching of words -->
183
290
  <fieldType name="text_ws" class="solr.TextField" positionIncrementGap="100">
184
291
  <analyzer>
185
292
  <tokenizer class="solr.WhitespaceTokenizerFactory"/>
293
+ <filter class="solr.TrimFilterFactory"/>
186
294
  </analyzer>
187
295
  </fieldType>
188
296
 
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"/>
297
+ <!-- single token analyzed text, for sorting. Punctuation is significant. -->
298
+ <fieldtype name="alphaSort" class="solr.TextField" sortMissingLast="true" omitNorms="true">
299
+ <analyzer>
300
+ <tokenizer class="solr.KeywordTokenizerFactory" />
301
+ <filter class="solr.ICUFoldingFilterFactory"/>
302
+ <filter class="solr.TrimFilterFactory" />
206
303
  </analyzer>
207
- </fieldType>
304
+ </fieldtype>
208
305
 
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. -->
306
+ <!-- A text field with defaults appropriate for English -->
214
307
  <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:
308
+ <analyzer>
309
+ <tokenizer class="solr.ICUTokenizerFactory"/>
310
+ <filter class="solr.ICUFoldingFilterFactory"/> <!-- NFKC, case folding, diacritics removed -->
311
+ <filter class="solr.EnglishPossessiveFilterFactory"/>
312
+ <!-- EnglishMinimalStemFilterFactory is less aggressive than PorterStemFilterFactory: -->
235
313
  <filter class="solr.EnglishMinimalStemFilterFactory"/>
236
- -->
314
+ <!--
237
315
  <filter class="solr.PorterStemFilterFactory"/>
316
+ -->
317
+ <filter class="solr.TrimFilterFactory"/>
238
318
  </analyzer>
239
319
  </fieldType>
240
320
 
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">
321
+ <!-- A text field with defaults appropriate for English an NGrams -->
322
+ <fieldType name="text_en_ng" class="solr.TextField" positionIncrementGap="100">
254
323
  <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"/>
324
+ <tokenizer class="solr.ICUTokenizerFactory"/>
325
+ <filter class="solr.ICUFoldingFilterFactory"/> <!-- NFKC, case folding, diacritics removed -->
326
+ <filter class="solr.EnglishPossessiveFilterFactory"/>
327
+ <!-- EnglishMinimalStemFilterFactory is less aggressive than PorterStemFilterFactory: -->
328
+ <filter class="solr.EnglishMinimalStemFilterFactory"/>
329
+ <filter class="solr.TrimFilterFactory"/>
330
+ <filter class="solr.EdgeNGramFilterFactory" minGramSize="3" maxGramSize="15" />
271
331
  </analyzer>
272
- </fieldType>
273
332
 
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"/>
333
+ <analyzer type="index">
334
+ <tokenizer class="solr.ICUTokenizerFactory"/>
335
+ <filter class="solr.ICUFoldingFilterFactory"/> <!-- NFKC, case folding, diacritics removed -->
336
+ <filter class="solr.EnglishPossessiveFilterFactory"/>
337
+ <!-- EnglishMinimalStemFilterFactory is less aggressive than PorterStemFilterFactory: -->
284
338
  <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"/>
339
+ <filter class="solr.TrimFilterFactory"/>
288
340
  </analyzer>
289
341
  </fieldType>
290
342
 
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"/>
343
+ <fieldType name="pid_text" class="solr.TextField" positionIncrementGap="100">
344
+ <analyzer>
345
+ <tokenizer class="solr.KeywordTokenizerFactory"/>
304
346
  </analyzer>
305
347
  </fieldType>
306
348
 
@@ -308,322 +350,39 @@
308
350
  <analyzer>
309
351
  <tokenizer class="solr.StandardTokenizerFactory"/>
310
352
  <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
311
- <filter class="solr.StandardFilterFactory"/>
312
353
  <filter class="solr.LowerCaseFilterFactory"/>
313
354
  <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
314
355
  </analyzer>
315
356
  </fieldType>
316
357
 
317
- <fieldType class="solr.TextField" name="textSuggest" positionIncrementGap="100">
358
+ <fieldType name="textSuggest" class="solr.TextField" positionIncrementGap="100">
318
359
  <analyzer>
319
360
  <tokenizer class="solr.KeywordTokenizerFactory"/>
320
- <filter class="solr.StandardFilterFactory"/>
321
361
  <filter class="solr.LowerCaseFilterFactory"/>
322
362
  <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
323
363
  </analyzer>
324
364
  </fieldType>
325
365
 
326
- <!-- charFilter + WhitespaceTokenizer -->
327
- <!--
328
- <fieldType name="text_char_norm" class="solr.TextField" positionIncrementGap="100" >
329
- <analyzer>
330
- <charFilter class="solr.MappingCharFilterFactory" mapping="mapping-ISOLatin1Accent.txt"/>
331
- <tokenizer class="solr.WhitespaceTokenizerFactory"/>
366
+ <!-- queries for paths match documents at that path, or in descendent paths -->
367
+ <fieldType name="descendent_path" class="solr.TextField">
368
+ <analyzer type="index">
369
+ <tokenizer class="solr.PathHierarchyTokenizerFactory" delimiter="/" />
332
370
  </analyzer>
333
- </fieldType>
334
- -->
335
-
336
- <!-- This is an example of using the KeywordTokenizer along
337
- With various TokenFilterFactories to produce a sortable field
338
- that does not include some properties of the source text
339
- -->
340
- <fieldType name="alphaOnlySort" class="solr.TextField" sortMissingLast="true" omitNorms="true">
341
- <analyzer>
342
- <!-- KeywordTokenizer does no actual tokenizing, so the entire
343
- input string is preserved as a single token
344
- -->
345
- <tokenizer class="solr.KeywordTokenizerFactory"/>
346
- <!-- The LowerCase TokenFilter does what you expect, which can be
347
- when you want your sorting to be case insensitive
348
- -->
349
- <filter class="solr.LowerCaseFilterFactory" />
350
- <!-- The TrimFilter removes any leading or trailing whitespace -->
351
- <filter class="solr.TrimFilterFactory" />
352
- <!-- The PatternReplaceFilter gives you the flexibility to use
353
- Java Regular expression to replace any sequence of characters
354
- matching a pattern with an arbitrary replacement string,
355
- which may include back references to portions of the original
356
- string matched by the pattern.
357
-
358
- See the Java Regular Expression documentation for more
359
- information on pattern and replacement string syntax.
360
-
361
- http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/package-summary.html
362
- -->
363
- <filter class="solr.PatternReplaceFilterFactory"
364
- pattern="([^a-z])" replacement="" replace="all"
365
- />
371
+ <analyzer type="query">
372
+ <tokenizer class="solr.KeywordTokenizerFactory" />
366
373
  </analyzer>
367
374
  </fieldType>
368
375
 
369
- <fieldtype name="phonetic" stored="false" indexed="true" class="solr.TextField" >
370
- <analyzer>
371
- <tokenizer class="solr.StandardTokenizerFactory"/>
372
- <filter class="solr.DoubleMetaphoneFilterFactory" inject="false"/>
373
- </analyzer>
374
- </fieldtype>
375
-
376
- <fieldtype name="payloads" stored="false" indexed="true" class="solr.TextField" >
377
- <analyzer>
378
- <tokenizer class="solr.WhitespaceTokenizerFactory"/>
379
- <!--
380
- The DelimitedPayloadTokenFilter can put payloads on tokens... for example,
381
- a token of "foo|1.4" would be indexed as "foo" with a payload of 1.4f
382
- Attributes of the DelimitedPayloadTokenFilterFactory :
383
- "delimiter" - a one character delimiter. Default is | (pipe)
384
- "encoder" - how to encode the following value into a playload
385
- float -> org.apache.lucene.analysis.payloads.FloatEncoder,
386
- integer -> o.a.l.a.p.IntegerEncoder
387
- identity -> o.a.l.a.p.IdentityEncoder
388
- Fully Qualified class name implementing PayloadEncoder, Encoder must have a no arg constructor.
389
- -->
390
- <filter class="solr.DelimitedPayloadTokenFilterFactory" encoder="float"/>
391
- </analyzer>
392
- </fieldtype>
393
-
394
- <!-- lowercases the entire field value, keeping it as a single token. -->
395
- <fieldType name="lowercase" class="solr.TextField" positionIncrementGap="100">
396
- <analyzer>
397
- <tokenizer class="solr.KeywordTokenizerFactory"/>
398
- <filter class="solr.LowerCaseFilterFactory" />
376
+ <!-- queries for paths match documents at that path, or in ancestor paths -->
377
+ <fieldType name="ancestor_path" class="solr.TextField">
378
+ <analyzer type="index">
379
+ <tokenizer class="solr.KeywordTokenizerFactory" />
399
380
  </analyzer>
400
- </fieldType>
401
-
402
- <fieldType name="text_path" class="solr.TextField" positionIncrementGap="100">
403
- <analyzer>
404
- <tokenizer class="solr.PathHierarchyTokenizerFactory"/>
381
+ <analyzer type="query">
382
+ <tokenizer class="solr.PathHierarchyTokenizerFactory" delimiter="/" />
405
383
  </analyzer>
406
384
  </fieldType>
407
385
 
408
- <!-- since fields of this type are by default not stored or indexed,
409
- any data added to them will be ignored outright. -->
410
- <fieldtype name="ignored" stored="false" indexed="false" multiValued="true" class="solr.StrField" />
411
-
412
- <!-- This point type indexes the coordinates as separate fields (subFields)
413
- If subFieldType is defined, it references a type, and a dynamic field
414
- definition is created matching *___<typename>. Alternately, if
415
- subFieldSuffix is defined, that is used to create the subFields.
416
- Example: if subFieldType="double", then the coordinates would be
417
- indexed in fields myloc_0___double,myloc_1___double.
418
- Example: if subFieldSuffix="_d" then the coordinates would be indexed
419
- in fields myloc_0_d,myloc_1_d
420
- The subFields are an implementation detail of the fieldType, and end
421
- users normally should not need to know about them.
422
- -->
423
- <fieldType name="point" class="solr.PointType" dimension="2" subFieldSuffix="_d"/>
424
-
425
- <!-- A specialized field for geospatial search. If indexed, this fieldType must not be multivalued. -->
426
- <fieldType name="location" class="solr.LatLonType" subFieldSuffix="_coordinate"/>
427
-
428
- <!--
429
- A Geohash is a compact representation of a latitude longitude pair in a single field.
430
- See http://wiki.apache.org/solr/SpatialSearch
431
- -->
432
- <fieldtype name="geohash" class="solr.GeoHashField"/>
433
- </types>
434
-
435
-
436
- <fields>
437
- <!-- Valid attributes for fields:
438
- name: mandatory - the name for the field
439
- type: mandatory - the name of a previously defined type from the
440
- <types> section
441
- indexed: true if this field should be indexed (searchable or sortable)
442
- stored: true if this field should be retrievable
443
- multiValued: true if this field may contain multiple values per document
444
- omitNorms: (expert) set to true to omit the norms associated with
445
- this field (this disables length normalization and index-time
446
- boosting for the field, and saves some memory). Only full-text
447
- fields or fields that need an index-time boost need norms.
448
- termVectors: [false] set to true to store the term vector for a
449
- given field.
450
- When using MoreLikeThis, fields used for similarity should be
451
- stored for best performance.
452
- termPositions: Store position information with the term vector.
453
- This will increase storage costs.
454
- termOffsets: Store offset information with the term vector. This
455
- will increase storage costs.
456
- default: a value that should be used if no value is specified
457
- when adding a document.
458
- -->
459
-
460
- <!-- NOTE: this is not a full list of fields in the index; dynamic fields are also used -->
461
- <field name="id" type="string" indexed="true" stored="true" required="true" />
462
- <field name="_version_" type="long" indexed="true" stored="true" multiValued="false" />
463
- <field name="timestamp" type="date" indexed="true" stored="true" default="NOW" multiValued="false"/>
464
- <!-- default, catch all search field -->
465
- <field name="text" type="text" indexed="true" stored="false" multiValued="true"/>
466
-
467
- <!-- these display fields are NOT multi-valued -->
468
- <field name="marc_display" type="string" indexed="false" stored="true" multiValued="false"/>
469
- <field name="title_display" type="string" indexed="false" stored="true" multiValued="false"/>
470
- <field name="title_vern_display" type="string" indexed="false" stored="true" multiValued="false"/>
471
- <field name="subtitle_display" type="string" indexed="false" stored="true" multiValued="false"/>
472
- <field name="subtitle_vern_display" type="string" indexed="false" stored="true" multiValued="false"/>
473
- <field name="author_display" type="string" indexed="false" stored="true" multiValued="false"/>
474
- <field name="author_vern_display" type="string" indexed="false" stored="true" multiValued="false"/>
475
-
476
- <!-- these fields are also used for display, so they must be stored -->
477
- <field name="isbn_t" type="text" indexed="true" stored="true" multiValued="true"/>
478
- <field name="language_facet" type="string" indexed="true" stored="true" multiValued="true" />
479
- <field name="subject_topic_facet" type="string" indexed="true" stored="true" multiValued="true" />
480
- <field name="subject_era_facet" type="string" indexed="true" stored="true" multiValued="true" />
481
- <field name="subject_geo_facet" type="string" indexed="true" stored="true" multiValued="true" />
482
- <!-- pub_date is used for facet and display so it must be indexed and stored -->
483
- <field name="pub_date" type="string" indexed="true" stored="true" multiValued="true"/>
484
- <!-- pub_date sort uses new trie-based int fields, which are recommended for any int and are displayable, sortable, and range-quer
485
- we use 'tint' for faster range-queries. -->
486
- <field name="pub_date_sort" type="tint" indexed="true" stored="true" multiValued="false"/>
487
-
488
- <!-- format is used for facet, display, and choosing which partial to use for the show view, so it must be stored and indexed -->
489
- <field name="format" type="string" indexed="true" stored="true"/>
490
-
491
-
492
-
493
- <!-- Dynamic field definitions. If a field name is not found, dynamicFields
494
- will be used if the name matches any of the patterns.
495
- RESTRICTION: the glob-like pattern in the name attribute must have
496
- a "*" only at the start or the end.
497
- EXAMPLE: name="*_i" will match any field ending in _i (like myid_i, z_i)
498
- Longer patterns will be matched first. if equal size patterns
499
- both match, the first appearing in the schema will be used. -->
500
- <dynamicField name="*_i" type="int" indexed="true" stored="true"/>
501
- <dynamicField name="*_s" type="string" indexed="true" stored="true"/>
502
- <dynamicField name="*_l" type="long" indexed="true" stored="true"/>
503
- <dynamicField name="*_t" type="text" indexed="true" stored="true" multiValued="true"/>
504
- <dynamicField name="*_txt" type="text_general" indexed="true" stored="true" multiValued="true"/>
505
- <dynamicField name="*_b" type="boolean" indexed="true" stored="true"/>
506
- <dynamicField name="*_f" type="float" indexed="true" stored="true"/>
507
- <dynamicField name="*_d" type="double" indexed="true" stored="true"/>
508
-
509
- <!-- Type used to index the lat and lon components for the "location" FieldType -->
510
- <dynamicField name="*_coordinate" type="tdouble" indexed="true" stored="false"/>
511
-
512
- <dynamicField name="*_dt" type="date" indexed="true" stored="true"/>
513
- <dynamicField name="*_p" type="location" indexed="true" stored="true"/>
514
-
515
- <!-- some trie-coded dynamic fields for faster range queries -->
516
- <dynamicField name="*_ti" type="tint" indexed="true" stored="true"/>
517
- <dynamicField name="*_tl" type="tlong" indexed="true" stored="true"/>
518
- <dynamicField name="*_tf" type="tfloat" indexed="true" stored="true"/>
519
- <dynamicField name="*_td" type="tdouble" indexed="true" stored="true"/>
520
- <dynamicField name="*_tdt" type="tdate" indexed="true" stored="true"/>
521
-
522
- <dynamicField name="ignored_*" type="ignored" multiValued="true"/>
523
- <dynamicField name="attr_*" type="text_general" indexed="true" stored="true" multiValued="true"/>
524
-
525
- <dynamicField name="random_*" type="random" />
526
-
527
- <dynamicField name="*_display" type="string" indexed="false" stored="true" multiValued="true" />
528
- <dynamicField name="*_facet" type="string" indexed="true" stored="false" multiValued="true" />
529
- <dynamicField name="*_sort" type="alphaOnlySort" indexed="true" stored="false" multiValued="false" />
530
- <dynamicField name="*_unstem_search" type="text_general" indexed="true" stored="false" multiValued="true" />
531
- <dynamicField name="*spell" type="textSpell" indexed="true" stored="false" multiValued="true" />
532
- <dynamicField name="*suggest" type="textSuggest" indexed="true" stored="false" multiValued="true" />
533
-
534
- <!-- uncomment the following to ignore any fields that don't already match an existing
535
- field name or dynamic field, rather than reporting them as an error.
536
- alternately, change the type="ignored" to some other type e.g. "text" if you want
537
- unknown fields indexed and/or stored by default -->
538
- <!--dynamicField name="*" type="ignored" multiValued="true" /-->
539
-
540
- </fields>
541
-
542
- <!-- Field to use to determine and enforce document uniqueness.
543
- Unless this field is marked with required="false", it will be a required field
544
- -->
545
- <uniqueKey>id</uniqueKey>
546
-
547
- <!-- copyField commands copy one field to another at the time a document
548
- is added to the index. It's used either to index the same field differently,
549
- or to add multiple fields to the same field for easier/faster searching. -->
550
- <!-- Copy Fields -->
551
-
552
- <!-- unstemmed fields -->
553
- <copyField source="title_t" dest="title_unstem_search"/>
554
- <copyField source="subtitle_t" dest="subtitle_unstem_search"/>
555
- <copyField source="title_addl_t" dest="title_addl_unstem_search"/>
556
- <copyField source="title_added_entry_t" dest="title_added_entry_unstem_search"/>
557
- <copyField source="title_series_t" dest="title_series_unstem_search"/>
558
- <copyField source="author_t" dest="author_unstem_search"/>
559
- <copyField source="author_addl_t" dest="author_addl_unstem_search"/>
560
- <copyField source="subject_t" dest="subject_unstem_search"/>
561
- <copyField source="subject_addl_t" dest="subject_addl_unstem_search"/>
562
- <copyField source="subject_topic_facet" dest="subject_topic_unstem_search"/>
563
-
564
- <!-- sort fields -->
565
- <copyField source="pub_date" dest="pub_date_sort"/>
566
-
567
-
568
- <!-- spellcheck fields -->
569
- <!-- default spell check; should match fields for default request handler -->
570
- <!-- it won't work with a copy of a copy field -->
571
- <copyField source="*_t" dest="spell"/>
572
- <copyField source="*_facet" dest="spell"/>
573
- <!-- title spell check; should match fields for title request handler -->
574
- <copyField source="title_t" dest="title_spell"/>
575
- <copyField source="subtitle_t" dest="title_spell"/>
576
- <copyField source="addl_titles_t" dest="title_spell"/>
577
- <copyField source="title_added_entry_t" dest="title_spell"/>
578
- <copyField source="title_series_t" dest="title_spell"/>
579
- <!-- author spell check; should match fields for author request handler -->
580
- <copyField source="author_t" dest="author_spell"/>
581
- <copyField source="author_addl_t" dest="author_spell"/>
582
- <!-- subject spell check; should match fields for subject request handler -->
583
- <copyField source="subject_topic_facet" dest="subject_spell"/>
584
- <copyField source="subject_t" dest="subject_spell"/>
585
- <copyField source="subject_addl_t" dest="subject_spell"/>
586
-
587
- <!-- OpenSearch query field should match request handler search fields -->
588
- <copyField source="title_t" dest="opensearch_display"/>
589
- <copyField source="subtitle_t" dest="opensearch_display"/>
590
- <copyField source="addl_titles_t" dest="opensearch_display"/>
591
- <copyField source="title_added_entry_t" dest="opensearch_display"/>
592
- <copyField source="title_series_t" dest="opensearch_display"/>
593
- <copyField source="author_t" dest="opensearch_display"/>
594
- <copyField source="author_addl_t" dest="opensearch_display"/>
595
- <copyField source="subject_topic_facet" dest="opensearch_display"/>
596
- <copyField source="subject_t" dest="opensearch_display"/>
597
- <copyField source="subject_addl_t" dest="opensearch_display"/>
598
-
599
- <!-- for suggestions -->
600
- <copyField source="*_t" dest="suggest"/>
601
- <copyField source="*_facet" dest="suggest"/>
602
-
603
- <!-- Above, multiple source fields are copied to the [text] field.
604
- Another way to map multiple source fields to the same
605
- destination field is to use the dynamic field syntax.
606
- copyField also supports a maxChars to copy setting. -->
607
-
608
- <!-- <copyField source="*_t" dest="text" maxChars="3000"/> -->
609
-
610
- <!-- copy name to alphaNameSort, a field designed for sorting by name -->
611
- <!-- <copyField source="name" dest="alphaNameSort"/> -->
612
-
613
-
614
- <!-- Similarity is the scoring routine for each document vs. a query.
615
- A custom similarity may be specified here, but the default is fine
616
- for most applications. -->
617
- <!-- <similarity class="org.apache.lucene.search.DefaultSimilarity"/> -->
618
- <!-- ... OR ...
619
- Specify a SimilarityFactory class name implementation
620
- allowing parameters to be used.
621
- -->
622
- <!--
623
- <similarity class="com.example.solr.CustomSimilarityFactory">
624
- <str name="paramkey">param value</str>
625
- </similarity>
626
- -->
627
-
386
+ </types>
628
387
 
629
388
  </schema>