blacklight-access_controls 0.6.2 → 0.7.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
@@ -27,7 +27,7 @@ describe Blacklight::AccessControls::Catalog do
27
27
  let(:user) { build(:user) }
28
28
 
29
29
  it 'allows access' do
30
- expect { subject }.to_not raise_error
30
+ expect { subject }.not_to raise_error
31
31
  end
32
32
 
33
33
  # So that you can override enforce_show_permissions
@@ -1,10 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class MyController # < ApplicationController
3
+ class MyController
4
4
  include Blacklight::AccessControls::Enforcement
5
5
  end
6
6
 
7
7
  describe Blacklight::AccessControls::Enforcement do
8
+ subject { controller }
9
+
8
10
  let(:controller) do
9
11
  c = MyController.new
10
12
  allow(c).to receive(:current_ability).and_return(ability)
@@ -13,18 +15,16 @@ describe Blacklight::AccessControls::Enforcement do
13
15
  let(:user) { User.new }
14
16
  let(:ability) { Ability.new(user) }
15
17
 
16
- subject { controller }
17
-
18
18
  describe '#discovery_permissions' do
19
19
  it 'has defaults' do
20
- expect(subject.discovery_permissions).to eq %w(discover read)
20
+ expect(subject.discovery_permissions).to eq %w[discover read]
21
21
  end
22
22
 
23
23
  it 'does getter/setter' do
24
- subject.discovery_permissions = %w(discover read frobnicate)
25
- expect(subject.discovery_permissions).to eq %w(discover read frobnicate)
24
+ subject.discovery_permissions = %w[discover read frobnicate]
25
+ expect(subject.discovery_permissions).to eq %w[discover read frobnicate]
26
26
  subject.discovery_permissions << 'zazzo'
27
- expect(subject.discovery_permissions).to eq %w(discover read frobnicate zazzo)
27
+ expect(subject.discovery_permissions).to eq %w[discover read frobnicate zazzo]
28
28
  end
29
29
  end
30
30
 
@@ -51,12 +51,12 @@ describe Blacklight::AccessControls::Enforcement do
51
51
  end
52
52
 
53
53
  it "Then I should not be treated as a member of the 'registered' group" do
54
- expect(fq_first).to_not match(/registered/)
54
+ expect(fq_first).not_to match(/registered/)
55
55
  end
56
56
  end
57
57
 
58
58
  context 'Given I am a registered user' do
59
- let(:groups) { %w(faculty africana-faculty) }
59
+ let(:groups) { %w[faculty africana-faculty] }
60
60
  let(:user) do
61
61
  create(:user).tap do |u|
62
62
  allow(u).to receive(:groups) { groups }
@@ -69,8 +69,8 @@ describe Blacklight::AccessControls::Enforcement do
69
69
  end
70
70
 
71
71
  it 'searches for my groups' do
72
- expect(fq_first).to match(%r{\{!terms f=discover_access_group_ssim\}public,faculty,africana-faculty,registered})
73
- expect(fq_first).to match(%r{\{!terms f=read_access_group_ssim\}public,faculty,africana-faculty,registered})
72
+ expect(fq_first).to match(/\{!terms f=discover_access_group_ssim\}public,faculty,africana-faculty,registered/)
73
+ expect(fq_first).to match(/\{!terms f=read_access_group_ssim\}public,faculty,africana-faculty,registered/)
74
74
  end
75
75
 
76
76
  it 'does not build empty clauses' do
@@ -100,8 +100,8 @@ describe Blacklight::AccessControls::Enforcement do
100
100
  let(:groups) { ['abc:123', 'cde:567'] }
101
101
 
102
102
  it 'does not escape colons' do
103
- expect(fq_first).to match(%r{\{!terms f=discover_access_group_ssim\}public,abc:123,cde:567,registered})
104
- expect(fq_first).to match(%r{\{!terms f=read_access_group_ssim\}public,abc:123,cde:567,registered})
103
+ expect(fq_first).to match(/\{!terms f=discover_access_group_ssim\}public,abc:123,cde:567,registered/)
104
+ expect(fq_first).to match(/\{!terms f=read_access_group_ssim\}public,abc:123,cde:567,registered/)
105
105
  end
106
106
  end
107
107
  end
@@ -110,7 +110,7 @@ describe Blacklight::AccessControls::Enforcement do
110
110
  describe '#apply_user_permissions' do
111
111
  describe 'when the user is a guest user (user key nil)' do
112
112
  it 'does not create filters' do
113
- expect(subject.send(:apply_user_permissions, %w(discover read))).to eq []
113
+ expect(subject.send(:apply_user_permissions, %w[discover read])).to eq []
114
114
  end
115
115
  end
116
116
 
@@ -118,7 +118,7 @@ describe Blacklight::AccessControls::Enforcement do
118
118
  let(:user) { User.new(email: '') }
119
119
 
120
120
  it 'does not create filters' do
121
- expect(subject.send(:apply_user_permissions, %w(discover read))).to eq []
121
+ expect(subject.send(:apply_user_permissions, %w[discover read])).to eq []
122
122
  end
123
123
  end
124
124
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight-access_controls
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.7.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
@@ -11,36 +11,36 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2017-03-28 00:00:00.000000000 Z
14
+ date: 2018-01-12 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
- name: cancancan
17
+ name: blacklight
18
18
  requirement: !ruby/object:Gem::Requirement
19
19
  requirements:
20
20
  - - "~>"
21
21
  - !ruby/object:Gem::Version
22
- version: '1.8'
22
+ version: '6.0'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - "~>"
28
28
  - !ruby/object:Gem::Version
29
- version: '1.8'
29
+ version: '6.0'
30
30
  - !ruby/object:Gem::Dependency
31
- name: blacklight
31
+ name: cancancan
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  requirements:
34
34
  - - "~>"
35
35
  - !ruby/object:Gem::Version
36
- version: '6.0'
36
+ version: '1.8'
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
41
  - - "~>"
42
42
  - !ruby/object:Gem::Version
43
- version: '6.0'
43
+ version: '1.8'
44
44
  - !ruby/object:Gem::Dependency
45
45
  name: deprecation
46
46
  requirement: !ruby/object:Gem::Requirement
@@ -56,91 +56,91 @@ dependencies:
56
56
  - !ruby/object:Gem::Version
57
57
  version: '1.0'
58
58
  - !ruby/object:Gem::Dependency
59
- name: rake
59
+ name: database_cleaner
60
60
  requirement: !ruby/object:Gem::Requirement
61
61
  requirements:
62
- - - "~>"
62
+ - - ">="
63
63
  - !ruby/object:Gem::Version
64
- version: '11.3'
64
+ version: '0'
65
65
  type: :development
66
66
  prerelease: false
67
67
  version_requirements: !ruby/object:Gem::Requirement
68
68
  requirements:
69
- - - "~>"
69
+ - - ">="
70
70
  - !ruby/object:Gem::Version
71
- version: '11.3'
71
+ version: '0'
72
72
  - !ruby/object:Gem::Dependency
73
- name: rspec
73
+ name: engine_cart
74
74
  requirement: !ruby/object:Gem::Requirement
75
75
  requirements:
76
76
  - - "~>"
77
77
  - !ruby/object:Gem::Version
78
- version: '3.1'
78
+ version: '1.0'
79
79
  type: :development
80
80
  prerelease: false
81
81
  version_requirements: !ruby/object:Gem::Requirement
82
82
  requirements:
83
83
  - - "~>"
84
84
  - !ruby/object:Gem::Version
85
- version: '3.1'
85
+ version: '1.0'
86
86
  - !ruby/object:Gem::Dependency
87
- name: engine_cart
87
+ name: factory_bot_rails
88
88
  requirement: !ruby/object:Gem::Requirement
89
89
  requirements:
90
90
  - - "~>"
91
91
  - !ruby/object:Gem::Version
92
- version: '1.0'
92
+ version: '4.8'
93
93
  type: :development
94
94
  prerelease: false
95
95
  version_requirements: !ruby/object:Gem::Requirement
96
96
  requirements:
97
97
  - - "~>"
98
98
  - !ruby/object:Gem::Version
99
- version: '1.0'
99
+ version: '4.8'
100
100
  - !ruby/object:Gem::Dependency
101
- name: solr_wrapper
101
+ name: rake
102
102
  requirement: !ruby/object:Gem::Requirement
103
103
  requirements:
104
- - - ">="
104
+ - - "~>"
105
105
  - !ruby/object:Gem::Version
106
- version: '0'
106
+ version: '12.3'
107
107
  type: :development
108
108
  prerelease: false
109
109
  version_requirements: !ruby/object:Gem::Requirement
110
110
  requirements:
111
- - - ">="
111
+ - - "~>"
112
112
  - !ruby/object:Gem::Version
113
- version: '0'
113
+ version: '12.3'
114
114
  - !ruby/object:Gem::Dependency
115
- name: factory_girl_rails
115
+ name: rspec
116
116
  requirement: !ruby/object:Gem::Requirement
117
117
  requirements:
118
118
  - - "~>"
119
119
  - !ruby/object:Gem::Version
120
- version: '4.0'
120
+ version: '3.1'
121
121
  type: :development
122
122
  prerelease: false
123
123
  version_requirements: !ruby/object:Gem::Requirement
124
124
  requirements:
125
125
  - - "~>"
126
126
  - !ruby/object:Gem::Version
127
- version: '4.0'
127
+ version: '3.1'
128
128
  - !ruby/object:Gem::Dependency
129
- name: database_cleaner
129
+ name: rubocop
130
130
  requirement: !ruby/object:Gem::Requirement
131
131
  requirements:
132
- - - ">="
132
+ - - "~>"
133
133
  - !ruby/object:Gem::Version
134
- version: '0'
134
+ version: 0.52.1
135
135
  type: :development
136
136
  prerelease: false
137
137
  version_requirements: !ruby/object:Gem::Requirement
138
138
  requirements:
139
- - - ">="
139
+ - - "~>"
140
140
  - !ruby/object:Gem::Version
141
- version: '0'
141
+ version: 0.52.1
142
142
  - !ruby/object:Gem::Dependency
143
- name: rubocop
143
+ name: rubocop-rspec
144
144
  requirement: !ruby/object:Gem::Requirement
145
145
  requirements:
146
146
  - - ">="
@@ -154,7 +154,7 @@ dependencies:
154
154
  - !ruby/object:Gem::Version
155
155
  version: '0'
156
156
  - !ruby/object:Gem::Dependency
157
- name: rubocop-rspec
157
+ name: solr_wrapper
158
158
  requirement: !ruby/object:Gem::Requirement
159
159
  requirements:
160
160
  - - ">="
@@ -193,6 +193,7 @@ files:
193
193
  - lib/blacklight/access_controls/enforcement.rb
194
194
  - lib/blacklight/access_controls/permissions_cache.rb
195
195
  - lib/blacklight/access_controls/permissions_query.rb
196
+ - lib/blacklight/access_controls/search_builder.rb
196
197
  - lib/blacklight/access_controls/user.rb
197
198
  - lib/generators/blacklight/ability.rb
198
199
  - lib/generators/blacklight/access_controls_generator.rb
@@ -250,11 +251,8 @@ files:
250
251
  - solr_conf/conf/mapping-FoldToASCII.txt
251
252
  - solr_conf/conf/mapping-ISOLatin1Accent.txt
252
253
  - solr_conf/conf/protwords.txt
253
- - solr_conf/conf/schema.blacklight.xml
254
254
  - solr_conf/conf/schema.xml
255
- - solr_conf/conf/schema.xml.orig
256
255
  - solr_conf/conf/solrconfig.adams.xml
257
- - solr_conf/conf/solrconfig.blacklight.xml
258
256
  - solr_conf/conf/solrconfig.old.xml
259
257
  - solr_conf/conf/solrconfig.xml
260
258
  - solr_conf/conf/solrconfig.xml.orig
@@ -273,6 +271,7 @@ files:
273
271
  - spec/test_app_templates/blacklight.yml
274
272
  - spec/test_app_templates/lib/generators/test_app_generator.rb
275
273
  - spec/unit/ability_spec.rb
274
+ - spec/unit/blacklight/access_controls/search_builder_spec.rb
276
275
  - spec/unit/catalog_spec.rb
277
276
  - spec/unit/config_spec.rb
278
277
  - spec/unit/enforcement_spec.rb
@@ -288,15 +287,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
288
287
  requirements:
289
288
  - - ">="
290
289
  - !ruby/object:Gem::Version
291
- version: 1.9.3
290
+ version: 2.1.0
292
291
  required_rubygems_version: !ruby/object:Gem::Requirement
293
292
  requirements:
294
- - - ">="
293
+ - - ">"
295
294
  - !ruby/object:Gem::Version
296
- version: '0'
295
+ version: 1.3.1
297
296
  requirements: []
298
297
  rubyforge_project:
299
- rubygems_version: 2.6.10
298
+ rubygems_version: 2.7.1
300
299
  signing_key:
301
300
  specification_version: 4
302
301
  summary: Access controls for blacklight-based applications
@@ -307,6 +306,7 @@ test_files:
307
306
  - spec/test_app_templates/blacklight.yml
308
307
  - spec/test_app_templates/lib/generators/test_app_generator.rb
309
308
  - spec/unit/ability_spec.rb
309
+ - spec/unit/blacklight/access_controls/search_builder_spec.rb
310
310
  - spec/unit/catalog_spec.rb
311
311
  - spec/unit/config_spec.rb
312
312
  - spec/unit/enforcement_spec.rb
@@ -1,724 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" ?>
2
- <!--
3
- Licensed to the Apache Software Foundation (ASF) under one or more
4
- contributor license agreements. See the NOTICE file distributed with
5
- this work for additional information regarding copyright ownership.
6
- The ASF licenses this file to You under the Apache License, Version 2.0
7
- (the "License"); you may not use this file except in compliance with
8
- the License. You may obtain a copy of the License at
9
-
10
- http://www.apache.org/licenses/LICENSE-2.0
11
-
12
- Unless required by applicable law or agreed to in writing, software
13
- distributed under the License is distributed on an "AS IS" BASIS,
14
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- See the License for the specific language governing permissions and
16
- limitations under the License.
17
- -->
18
-
19
- <!--
20
- This is the Solr schema file. This file should be named "schema.xml" and
21
- should be in the conf directory under the solr home
22
- (i.e. ./solr/conf/schema.xml by default)
23
- or located where the classloader for the Solr webapp can find it.
24
-
25
- This example schema is the recommended starting point for users.
26
- It should be kept correct and concise, usable out-of-the-box.
27
-
28
- For more information, on how to customize this file, please see
29
- http://wiki.apache.org/solr/SchemaXml
30
-
31
- PERFORMANCE NOTE: this schema includes many optional features and should not
32
- be used for benchmarking. To improve performance one could
33
- - set stored="false" for all fields possible (esp large fields) when you
34
- only need to search on the field but don't need to return the original
35
- value.
36
- - set indexed="false" if you don't need to search on the field, but only
37
- return the field as a result of searching on other indexed fields.
38
- - remove all unneeded copyField statements
39
- - for best index size and searching performance, set "index" to false
40
- for all general text fields, use copyField to copy them to the
41
- catchall "text" field, and use that for searching.
42
- - For maximum indexing performance, use the StreamingUpdateSolrServer
43
- java client.
44
- - Remember to run the JVM in server mode, and use a higher logging level
45
- that avoids logging every request
46
- -->
47
-
48
- <schema name="Blacklight Demo Index" version="1.5">
49
- <!-- attribute "name" is the name of this schema and is only used for display purposes.
50
- Applications should change this to reflect the nature of the search collection.
51
- version="1.4" is Solr's version number for the schema syntax and semantics. It should
52
- not normally be changed by applications.
53
- 1.0: multiValued attribute did not exist, all fields are multiValued by nature
54
- 1.1: multiValued attribute introduced, false by default
55
- 1.2: omitTermFreqAndPositions attribute introduced, true by default except for text fields.
56
- 1.3: removed optional field compress feature
57
- 1.4: default auto-phrase (QueryParser feature) to off
58
- -->
59
-
60
- <types>
61
- <!-- field type definitions. The "name" attribute is
62
- just a label to be used by field definitions. The "class"
63
- attribute and any other attributes determine the real
64
- behavior of the fieldType.
65
- Class names starting with "solr" refer to java classes in the
66
- org.apache.solr.analysis package.
67
- -->
68
-
69
- <!-- The StrField type is not analyzed, but indexed/stored verbatim. -->
70
- <fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/>
71
-
72
- <!-- boolean type: "true" or "false" -->
73
- <fieldType name="boolean" class="solr.BoolField" sortMissingLast="true" omitNorms="true"/>
74
- <!--Binary data type. The data should be sent/retrieved in as Base64 encoded Strings -->
75
- <fieldtype name="binary" class="solr.BinaryField"/>
76
-
77
- <!-- The optional sortMissingLast and sortMissingFirst attributes are
78
- currently supported on types that are sorted internally as strings
79
- and on numeric types.
80
- This includes "string","boolean", and, as of 3.5 (and 4.x),
81
- int, float, long, date, double, including the "Trie" variants.
82
- - If sortMissingLast="true", then a sort on this field will cause documents
83
- without the field to come after documents with the field,
84
- regardless of the requested sort order (asc or desc).
85
- - If sortMissingFirst="true", then a sort on this field will cause documents
86
- without the field to come before documents with the field,
87
- regardless of the requested sort order.
88
- - If sortMissingLast="false" and sortMissingFirst="false" (the default),
89
- then default lucene sorting will be used which places docs without the
90
- field first in an ascending sort and last in a descending sort.
91
- -->
92
-
93
- <!--
94
- Default numeric field types. For faster range queries, consider the tint/tfloat/tlong/tdouble types.
95
- -->
96
- <fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
97
- <fieldType name="float" class="solr.TrieFloatField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
98
- <fieldType name="long" class="solr.TrieLongField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
99
- <fieldType name="double" class="solr.TrieDoubleField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
100
-
101
- <!--
102
- Numeric field types that index each value at various levels of precision
103
- to accelerate range queries when the number of values between the range
104
- endpoints is large. See the javadoc for NumericRangeQuery for internal
105
- implementation details.
106
-
107
- Smaller precisionStep values (specified in bits) will lead to more tokens
108
- indexed per value, slightly larger index size, and faster range queries.
109
- A precisionStep of 0 disables indexing at different precision levels.
110
- -->
111
- <fieldType name="tint" class="solr.TrieIntField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
112
- <fieldType name="tfloat" class="solr.TrieFloatField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
113
- <fieldType name="tlong" class="solr.TrieLongField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
114
- <fieldType name="tdouble" class="solr.TrieDoubleField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
115
-
116
- <!-- The format for this date field is of the form 1995-12-31T23:59:59Z, and
117
- is a more restricted form of the canonical representation of dateTime
118
- http://www.w3.org/TR/xmlschema-2/#dateTime
119
- The trailing "Z" designates UTC time and is mandatory.
120
- Optional fractional seconds are allowed: 1995-12-31T23:59:59.999Z
121
- All other components are mandatory.
122
-
123
- Expressions can also be used to denote calculations that should be
124
- performed relative to "NOW" to determine the value, ie...
125
-
126
- NOW/HOUR
127
- ... Round to the start of the current hour
128
- NOW-1DAY
129
- ... Exactly 1 day prior to now
130
- NOW/DAY+6MONTHS+3DAYS
131
- ... 6 months and 3 days in the future from the start of
132
- the current day
133
-
134
- Consult the DateField javadocs for more information.
135
-
136
- Note: For faster range queries, consider the tdate type
137
- -->
138
- <fieldType name="date" class="solr.TrieDateField" omitNorms="true" precisionStep="0" positionIncrementGap="0"/>
139
-
140
- <!-- A Trie based date field for faster date range queries and date faceting. -->
141
- <fieldType name="tdate" class="solr.TrieDateField" omitNorms="true" precisionStep="6" positionIncrementGap="0"/>
142
-
143
- <!-- The "RandomSortField" is not used to store or search any
144
- data. You can declare fields of this type it in your schema
145
- to generate pseudo-random orderings of your docs for sorting
146
- purposes. The ordering is generated based on the field name
147
- and the version of the index, As long as the index version
148
- remains unchanged, and the same field name is reused,
149
- the ordering of the docs will be consistent.
150
- If you want different psuedo-random orderings of documents,
151
- for the same version of the index, use a dynamicField and
152
- change the name
153
- -->
154
- <fieldType name="random" class="solr.RandomSortField" indexed="true" />
155
-
156
- <!-- solr.TextField allows the specification of custom text analyzers
157
- specified as a tokenizer and a list of token filters. Different
158
- analyzers may be specified for indexing and querying.
159
-
160
- The optional positionIncrementGap puts space between multiple fields of
161
- this type on the same document, with the purpose of preventing false phrase
162
- matching across fields.
163
-
164
- For more info on customizing your analyzer chain, please see
165
- http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters
166
- -->
167
- <fieldType name="text" class="solr.TextField" positionIncrementGap="100">
168
- <analyzer>
169
- <tokenizer class="solr.StandardTokenizerFactory"/>
170
- <filter class="solr.ICUFoldingFilterFactory" />
171
- <filter class="solr.SnowballPorterFilterFactory" language="English" />
172
- </analyzer>
173
- </fieldType>
174
-
175
- <!-- One can also specify an existing Analyzer class that has a
176
- default constructor via the class attribute on the analyzer element
177
- <fieldType name="text_greek" class="solr.TextField">
178
- <analyzer class="org.apache.lucene.analysis.el.GreekAnalyzer"/>
179
- </fieldType>
180
- -->
181
-
182
- <!-- A text field that only splits on whitespace for exact matching of words -->
183
- <fieldType name="text_ws" class="solr.TextField" positionIncrementGap="100">
184
- <analyzer>
185
- <tokenizer class="solr.WhitespaceTokenizerFactory"/>
186
- </analyzer>
187
- </fieldType>
188
-
189
- <!-- A general text field that has reasonable, generic
190
- cross-language defaults: it tokenizes with StandardTokenizer,
191
- removes stop words from case-insensitive "stopwords.txt"
192
- (empty by default), and down cases. At query time only, it
193
- also applies synonyms. -->
194
- <fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
195
- <analyzer type="index">
196
- <tokenizer class="solr.StandardTokenizerFactory"/>
197
- <!-- in this example, we will only use synonyms at query time
198
- <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
199
- -->
200
- <filter class="solr.LowerCaseFilterFactory"/>
201
- </analyzer>
202
- <analyzer type="query">
203
- <tokenizer class="solr.StandardTokenizerFactory"/>
204
- <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
205
- <filter class="solr.LowerCaseFilterFactory"/>
206
- </analyzer>
207
- </fieldType>
208
-
209
- <!-- A text field with defaults appropriate for English: it
210
- tokenizes with StandardTokenizer, removes English stop words
211
- (stopwords_en.txt), down cases, protects words from protwords.txt, and
212
- finally applies Porter's stemming. The query time analyzer
213
- also applies synonyms from synonyms.txt. -->
214
- <fieldType name="text_en" class="solr.TextField" positionIncrementGap="100">
215
- <analyzer type="index">
216
- <tokenizer class="solr.StandardTokenizerFactory"/>
217
- <!-- in this example, we will only use synonyms at query time
218
- <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
219
- -->
220
- <filter class="solr.LowerCaseFilterFactory"/>
221
- <filter class="solr.EnglishPossessiveFilterFactory"/>
222
- <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
223
- <!-- Optionally you may want to use this less aggressive stemmer instead of PorterStemFilterFactory:
224
- <filter class="solr.EnglishMinimalStemFilterFactory"/>
225
- -->
226
- <filter class="solr.PorterStemFilterFactory"/>
227
- </analyzer>
228
- <analyzer type="query">
229
- <tokenizer class="solr.StandardTokenizerFactory"/>
230
- <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
231
- <filter class="solr.LowerCaseFilterFactory"/>
232
- <filter class="solr.EnglishPossessiveFilterFactory"/>
233
- <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
234
- <!-- Optionally you may want to use this less aggressive stemmer instead of PorterStemFilterFactory:
235
- <filter class="solr.EnglishMinimalStemFilterFactory"/>
236
- -->
237
- <filter class="solr.PorterStemFilterFactory"/>
238
- </analyzer>
239
- </fieldType>
240
-
241
- <!-- A text field with defaults appropriate for English, plus
242
- aggressive word-splitting and autophrase features enabled.
243
- This field is just like text_en, except it adds
244
- WordDelimiterFilter to enable splitting and matching of
245
- words on case-change, alpha numeric boundaries, and
246
- non-alphanumeric chars. This means certain compound word
247
- cases will work, for example query "wi fi" will match
248
- document "WiFi" or "wi-fi". However, other cases will still
249
- not match, for example if the query is "wifi" and the
250
- document is "wi fi" or if the query is "wi-fi" and the
251
- document is "wifi".
252
- -->
253
- <fieldType name="text_en_splitting" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true">
254
- <analyzer type="index">
255
- <tokenizer class="solr.WhitespaceTokenizerFactory"/>
256
- <!-- in this example, we will only use synonyms at query time
257
- <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
258
- -->
259
- <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
260
- <filter class="solr.LowerCaseFilterFactory"/>
261
- <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
262
- <filter class="solr.PorterStemFilterFactory"/>
263
- </analyzer>
264
- <analyzer type="query">
265
- <tokenizer class="solr.WhitespaceTokenizerFactory"/>
266
- <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
267
- <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
268
- <filter class="solr.LowerCaseFilterFactory"/>
269
- <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
270
- <filter class="solr.PorterStemFilterFactory"/>
271
- </analyzer>
272
- </fieldType>
273
-
274
- <!-- Less flexible matching, but less false matches. Probably not ideal for product names,
275
- but may be good for SKUs. Can insert dashes in the wrong place and still match. -->
276
- <fieldType name="text_en_splitting_tight" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true">
277
- <analyzer>
278
- <tokenizer class="solr.WhitespaceTokenizerFactory"/>
279
- <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="false"/>
280
- <!--<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords_en.txt"/>-->
281
- <filter class="solr.WordDelimiterFilterFactory" generateWordParts="0" generateNumberParts="0" catenateWords="1" catenateNumbers="1" catenateAll="0"/>
282
- <filter class="solr.LowerCaseFilterFactory"/>
283
- <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
284
- <filter class="solr.EnglishMinimalStemFilterFactory"/>
285
- <!-- this filter can remove any duplicate tokens that appear at the same position - sometimes
286
- possible with WordDelimiterFilter in conjuncton with stemming. -->
287
- <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
288
- </analyzer>
289
- </fieldType>
290
-
291
- <!-- Just like text_general except it reverses the characters of
292
- each token, to enable more efficient leading wildcard queries. -->
293
- <fieldType name="text_general_rev" class="solr.TextField" positionIncrementGap="100">
294
- <analyzer type="index">
295
- <tokenizer class="solr.StandardTokenizerFactory"/>
296
- <filter class="solr.LowerCaseFilterFactory"/>
297
- <filter class="solr.ReversedWildcardFilterFactory" withOriginal="true"
298
- maxPosAsterisk="3" maxPosQuestion="2" maxFractionAsterisk="0.33"/>
299
- </analyzer>
300
- <analyzer type="query">
301
- <tokenizer class="solr.StandardTokenizerFactory"/>
302
- <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
303
- <filter class="solr.LowerCaseFilterFactory"/>
304
- </analyzer>
305
- </fieldType>
306
-
307
- <fieldType name="textSpell" class="solr.TextField" positionIncrementGap="100" >
308
- <analyzer>
309
- <tokenizer class="solr.StandardTokenizerFactory"/>
310
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
311
- <filter class="solr.StandardFilterFactory"/>
312
- <filter class="solr.LowerCaseFilterFactory"/>
313
- <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
314
- </analyzer>
315
- </fieldType>
316
-
317
- <fieldType class="solr.TextField" name="textSuggest" positionIncrementGap="100">
318
- <analyzer>
319
- <tokenizer class="solr.KeywordTokenizerFactory"/>
320
- <filter class="solr.StandardFilterFactory"/>
321
- <filter class="solr.LowerCaseFilterFactory"/>
322
- <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
323
- </analyzer>
324
- </fieldType>
325
-
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"/>
332
- </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
- />
366
- </analyzer>
367
- </fieldType>
368
-
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" />
399
- </analyzer>
400
- </fieldType>
401
-
402
- <fieldType name="text_path" class="solr.TextField" positionIncrementGap="100">
403
- <analyzer>
404
- <tokenizer class="solr.PathHierarchyTokenizerFactory"/>
405
- </analyzer>
406
- </fieldType>
407
-
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="timestamp" type="date" indexed="true" stored="true" default="NOW" multiValued="false"/>
463
- <!-- default, catch all search field -->
464
- <field name="text" type="text" indexed="true" stored="false" multiValued="true"/>
465
-
466
- <!-- these display fields are NOT multi-valued -->
467
- <field name="marc_display" type="string" indexed="false" stored="true" multiValued="false"/>
468
- <field name="title_display" type="string" indexed="false" stored="true" multiValued="false"/>
469
- <field name="title_vern_display" type="string" indexed="false" stored="true" multiValued="false"/>
470
- <field name="subtitle_display" type="string" indexed="false" stored="true" multiValued="false"/>
471
- <field name="subtitle_vern_display" type="string" indexed="false" stored="true" multiValued="false"/>
472
- <field name="author_display" type="string" indexed="false" stored="true" multiValued="false"/>
473
- <field name="author_vern_display" type="string" indexed="false" stored="true" multiValued="false"/>
474
-
475
- <!-- these fields are also used for display, so they must be stored -->
476
- <field name="isbn_t" type="text" indexed="true" stored="true" multiValued="true"/>
477
- <field name="language_facet" type="string" indexed="true" stored="true" multiValued="true" />
478
- <field name="subject_topic_facet" type="string" indexed="true" stored="true" multiValued="true" />
479
- <field name="subject_era_facet" type="string" indexed="true" stored="true" multiValued="true" />
480
- <field name="subject_geo_facet" type="string" indexed="true" stored="true" multiValued="true" />
481
- <!-- pub_date is used for facet and display so it must be indexed and stored -->
482
- <field name="pub_date" type="string" indexed="true" stored="true" multiValued="true"/>
483
- <!-- pub_date sort uses new trie-based int fields, which are recommended for any int and are displayable, sortable, and range-quer
484
- we use 'tint' for faster range-queries. -->
485
- <field name="pub_date_sort" type="tint" indexed="true" stored="true" multiValued="false"/>
486
-
487
- <!-- format is used for facet, display, and choosing which partial to use for the show view, so it must be stored and indexed -->
488
- <field name="format" type="string" indexed="true" stored="true"/>
489
-
490
-
491
-
492
- <!-- Dynamic field definitions allow using convention over configuration
493
- for fields via the specification of patterns to match field names.
494
- EXAMPLE: name="*_i" will match any field ending in _i (like myid_i, z_i)
495
- RESTRICTION: the glob-like pattern in the name attribute must have
496
- a "*" only at the start or the end. -->
497
-
498
- <!-- text (_t...) -->
499
- <dynamicField name="*_ti" type="text_general" stored="false" indexed="true" multiValued="false"/>
500
- <dynamicField name="*_tim" type="text_general" stored="false" indexed="true" multiValued="true"/>
501
- <dynamicField name="*_ts" type="text_general" stored="true" indexed="false" multiValued="false"/>
502
- <dynamicField name="*_tsm" type="text_general" stored="true" indexed="false" multiValued="true"/>
503
- <dynamicField name="*_tsi" type="text_general" stored="true" indexed="true" multiValued="false"/>
504
- <dynamicField name="*_tsim" type="text_general" stored="true" indexed="true" multiValued="true"/>
505
- <dynamicField name="*_tiv" type="text_general" stored="false" indexed="true" multiValued="false" termVectors="true" termPositions="true" termOffsets="true"/>
506
- <dynamicField name="*_timv" type="text_general" stored="false" indexed="true" multiValued="true" termVectors="true" termPositions="true" termOffsets="true"/>
507
- <dynamicField name="*_tsiv" type="text_general" stored="true" indexed="true" multiValued="false" termVectors="true" termPositions="true" termOffsets="true"/>
508
- <dynamicField name="*_tsimv" type="text_general" stored="true" indexed="true" multiValued="true" termVectors="true" termPositions="true" termOffsets="true"/>
509
-
510
- <!-- English text (_te...) -->
511
- <dynamicField name="*_tei" type="text_en" stored="false" indexed="true" multiValued="false"/>
512
- <dynamicField name="*_teim" type="text_en" stored="false" indexed="true" multiValued="true"/>
513
- <dynamicField name="*_tes" type="text_en" stored="true" indexed="false" multiValued="false"/>
514
- <dynamicField name="*_tesm" type="text_en" stored="true" indexed="false" multiValued="true"/>
515
- <dynamicField name="*_tesi" type="text_en" stored="true" indexed="true" multiValued="false"/>
516
- <dynamicField name="*_tesim" type="text_en" stored="true" indexed="true" multiValued="true"/>
517
- <dynamicField name="*_teiv" type="text_en" stored="false" indexed="true" multiValued="false" termVectors="true" termPositions="true" termOffsets="true"/>
518
- <dynamicField name="*_teimv" type="text_en" stored="false" indexed="true" multiValued="true" termVectors="true" termPositions="true" termOffsets="true"/>
519
- <dynamicField name="*_tesiv" type="text_en" stored="true" indexed="true" multiValued="false" termVectors="true" termPositions="true" termOffsets="true"/>
520
- <dynamicField name="*_tesimv" type="text_en" stored="true" indexed="true" multiValued="true" termVectors="true" termPositions="true" termOffsets="true"/>
521
-
522
- <!-- string (_s...) -->
523
- <dynamicField name="*_si" type="string" stored="false" indexed="true" multiValued="false"/>
524
- <dynamicField name="*_sim" type="string" stored="false" indexed="true" multiValued="true"/>
525
- <dynamicField name="*_ss" type="string" stored="true" indexed="false" multiValued="false"/>
526
- <dynamicField name="*_ssm" type="string" stored="true" indexed="false" multiValued="true"/>
527
- <dynamicField name="*_ssi" type="string" stored="true" indexed="true" multiValued="false"/>
528
- <dynamicField name="*_ssim" type="string" stored="true" indexed="true" multiValued="true"/>
529
- <dynamicField name="*_ssort" type="alphaOnlySort" stored="false" indexed="true" multiValued="false"/>
530
-
531
- <!-- integer (_i...) -->
532
- <dynamicField name="*_ii" type="int" stored="false" indexed="true" multiValued="false"/>
533
- <dynamicField name="*_iim" type="int" stored="false" indexed="true" multiValued="true"/>
534
- <dynamicField name="*_is" type="int" stored="true" indexed="false" multiValued="false"/>
535
- <dynamicField name="*_ism" type="int" stored="true" indexed="false" multiValued="true"/>
536
- <dynamicField name="*_isi" type="int" stored="true" indexed="true" multiValued="false"/>
537
- <dynamicField name="*_isim" type="int" stored="true" indexed="true" multiValued="true"/>
538
-
539
- <!-- trie integer (_it...) (for faster range queries) -->
540
- <dynamicField name="*_iti" type="tint" stored="false" indexed="true" multiValued="false"/>
541
- <dynamicField name="*_itim" type="tint" stored="false" indexed="true" multiValued="true"/>
542
- <dynamicField name="*_its" type="tint" stored="true" indexed="false" multiValued="false"/>
543
- <dynamicField name="*_itsm" type="tint" stored="true" indexed="false" multiValued="true"/>
544
- <dynamicField name="*_itsi" type="tint" stored="true" indexed="true" multiValued="false"/>
545
- <dynamicField name="*_itsim" type="tint" stored="true" indexed="true" multiValued="true"/>
546
-
547
- <!-- date (_dt...) -->
548
- <!-- The format for this date field is of the form 1995-12-31T23:59:59Z
549
- Optional fractional seconds are allowed: 1995-12-31T23:59:59.999Z -->
550
- <dynamicField name="*_dti" type="date" stored="false" indexed="true" multiValued="false"/>
551
- <dynamicField name="*_dtim" type="date" stored="false" indexed="true" multiValued="true"/>
552
- <dynamicField name="*_dts" type="date" stored="true" indexed="false" multiValued="false"/>
553
- <dynamicField name="*_dtsm" type="date" stored="true" indexed="false" multiValued="true"/>
554
- <dynamicField name="*_dtsi" type="date" stored="true" indexed="true" multiValued="false"/>
555
- <dynamicField name="*_dtsim" type="date" stored="true" indexed="true" multiValued="true"/>
556
-
557
- <!-- trie date (_dtt...) (for faster range queries) -->
558
- <dynamicField name="*_dtti" type="tdate" stored="false" indexed="true" multiValued="false"/>
559
- <dynamicField name="*_dttim" type="tdate" stored="false" indexed="true" multiValued="true"/>
560
- <dynamicField name="*_dtts" type="tdate" stored="true" indexed="false" multiValued="false"/>
561
- <dynamicField name="*_dttsm" type="tdate" stored="true" indexed="false" multiValued="true"/>
562
- <dynamicField name="*_dttsi" type="tdate" stored="true" indexed="true" multiValued="false"/>
563
- <dynamicField name="*_dttsim" type="tdate" stored="true" indexed="true" multiValued="true"/>
564
-
565
- <!-- long (_l...) -->
566
- <dynamicField name="*_li" type="long" stored="false" indexed="true" multiValued="false"/>
567
- <dynamicField name="*_lim" type="long" stored="false" indexed="true" multiValued="true"/>
568
- <dynamicField name="*_ls" type="long" stored="true" indexed="false" multiValued="false"/>
569
- <dynamicField name="*_lsm" type="long" stored="true" indexed="false" multiValued="true"/>
570
- <dynamicField name="*_lsi" type="long" stored="true" indexed="true" multiValued="false"/>
571
- <dynamicField name="*_lsim" type="long" stored="true" indexed="true" multiValued="true"/>
572
-
573
- <!-- trie long (_lt...) (for faster range queries) -->
574
- <dynamicField name="*_lti" type="tlong" stored="false" indexed="true" multiValued="false"/>
575
- <dynamicField name="*_ltim" type="tlong" stored="false" indexed="true" multiValued="true"/>
576
- <dynamicField name="*_lts" type="tlong" stored="true" indexed="false" multiValued="false"/>
577
- <dynamicField name="*_ltsm" type="tlong" stored="true" indexed="false" multiValued="true"/>
578
- <dynamicField name="*_ltsi" type="tlong" stored="true" indexed="true" multiValued="false"/>
579
- <dynamicField name="*_ltsim" type="tlong" stored="true" indexed="true" multiValued="true"/>
580
-
581
- <!-- double (_db...) -->
582
- <dynamicField name="*_dbi" type="double" stored="false" indexed="true" multiValued="false"/>
583
- <dynamicField name="*_dbim" type="double" stored="false" indexed="true" multiValued="true"/>
584
- <dynamicField name="*_dbs" type="double" stored="true" indexed="false" multiValued="false"/>
585
- <dynamicField name="*_dbsm" type="double" stored="true" indexed="false" multiValued="true"/>
586
- <dynamicField name="*_dbsi" type="double" stored="true" indexed="true" multiValued="false"/>
587
- <dynamicField name="*_dbsim" type="double" stored="true" indexed="true" multiValued="true"/>
588
-
589
- <!-- trie double (_dbt...) (for faster range queries) -->
590
- <dynamicField name="*_dbti" type="tdouble" stored="false" indexed="true" multiValued="false"/>
591
- <dynamicField name="*_dbtim" type="tdouble" stored="false" indexed="true" multiValued="true"/>
592
- <dynamicField name="*_dbts" type="tdouble" stored="true" indexed="false" multiValued="false"/>
593
- <dynamicField name="*_dbtsm" type="tdouble" stored="true" indexed="false" multiValued="true"/>
594
- <dynamicField name="*_dbtsi" type="tdouble" stored="true" indexed="true" multiValued="false"/>
595
- <dynamicField name="*_dbtsim" type="tdouble" stored="true" indexed="true" multiValued="true"/>
596
-
597
- <!-- float (_f...) -->
598
- <dynamicField name="*_fi" type="float" stored="false" indexed="true" multiValued="false"/>
599
- <dynamicField name="*_fim" type="float" stored="false" indexed="true" multiValued="true"/>
600
- <dynamicField name="*_fs" type="float" stored="true" indexed="false" multiValued="false"/>
601
- <dynamicField name="*_fsm" type="float" stored="true" indexed="false" multiValued="true"/>
602
- <dynamicField name="*_fsi" type="float" stored="true" indexed="true" multiValued="false"/>
603
- <dynamicField name="*_fsim" type="float" stored="true" indexed="true" multiValued="true"/>
604
-
605
- <!-- trie float (_ft...) (for faster range queries) -->
606
- <dynamicField name="*_fti" type="tfloat" stored="false" indexed="true" multiValued="false"/>
607
- <dynamicField name="*_ftim" type="tfloat" stored="false" indexed="true" multiValued="true"/>
608
- <dynamicField name="*_fts" type="tfloat" stored="true" indexed="false" multiValued="false"/>
609
- <dynamicField name="*_ftsm" type="tfloat" stored="true" indexed="false" multiValued="true"/>
610
- <dynamicField name="*_ftsi" type="tfloat" stored="true" indexed="true" multiValued="false"/>
611
- <dynamicField name="*_ftsim" type="tfloat" stored="true" indexed="true" multiValued="true"/>
612
-
613
- <!-- boolean (_b...) -->
614
- <dynamicField name="*_bi" type="boolean" stored="false" indexed="true" multiValued="false"/>
615
- <dynamicField name="*_bs" type="boolean" stored="true" indexed="false" multiValued="false"/>
616
- <dynamicField name="*_bsi" type="boolean" stored="true" indexed="true" multiValued="false"/>
617
-
618
- <!-- Type used to index the lat and lon components for the "location" FieldType -->
619
- <dynamicField name="*_coordinate" type="tdouble" indexed="true" stored="false" />
620
-
621
- <!-- location (_ll...) -->
622
- <dynamicField name="*_lli" type="location" stored="false" indexed="true" multiValued="false"/>
623
- <dynamicField name="*_llim" type="location" stored="false" indexed="true" multiValued="true"/>
624
- <dynamicField name="*_lls" type="location" stored="true" indexed="false" multiValued="false"/>
625
- <dynamicField name="*_llsm" type="location" stored="true" indexed="false" multiValued="true"/>
626
- <dynamicField name="*_llsi" type="location" stored="true" indexed="true" multiValued="false"/>
627
- <dynamicField name="*_llsim" type="location" stored="true" indexed="true" multiValued="true"/>
628
-
629
- </fields>
630
-
631
- <!-- Field to use to determine and enforce document uniqueness.
632
- Unless this field is marked with required="false", it will be a required field
633
- -->
634
- <uniqueKey>id</uniqueKey>
635
-
636
- <!-- field for the QueryParser to use when an explicit fieldname is absent -->
637
- <defaultSearchField>text</defaultSearchField>
638
-
639
- <!-- SolrQueryParser configuration: defaultOperator="AND|OR" -->
640
- <solrQueryParser defaultOperator="OR"/>
641
-
642
- <!-- copyField commands copy one field to another at the time a document
643
- is added to the index. It's used either to index the same field differently,
644
- or to add multiple fields to the same field for easier/faster searching. -->
645
- <!-- Copy Fields -->
646
-
647
- <!-- unstemmed fields -->
648
- <!--<copyField source="title_t" dest="title_unstem_search"/>-->
649
- <!--<copyField source="subtitle_t" dest="subtitle_unstem_search"/>-->
650
- <!--<copyField source="title_addl_t" dest="title_addl_unstem_search"/>-->
651
- <!--<copyField source="title_added_entry_t" dest="title_added_entry_unstem_search"/>-->
652
- <!--<copyField source="title_series_t" dest="title_series_unstem_search"/>-->
653
- <!--<copyField source="author_t" dest="author_unstem_search"/>-->
654
- <!--<copyField source="author_addl_t" dest="author_addl_unstem_search"/>-->
655
- <!--<copyField source="subject_t" dest="subject_unstem_search"/>-->
656
- <!--<copyField source="subject_addl_t" dest="subject_addl_unstem_search"/>-->
657
- <!--<copyField source="subject_topic_facet" dest="subject_topic_unstem_search"/>-->
658
-
659
- <!-- sort fields -->
660
- <copyField source="pub_date" dest="pub_date_sort"/>
661
-
662
-
663
- <!--&lt;!&ndash; spellcheck fields &ndash;&gt;-->
664
- <!--&lt;!&ndash; default spell check; should match fields for default request handler &ndash;&gt;-->
665
- <!--&lt;!&ndash; it won't work with a copy of a copy field &ndash;&gt;-->
666
- <!--<copyField source="*_t" dest="spell"/>-->
667
- <!--<copyField source="*_facet" dest="spell"/>-->
668
- <!--&lt;!&ndash; title spell check; should match fields for title request handler &ndash;&gt;-->
669
- <!--<copyField source="title_t" dest="title_spell"/>-->
670
- <!--<copyField source="subtitle_t" dest="title_spell"/>-->
671
- <!--<copyField source="addl_titles_t" dest="title_spell"/>-->
672
- <!--<copyField source="title_added_entry_t" dest="title_spell"/>-->
673
- <!--<copyField source="title_series_t" dest="title_spell"/>-->
674
- <!--&lt;!&ndash; author spell check; should match fields for author request handler &ndash;&gt;-->
675
- <!--<copyField source="author_t" dest="author_spell"/>-->
676
- <!--<copyField source="author_addl_t" dest="author_spell"/>-->
677
- <!--&lt;!&ndash; subject spell check; should match fields for subject request handler &ndash;&gt;-->
678
- <!--<copyField source="subject_topic_facet" dest="subject_spell"/>-->
679
- <!--<copyField source="subject_t" dest="subject_spell"/>-->
680
- <!--<copyField source="subject_addl_t" dest="subject_spell"/>-->
681
-
682
- <!--&lt;!&ndash; OpenSearch query field should match request handler search fields &ndash;&gt;-->
683
- <!--<copyField source="title_t" dest="opensearch_display"/>-->
684
- <!--<copyField source="subtitle_t" dest="opensearch_display"/>-->
685
- <!--<copyField source="addl_titles_t" dest="opensearch_display"/>-->
686
- <!--<copyField source="title_added_entry_t" dest="opensearch_display"/>-->
687
- <!--<copyField source="title_series_t" dest="opensearch_display"/>-->
688
- <!--<copyField source="author_t" dest="opensearch_display"/>-->
689
- <!--<copyField source="author_addl_t" dest="opensearch_display"/>-->
690
- <!--<copyField source="subject_topic_facet" dest="opensearch_display"/>-->
691
- <!--<copyField source="subject_t" dest="opensearch_display"/>-->
692
- <!--<copyField source="subject_addl_t" dest="opensearch_display"/>-->
693
-
694
- <!--&lt;!&ndash; for suggestions &ndash;&gt;-->
695
- <!--<copyField source="*_t" dest="suggest"/>-->
696
- <!--<copyField source="*_facet" dest="suggest"/>-->
697
-
698
- <!-- Above, multiple source fields are copied to the [text] field.
699
- Another way to map multiple source fields to the same
700
- destination field is to use the dynamic field syntax.
701
- copyField also supports a maxChars to copy setting. -->
702
-
703
- <!-- <copyField source="*_t" dest="text" maxChars="3000"/> -->
704
-
705
- <!-- copy name to alphaNameSort, a field designed for sorting by name -->
706
- <!-- <copyField source="name" dest="alphaNameSort"/> -->
707
-
708
-
709
- <!-- Similarity is the scoring routine for each document vs. a query.
710
- A custom similarity may be specified here, but the default is fine
711
- for most applications. -->
712
- <!-- <similarity class="org.apache.lucene.search.DefaultSimilarity"/> -->
713
- <!-- ... OR ...
714
- Specify a SimilarityFactory class name implementation
715
- allowing parameters to be used.
716
- -->
717
- <!--
718
- <similarity class="com.example.solr.CustomSimilarityFactory">
719
- <str name="paramkey">param value</str>
720
- </similarity>
721
- -->
722
-
723
-
724
- </schema>