solr_wrapper 4.3.0 → 4.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +4 -0
  3. data/README.md +8 -0
  4. data/lib/solr_wrapper/checksum_validator.rb +1 -1
  5. data/lib/solr_wrapper/client.rb +15 -5
  6. data/lib/solr_wrapper/configuration.rb +4 -3
  7. data/lib/solr_wrapper/downloader.rb +1 -1
  8. data/lib/solr_wrapper/instance.rb +2 -2
  9. data/lib/solr_wrapper/version.rb +1 -1
  10. data/solr_wrapper.gemspec +1 -2
  11. data/spec/fixtures/basic_configs_v10/schema.xml +402 -0
  12. data/spec/fixtures/basic_configs_v9/_rest_managed.json +1 -0
  13. data/spec/fixtures/basic_configs_v9/currency.xml +67 -0
  14. data/spec/fixtures/basic_configs_v9/lang/stopwords_en.txt +54 -0
  15. data/spec/fixtures/basic_configs_v9/protwords.txt +21 -0
  16. data/spec/fixtures/basic_configs_v9/solrconfig.xml +572 -0
  17. data/spec/fixtures/basic_configs_v9/stopwords.txt +14 -0
  18. data/spec/fixtures/basic_configs_v9/synonyms.txt +29 -0
  19. data/spec/lib/solr_wrapper/client_spec.rb +2 -0
  20. data/spec/lib/solr_wrapper/instance_spec.rb +18 -26
  21. data/spec/spec_helper.rb +0 -1
  22. metadata +38 -42
  23. /data/spec/fixtures/{basic_configs → basic_configs_v10}/_rest_managed.json +0 -0
  24. /data/spec/fixtures/{basic_configs → basic_configs_v10}/currency.xml +0 -0
  25. /data/spec/fixtures/{basic_configs → basic_configs_v10}/lang/stopwords_en.txt +0 -0
  26. /data/spec/fixtures/{basic_configs → basic_configs_v10}/protwords.txt +0 -0
  27. /data/spec/fixtures/{basic_configs → basic_configs_v10}/solrconfig.xml +0 -0
  28. /data/spec/fixtures/{basic_configs → basic_configs_v10}/stopwords.txt +0 -0
  29. /data/spec/fixtures/{basic_configs → basic_configs_v10}/synonyms.txt +0 -0
  30. /data/spec/fixtures/{basic_configs → basic_configs_v9}/schema.xml +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 18f3d35de784cb86498a00c3441df0319346e4612cc701a0884285d2d1fec8f7
4
- data.tar.gz: a2b668dfb513b3c95e0bb9eedb5b891e1121cc329214dee4bc984702f66709ef
3
+ metadata.gz: 2009c3b3cb4dd774419530590b95805aa44be67bdfd4a1229bca9d381a124628
4
+ data.tar.gz: 0074a7f9d1251bc6f19e4fbd0d9694dfe768685720fb8e23a1c78c80dabe9f42
5
5
  SHA512:
6
- metadata.gz: 5c10dc4da08e95d372b7755ee8c86f42ed6788a002660b226581b38609452808c2219e759739f7ee0da567c40ca40a573617c72bbb25e1ed88edb729ed6e07d0
7
- data.tar.gz: b17bef09a92418ca361767b867d562bc3110865731abf48d18fa185f279750947e57df7a707315bd4de0b1be5a2495d1b3b31121e7dc1149c0b9221b3b3a413e
6
+ metadata.gz: e09911f890660eaf9cc604d01c932cf59b54e1786cb708f12f576a81ded84b7646418940dea4042393a5dd598350d0a028e7d9442e996429ed245226683ecfdd
7
+ data.tar.gz: 2d71edc7728a3be67e3ac367ea880a77db3729afbeba15c5675160cb268034f1c55ab40c5c5640de1aa48f6c223c72fd656020516cc1826f76102a0485ebd267
@@ -25,6 +25,10 @@ jobs:
25
25
  SOLR_WRAPPER_SOLR_VERSION: ${{ matrix.solr_version }}
26
26
  steps:
27
27
  - uses: actions/checkout@v3
28
+ - uses: actions/setup-java@v5
29
+ with:
30
+ distribution: 'temurin'
31
+ java-version: '21'
28
32
  - name: Set up Ruby
29
33
  uses: ruby/setup-ruby@v1
30
34
  with:
data/README.md CHANGED
@@ -62,6 +62,14 @@ To see a list of valid options when using solr_wrapper to launch a Solr instance
62
62
  $ solr_wrapper -h
63
63
  ```
64
64
 
65
+ ### Valid environment variables
66
+ |Option | |
67
+ |---------------|-----------------------------------------|
68
+ | SOLR_WRAPPER_DOWNLOAD_DIR | Local path for storing the downloaded Solr tgz file |
69
+ | SOLR_WRAPPER_SOLR_VERSION | Solr version to download and install|
70
+
71
+
72
+
65
73
  ### Configuration file
66
74
  SolrWrapper can read configuration options from a YAML configuration file.
67
75
  By default, it looks for configuration files at `.solr_wrapper` and `~/.solr_wrapper`.
@@ -61,7 +61,7 @@ module SolrWrapper
61
61
 
62
62
  def algorithm
63
63
  return config.static_config.algorithm if config.static_config.algorithm
64
- return 'sha1' if config.static_config.version =~ /^[1-6]/ || config.static_config.version =~ /^[7]\.[0-4]/
64
+ return 'sha1' if config.static_config.version =~ /^[1-6]\./ || config.static_config.version =~ /^[7]\.[0-4]/
65
65
 
66
66
  'sha512'
67
67
  end
@@ -18,16 +18,26 @@ module SolrWrapper
18
18
  private
19
19
 
20
20
  def collection?(name)
21
- response = Faraday.get("#{url}admin/collections?action=LIST&wt=json")
22
- data = JSON.parse(response.body)
23
- return if data['error'] && data['error']['msg'] == 'Solr instance is not running in SolrCloud mode.'
21
+ response = http.get("/v2/collections")
22
+
23
+ if response.success?
24
+ JSON.parse(response.body)['collections'].include? name
25
+ else
26
+ response = http.get("/solr/admin/collections?action=LIST&wt=json")
27
+ data = JSON.parse(response.body)
28
+ return if data['error'] && data['error']['msg'] == 'Solr instance is not running in SolrCloud mode.'
29
+ data['collections'].include? name
30
+ end
24
31
 
25
- data['collections'].include? name
26
32
  end
27
33
 
28
34
  def core?(name)
29
- response = Faraday.get("#{url}admin/cores?action=STATUS&wt=json&core=#{name}")
35
+ response = http.get("/solr/admin/cores?action=STATUS&wt=json&core=#{name}")
30
36
  !JSON.parse(response.body)['status'][name].empty?
31
37
  end
38
+
39
+ def http
40
+ @http ||= Faraday.new(url)
41
+ end
32
42
  end
33
43
  end
@@ -61,7 +61,7 @@ module SolrWrapper
61
61
  end
62
62
 
63
63
  def download_dir
64
- options[:download_dir] || default_download_dir
64
+ env_options[:download_dir] || options[:download_dir] || default_download_dir
65
65
  end
66
66
 
67
67
  def default_download_dir
@@ -101,7 +101,7 @@ module SolrWrapper
101
101
  end
102
102
 
103
103
  def mirror_artifact_path
104
- if version > '9'
104
+ if version > '9' || version.start_with?(/1\d/)
105
105
  "solr/solr/#{version}/solr-#{version}.tgz"
106
106
  else
107
107
  "lucene/solr/#{version}/solr-#{version}.tgz"
@@ -118,7 +118,7 @@ module SolrWrapper
118
118
  else
119
119
  begin
120
120
  client = Faraday.new(closest_mirror_url) do |faraday|
121
- faraday.use Faraday::FollowRedirects::Middleware
121
+ faraday.response :follow_redirects
122
122
  faraday.adapter Faraday.default_adapter
123
123
  end
124
124
 
@@ -237,6 +237,7 @@ module SolrWrapper
237
237
  @env_options ||= begin
238
238
  env = options.fetch(:env, {})
239
239
  {
240
+ download_dir: env['SOLR_WRAPPER_DOWNLOAD_DIR'],
240
241
  version: env['SOLR_WRAPPER_SOLR_VERSION']
241
242
  }
242
243
  end
@@ -8,7 +8,7 @@ module SolrWrapper
8
8
  pbar = SafeProgressBar.new(title: File.basename(url), total: nil, format: '%t: |%B| %p%% (%e )')
9
9
 
10
10
  client = Faraday.new(url) do |faraday|
11
- faraday.use Faraday::FollowRedirects::Middleware
11
+ faraday.response :follow_redirects
12
12
  faraday.adapter Faraday.default_adapter
13
13
  end
14
14
 
@@ -72,7 +72,7 @@ module SolrWrapper
72
72
  def start
73
73
  extract_and_configure
74
74
  if managed?
75
- exec('start', p: port, c: config.cloud)
75
+ exec('start', p: port, **(extracted_version.start_with?(/1\d/) ? {} : { c: config.cloud }))
76
76
 
77
77
  @started = true
78
78
 
@@ -98,7 +98,7 @@ module SolrWrapper
98
98
  # Stop Solr and wait for it to finish exiting
99
99
  def restart
100
100
  if managed? && started?
101
- exec('restart', p: port, c: config.cloud)
101
+ exec('restart', p: port, **(extracted_version.start_with?(/1\d/) ? {} : { c: config.cloud }))
102
102
  end
103
103
  end
104
104
 
@@ -1,3 +1,3 @@
1
1
  module SolrWrapper
2
- VERSION = '4.3.0'
2
+ VERSION = '4.4.0'
3
3
  end
data/solr_wrapper.gemspec CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency "faraday", ">= 1.0", "< 3"
21
+ spec.add_dependency "faraday", '~> 2.0'
22
22
  spec.add_dependency "faraday-follow_redirects"
23
23
  spec.add_dependency "minitar"
24
24
  spec.add_dependency "ruby-progressbar"
@@ -29,6 +29,5 @@ Gem::Specification.new do |spec|
29
29
  spec.add_development_dependency "rake", ">= 12.2", "< 14"
30
30
 
31
31
  spec.add_development_dependency "rspec"
32
- spec.add_development_dependency "simple_solr_client", "= 0.2.0" # 0.2.1 removed support for schema retrieval
33
32
  spec.add_development_dependency "webmock"
34
33
  end
@@ -0,0 +1,402 @@
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
+
21
+ This example schema is the recommended starting point for users.
22
+ It should be kept correct and concise, usable out-of-the-box.
23
+
24
+
25
+ For more information, on how to customize this file, please see
26
+ https://solr.apache.org/guide/solr/latest/indexing-guide/schema-elements.html
27
+
28
+ PERFORMANCE NOTE: this schema includes many optional features and should not
29
+ be used for benchmarking. To improve performance one could
30
+ - set stored="false" for all fields possible (esp large fields) when you
31
+ only need to search on the field but don't need to return the original
32
+ value.
33
+ - set indexed="false" if you don't need to search on the field, but only
34
+ return the field as a result of searching on other indexed fields.
35
+ - remove all unneeded copyField statements
36
+ - for best index size and searching performance, set "index" to false
37
+ for all general text fields, use copyField to copy them to the
38
+ catchall "text" field, and use that for searching.
39
+ -->
40
+
41
+ <schema name="default-config" version="1.7">
42
+ <!-- attribute "name" is the name of this schema and is only used for display purposes.
43
+ version="x.y" is Solr's version number for the schema syntax and
44
+ semantics. It should not normally be changed by applications.
45
+
46
+ 1.0: multiValued attribute did not exist, all fields are multiValued
47
+ by nature
48
+ 1.1: multiValued attribute introduced, false by default
49
+ 1.2: omitTermFreqAndPositions attribute introduced, true by default
50
+ except for text fields.
51
+ 1.3: removed optional field compress feature
52
+ 1.4: autoGeneratePhraseQueries attribute introduced to drive QueryParser
53
+ behavior when a single string produces multiple tokens. Defaults
54
+ to off for version >= 1.4
55
+ 1.5: omitNorms defaults to true for primitive field types
56
+ (int, float, boolean, string...)
57
+ 1.6: useDocValuesAsStored defaults to true.
58
+ 1.7: docValues defaults to true, uninvertible defaults to false.
59
+ -->
60
+
61
+ <!-- Valid attributes for fields:
62
+ name: mandatory - the name for the field
63
+ type: mandatory - the name of a field type from the
64
+ fieldTypes section
65
+ indexed: true if this field should be indexed (searchable or sortable)
66
+ stored: true if this field should be retrievable
67
+ docValues: true if this field should have doc values. Doc Values is
68
+ recommended (required, if you are using *Point fields) for faceting,
69
+ grouping, sorting and function queries. Doc Values will make the index
70
+ faster to load, more NRT-friendly and more memory-efficient.
71
+ They are currently only supported by StrField, UUIDField, all
72
+ *PointFields, and depending on the field type, they might require
73
+ the field to be single-valued, be required or have a default value
74
+ (check the documentation of the field type you're interested in for
75
+ more information)
76
+ multiValued: true if this field may contain multiple values per document
77
+ omitNorms: (expert) set to true to omit the norms associated with
78
+ this field (this disables length normalization and index-time
79
+ boosting for the field, and saves some memory). Only full-text
80
+ fields or fields that need an index-time boost need norms.
81
+ Norms are omitted for primitive (non-analyzed) types by default.
82
+ termVectors: [false] set to true to store the term vector for a
83
+ given field.
84
+ When using MoreLikeThis, fields used for similarity should be
85
+ stored for best performance.
86
+ termPositions: Store position information with the term vector.
87
+ This will increase storage costs.
88
+ termOffsets: Store offset information with the term vector. This
89
+ will increase storage costs.
90
+ required: The field is required. It will throw an error if the
91
+ value does not exist
92
+ default: a value that should be used if no value is specified
93
+ when adding a document.
94
+ -->
95
+
96
+ <!-- field names should consist of alphanumeric or underscore characters only and
97
+ not start with a digit. This is not currently strictly enforced,
98
+ but other field names will not have first class support from all components
99
+ and back compatibility is not guaranteed. Names with both leading and
100
+ trailing underscores (e.g. _version_) are reserved.
101
+ -->
102
+
103
+ <!-- In this _default configset, only four fields are pre-declared:
104
+ id, _version_, and _text_ and _root_. All other fields will be type guessed and added via the
105
+ "add-unknown-fields-to-the-schema" update request processor chain declared in solrconfig.xml.
106
+
107
+ Note that many dynamic fields are also defined - you can use them to specify a
108
+ field's type via field naming conventions - see below.
109
+
110
+ WARNING: The _text_ catch-all field will significantly increase your index size.
111
+ If you don't need it, consider removing it and the corresponding copyField directive.
112
+ -->
113
+
114
+ <field name="id" type="string" indexed="true" stored="true" required="true" multiValued="false" />
115
+ <!-- docValues are enabled by default for long type so we don't need to index the version field -->
116
+ <field name="_version_" type="plong" indexed="false" stored="false"/>
117
+
118
+ <!-- If you don't use child/nested documents, then you should remove the next two fields: -->
119
+ <!-- for nested documents (minimal; points to root document) -->
120
+ <field name="_root_" type="string" indexed="true" stored="false" />
121
+ <!-- for nested documents (relationship tracking) -->
122
+ <field name="_nest_path_" type="_nest_path_" /><fieldType name="_nest_path_" class="solr.NestPathField" />
123
+
124
+ <field name="_text_" type="text_general" indexed="true" stored="false" multiValued="true"/>
125
+
126
+ <!-- This can be enabled, in case the client does not know what fields may be searched. It isn't enabled by default
127
+ because it's very expensive to index everything twice. -->
128
+ <!-- <copyField source="*" dest="_text_"/> -->
129
+
130
+ <!-- Dynamic field definitions allow using convention over configuration
131
+ for fields via the specification of patterns to match field names.
132
+ EXAMPLE: name="*_i" will match any field ending in _i (like myid_i, z_i)
133
+ RESTRICTION: the glob-like pattern in the name attribute must have a "*"
134
+ only at the start or the end. -->
135
+
136
+ <dynamicField name="*_i" type="pint" indexed="true" stored="true"/>
137
+ <dynamicField name="*_is" type="pints" indexed="true" stored="true"/>
138
+ <dynamicField name="*_s" type="string" indexed="true" stored="true" />
139
+ <dynamicField name="*_ss" type="strings" indexed="true" stored="true"/>
140
+ <dynamicField name="*_l" type="plong" indexed="true" stored="true"/>
141
+ <dynamicField name="*_ls" type="plongs" indexed="true" stored="true"/>
142
+ <dynamicField name="*_b" type="boolean" indexed="true" stored="true"/>
143
+ <dynamicField name="*_bs" type="booleans" indexed="true" stored="true"/>
144
+ <dynamicField name="*_f" type="pfloat" indexed="true" stored="true"/>
145
+ <dynamicField name="*_fs" type="pfloats" indexed="true" stored="true"/>
146
+ <dynamicField name="*_d" type="pdouble" indexed="true" stored="true"/>
147
+ <dynamicField name="*_ds" type="pdoubles" indexed="true" stored="true"/>
148
+ <dynamicField name="*_dt" type="pdate" indexed="true" stored="true"/>
149
+ <dynamicField name="*_dts" type="pdates" indexed="true" stored="true"/>
150
+ <dynamicField name="*_t" type="text_general" indexed="true" stored="true" multiValued="false"/>
151
+ <dynamicField name="*_txt" type="text_general" indexed="true" stored="true"/>
152
+
153
+ <dynamicField name="random_*" type="random"/>
154
+ <dynamicField name="ignored_*" type="ignored"/>
155
+
156
+ <!-- Type used for data-driven schema, to add a string copy for each text field -->
157
+ <dynamicField name="*_str" type="strings" stored="false" docValues="true" indexed="false" useDocValuesAsStored="false"/>
158
+
159
+ <dynamicField name="*_p" type="location" indexed="true" stored="true"/>
160
+ <dynamicField name="*_srpt" type="location_rpt" indexed="true" stored="true"/>
161
+
162
+ <!-- payloaded dynamic fields -->
163
+ <dynamicField name="*_dpf" type="delimited_payloads_float" indexed="true" stored="true"/>
164
+ <dynamicField name="*_dpi" type="delimited_payloads_int" indexed="true" stored="true"/>
165
+ <dynamicField name="*_dps" type="delimited_payloads_string" indexed="true" stored="true"/>
166
+
167
+ <dynamicField name="attr_*" type="text_general" indexed="true" stored="true" multiValued="true"/>
168
+
169
+ <!-- Field to use to determine and enforce document uniqueness.
170
+ Unless this field is marked with required="false", it will be a required field
171
+ -->
172
+ <uniqueKey>id</uniqueKey>
173
+
174
+ <!-- copyField commands copy one field to another at the time a document
175
+ is added to the index. It's used either to index the same field differently,
176
+ or to add multiple fields to the same field for easier/faster searching.
177
+
178
+ <copyField source="sourceFieldName" dest="destinationFieldName"/>
179
+ -->
180
+
181
+ <!-- field type definitions. The "name" attribute is
182
+ just a label to be used by field definitions. The "class"
183
+ attribute and any other attributes determine the real
184
+ behavior of the fieldType.
185
+ Class names starting with "solr" refer to java classes in a
186
+ standard package such as org.apache.solr.analysis
187
+ -->
188
+
189
+ <!-- sortMissingLast and sortMissingFirst attributes are optional attributes are
190
+ currently supported on types that are sorted internally as strings
191
+ and on numeric types.
192
+ This includes "string", "boolean", "pint", "pfloat", "plong", "pdate", "pdouble".
193
+ - If sortMissingLast="true", then a sort on this field will cause documents
194
+ without the field to come after documents with the field,
195
+ regardless of the requested sort order (asc or desc).
196
+ - If sortMissingFirst="true", then a sort on this field will cause documents
197
+ without the field to come before documents with the field,
198
+ regardless of the requested sort order.
199
+ - If sortMissingLast="false" and sortMissingFirst="false" (the default),
200
+ then default lucene sorting will be used which places docs without the
201
+ field first in an ascending sort and last in a descending sort.
202
+ -->
203
+
204
+ <!-- The StrField type is not analyzed, but indexed/stored verbatim. -->
205
+ <fieldType name="string" class="solr.StrField" sortMissingLast="true" />
206
+ <fieldType name="strings" class="solr.StrField" sortMissingLast="true" multiValued="true" />
207
+
208
+ <!-- boolean type: "true" or "false" -->
209
+ <fieldType name="boolean" class="solr.BoolField" sortMissingLast="true"/>
210
+ <fieldType name="booleans" class="solr.BoolField" sortMissingLast="true" multiValued="true"/>
211
+
212
+ <!--
213
+ Numeric field types that index values using KD-trees.
214
+ Point fields don't support FieldCache, so they must have docValues enabled if needed for sorting, faceting, functions, etc.
215
+ This is the default, so it does not need to be set explicitly.
216
+ -->
217
+ <fieldType name="pint" class="solr.IntPointField"/>
218
+ <fieldType name="pfloat" class="solr.FloatPointField"/>
219
+ <fieldType name="plong" class="solr.LongPointField"/>
220
+ <fieldType name="pdouble" class="solr.DoublePointField"/>
221
+
222
+ <fieldType name="pints" class="solr.IntPointField" multiValued="true"/>
223
+ <fieldType name="pfloats" class="solr.FloatPointField" multiValued="true"/>
224
+ <fieldType name="plongs" class="solr.LongPointField" multiValued="true"/>
225
+ <fieldType name="pdoubles" class="solr.DoublePointField" multiValued="true"/>
226
+ <fieldType name="random" class="solr.RandomSortField" indexed="true"/>
227
+
228
+ <!-- since fields of this type are by default not stored or indexed,
229
+ any data added to them will be ignored outright. -->
230
+ <fieldType name="ignored" stored="false" indexed="false" multiValued="true" docValues="false" class="solr.StrField" />
231
+
232
+ <!-- The format for this date field is of the form 1995-12-31T23:59:59Z, and
233
+ is a more restricted form of the canonical representation of dateTime
234
+ http://www.w3.org/TR/xmlschema-2/#dateTime
235
+ The trailing "Z" designates UTC time and is mandatory.
236
+ Optional fractional seconds are allowed: 1995-12-31T23:59:59.999Z
237
+ All other components are mandatory.
238
+
239
+ Expressions can also be used to denote calculations that should be
240
+ performed relative to "NOW" to determine the value, ie...
241
+
242
+ NOW/HOUR
243
+ ... Round to the start of the current hour
244
+ NOW-1DAY
245
+ ... Exactly 1 day prior to now
246
+ NOW/DAY+6MONTHS+3DAYS
247
+ ... 6 months and 3 days in the future from the start of
248
+ the current day
249
+
250
+ -->
251
+ <!-- KD-tree versions of date fields -->
252
+ <fieldType name="pdate" class="solr.DatePointField"/>
253
+ <fieldType name="pdates" class="solr.DatePointField" multiValued="true"/>
254
+
255
+ <!--Binary data type. The data should be sent/retrieved in as Base64 encoded Strings -->
256
+ <fieldType name="binary" class="solr.BinaryField"/>
257
+
258
+ <!--
259
+ RankFields can be used to store scoring factors to improve document ranking. They should be used
260
+ in combination with RankQParserPlugin.
261
+ (experimental)
262
+ -->
263
+ <fieldType name="rank" class="solr.RankField"/>
264
+
265
+ <!-- solr.TextField allows the specification of custom text analyzers
266
+ specified as a tokenizer and a list of token filters. Different
267
+ analyzers may be specified for indexing and querying.
268
+
269
+ The optional positionIncrementGap puts space between multiple fields of
270
+ this type on the same document, with the purpose of preventing false phrase
271
+ matching across fields.
272
+
273
+ For more info on customizing your analyzer chain, please see
274
+ https://solr.apache.org/guide/solr/latest/indexing-guide/document-analysis.html#using-analyzers-tokenizers-and-filters
275
+ -->
276
+
277
+ <!-- One can also specify an existing Analyzer class that has a
278
+ default constructor via the class attribute on the analyzer element.
279
+ Example:
280
+ <fieldType name="text_greek" class="solr.TextField">
281
+ <analyzer class="org.apache.lucene.analysis.el.GreekAnalyzer"/>
282
+ </fieldType>
283
+ -->
284
+
285
+ <!-- A text field that only splits on whitespace for exact matching of words -->
286
+ <dynamicField name="*_ws" type="text_ws" indexed="true" stored="true"/>
287
+ <fieldType name="text_ws" class="solr.TextField" positionIncrementGap="100">
288
+ <analyzer>
289
+ <tokenizer name="whitespace"/>
290
+ </analyzer>
291
+ </fieldType>
292
+
293
+ <!-- A general text field that has reasonable, generic
294
+ cross-language defaults: it tokenizes with StandardTokenizer,
295
+ removes stop words from case-insensitive "stopwords.txt"
296
+ (empty by default), and down cases. At query time only, it
297
+ also applies synonyms.
298
+ -->
299
+ <fieldType name="text_general" class="solr.TextField" positionIncrementGap="100" multiValued="true">
300
+ <analyzer type="index">
301
+ <tokenizer name="standard"/>
302
+ <!-- in this example, we will only use synonyms at query time
303
+ <filter name="synonymGraph" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
304
+ <filter name="flattenGraph"/>
305
+ -->
306
+ <filter name="lowercase"/>
307
+ </analyzer>
308
+ <analyzer type="query">
309
+ <tokenizer name="standard"/>
310
+ <filter name="lowercase"/>
311
+ </analyzer>
312
+ </fieldType>
313
+
314
+ <dynamicField name="*_phon_en" type="phonetic_en" indexed="true" stored="true"/>
315
+ <fieldType name="phonetic_en" stored="false" indexed="true" class="solr.TextField" >
316
+ <analyzer>
317
+ <tokenizer name="standard"/>
318
+ <filter name="doubleMetaphone" inject="false"/>
319
+ </analyzer>
320
+ </fieldType>
321
+
322
+ <!-- lowercases the entire field value, keeping it as a single token. -->
323
+ <dynamicField name="*_s_lower" type="lowercase" indexed="true" stored="true"/>
324
+ <fieldType name="lowercase" class="solr.TextField" positionIncrementGap="100">
325
+ <analyzer>
326
+ <tokenizer name="keyword"/>
327
+ <filter name="lowercase" />
328
+ </analyzer>
329
+ </fieldType>
330
+
331
+ <!--
332
+ Example of using PathHierarchyTokenizerFactory at index time, so
333
+ queries for paths match documents at that path, or in descendent paths
334
+ -->
335
+ <dynamicField name="*_descendent_path" type="descendent_path" indexed="true" stored="true"/>
336
+ <fieldType name="descendent_path" class="solr.TextField">
337
+ <analyzer type="index">
338
+ <tokenizer name="pathHierarchy" delimiter="/" />
339
+ </analyzer>
340
+ <analyzer type="query">
341
+ <tokenizer name="keyword" />
342
+ </analyzer>
343
+ </fieldType>
344
+
345
+ <!--
346
+ Example of using PathHierarchyTokenizerFactory at query time, so
347
+ queries for paths match documents at that path, or in ancestor paths
348
+ -->
349
+ <dynamicField name="*_ancestor_path" type="ancestor_path" indexed="true" stored="true"/>
350
+ <fieldType name="ancestor_path" class="solr.TextField">
351
+ <analyzer type="index">
352
+ <tokenizer name="keyword" />
353
+ </analyzer>
354
+ <analyzer type="query">
355
+ <tokenizer name="pathHierarchy" delimiter="/" />
356
+ </analyzer>
357
+ </fieldType>
358
+
359
+ <!-- This point type indexes the coordinates as separate fields (subFields)
360
+ If subFieldType is defined, it references a type, and a dynamic field
361
+ definition is created matching *___<typename>. Alternately, if
362
+ subFieldSuffix is defined, that is used to create the subFields.
363
+ Example: if subFieldType="double", then the coordinates would be
364
+ indexed in fields myloc_0___double,myloc_1___double.
365
+ Example: if subFieldSuffix="_d" then the coordinates would be indexed
366
+ in fields myloc_0_d,myloc_1_d
367
+ The subFields are an implementation detail of the fieldType, and end
368
+ users normally should not need to know about them.
369
+ -->
370
+ <dynamicField name="*_point" type="point" indexed="true" stored="true"/>
371
+ <fieldType name="point" class="solr.PointType" dimension="2" subFieldSuffix="_d"/>
372
+
373
+ <!-- A specialized field for geospatial search filters and distance sorting. -->
374
+ <fieldType name="location" class="solr.LatLonPointSpatialField"/>
375
+
376
+ <!-- A geospatial field type that supports multiValued and polygon shapes.
377
+ For more information about this and other spatial fields see:
378
+ https://solr.apache.org/guide/solr/latest/query-guide/spatial-search.html
379
+ -->
380
+ <fieldType name="location_rpt" class="solr.SpatialRecursivePrefixTreeFieldType"
381
+ geo="true" distErrPct="0.025" maxDistErr="0.001" distanceUnits="kilometers" />
382
+
383
+ <!-- Payloaded field types -->
384
+ <fieldType name="delimited_payloads_float" stored="false" indexed="true" class="solr.TextField">
385
+ <analyzer>
386
+ <tokenizer name="whitespace"/>
387
+ <filter name="delimitedPayload" encoder="float"/>
388
+ </analyzer>
389
+ </fieldType>
390
+ <fieldType name="delimited_payloads_int" stored="false" indexed="true" class="solr.TextField">
391
+ <analyzer>
392
+ <tokenizer name="whitespace"/>
393
+ <filter name="delimitedPayload" encoder="integer"/>
394
+ </analyzer>
395
+ </fieldType>
396
+ <fieldType name="delimited_payloads_string" stored="false" indexed="true" class="solr.TextField">
397
+ <analyzer>
398
+ <tokenizer name="whitespace"/>
399
+ <filter name="delimitedPayload" encoder="identity"/>
400
+ </analyzer>
401
+ </fieldType>
402
+ </schema>
@@ -0,0 +1 @@
1
+ {"initArgs":{},"managedList":[]}
@@ -0,0 +1,67 @@
1
+ <?xml version="1.0" ?>
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
+ <!-- Example exchange rates file for CurrencyField type named "currency" in example schema -->
20
+
21
+ <currencyConfig version="1.0">
22
+ <rates>
23
+ <!-- Updated from http://www.exchangerate.com/ at 2011-09-27 -->
24
+ <rate from="USD" to="ARS" rate="4.333871" comment="ARGENTINA Peso" />
25
+ <rate from="USD" to="AUD" rate="1.025768" comment="AUSTRALIA Dollar" />
26
+ <rate from="USD" to="EUR" rate="0.743676" comment="European Euro" />
27
+ <rate from="USD" to="BRL" rate="1.881093" comment="BRAZIL Real" />
28
+ <rate from="USD" to="CAD" rate="1.030815" comment="CANADA Dollar" />
29
+ <rate from="USD" to="CLP" rate="519.0996" comment="CHILE Peso" />
30
+ <rate from="USD" to="CNY" rate="6.387310" comment="CHINA Yuan" />
31
+ <rate from="USD" to="CZK" rate="18.47134" comment="CZECH REP. Koruna" />
32
+ <rate from="USD" to="DKK" rate="5.515436" comment="DENMARK Krone" />
33
+ <rate from="USD" to="HKD" rate="7.801922" comment="HONG KONG Dollar" />
34
+ <rate from="USD" to="HUF" rate="215.6169" comment="HUNGARY Forint" />
35
+ <rate from="USD" to="ISK" rate="118.1280" comment="ICELAND Krona" />
36
+ <rate from="USD" to="INR" rate="49.49088" comment="INDIA Rupee" />
37
+ <rate from="USD" to="XDR" rate="0.641358" comment="INTNL MON. FUND SDR" />
38
+ <rate from="USD" to="ILS" rate="3.709739" comment="ISRAEL Sheqel" />
39
+ <rate from="USD" to="JPY" rate="76.32419" comment="JAPAN Yen" />
40
+ <rate from="USD" to="KRW" rate="1169.173" comment="KOREA (SOUTH) Won" />
41
+ <rate from="USD" to="KWD" rate="0.275142" comment="KUWAIT Dinar" />
42
+ <rate from="USD" to="MXN" rate="13.85895" comment="MEXICO Peso" />
43
+ <rate from="USD" to="NZD" rate="1.285159" comment="NEW ZEALAND Dollar" />
44
+ <rate from="USD" to="NOK" rate="5.859035" comment="NORWAY Krone" />
45
+ <rate from="USD" to="PKR" rate="87.57007" comment="PAKISTAN Rupee" />
46
+ <rate from="USD" to="PEN" rate="2.730683" comment="PERU Sol" />
47
+ <rate from="USD" to="PHP" rate="43.62039" comment="PHILIPPINES Peso" />
48
+ <rate from="USD" to="PLN" rate="3.310139" comment="POLAND Zloty" />
49
+ <rate from="USD" to="RON" rate="3.100932" comment="ROMANIA Leu" />
50
+ <rate from="USD" to="RUB" rate="32.14663" comment="RUSSIA Ruble" />
51
+ <rate from="USD" to="SAR" rate="3.750465" comment="SAUDI ARABIA Riyal" />
52
+ <rate from="USD" to="SGD" rate="1.299352" comment="SINGAPORE Dollar" />
53
+ <rate from="USD" to="ZAR" rate="8.329761" comment="SOUTH AFRICA Rand" />
54
+ <rate from="USD" to="SEK" rate="6.883442" comment="SWEDEN Krona" />
55
+ <rate from="USD" to="CHF" rate="0.906035" comment="SWITZERLAND Franc" />
56
+ <rate from="USD" to="TWD" rate="30.40283" comment="TAIWAN Dollar" />
57
+ <rate from="USD" to="THB" rate="30.89487" comment="THAILAND Baht" />
58
+ <rate from="USD" to="AED" rate="3.672955" comment="U.A.E. Dirham" />
59
+ <rate from="USD" to="UAH" rate="7.988582" comment="UKRAINE Hryvnia" />
60
+ <rate from="USD" to="GBP" rate="0.647910" comment="UNITED KINGDOM Pound" />
61
+
62
+ <!-- Cross-rates for some common currencies -->
63
+ <rate from="EUR" to="GBP" rate="0.869914" />
64
+ <rate from="EUR" to="NOK" rate="7.800095" />
65
+ <rate from="GBP" to="NOK" rate="8.966508" />
66
+ </rates>
67
+ </currencyConfig>