blacklight_range_limit 9.2.0 → 9.3.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.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +18 -8
- data/.solr_wrapper.yml +3 -1
- data/README.md +2 -1
- data/VERSION +1 -1
- data/app/components/blacklight_range_limit/range_input_component.html.erb +1 -0
- data/lib/blacklight_range_limit/range_limit_builder.rb +22 -7
- data/lib/blacklight_range_limit/segment_calculation.rb +48 -50
- data/lib/generators/blacklight_range_limit/assets_generator.rb +2 -2
- data/package.json +1 -1
- data/solr/conf/schema.xml +32 -18
- data/spec/test_app_templates/Gemfile.extra +5 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 795e8e6e2b3472dd8978285eabc633113251c2f14b9c59f506b13f9c3f0c402c
|
|
4
|
+
data.tar.gz: 53f4cc96793fea0579a7ebf85b44610d70dc9845594282cbd3f7034e7b6a9b60
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ca5b95998473a58142dfe87743ce359e18cc8272fb5e9fedf8ebddf0dab32ad673a1de5f5f0acbb01e85d9cfa9538b65f08ded53daddf0b3a7e0fabb95ed8095
|
|
7
|
+
data.tar.gz: 19c4558b8fded3636ef41e8f7bdfa1d2f31ddd553e85b9cb555172feb02bd6bc33c1096549513767ff75bdb015f0c8cfb42c65e78b71acc10f526536b690cbab
|
data/.github/workflows/ruby.yml
CHANGED
|
@@ -42,13 +42,13 @@ jobs:
|
|
|
42
42
|
# BLACKLIGHT EDGE, can test with latest rails, importmap and esbuild
|
|
43
43
|
#
|
|
44
44
|
|
|
45
|
-
- rails_version: "~> 8.1.0
|
|
45
|
+
- rails_version: "~> 8.1.0"
|
|
46
46
|
blacklight_version: 'https://github.com/projectblacklight/blacklight.git'
|
|
47
47
|
ruby: "3.3"
|
|
48
48
|
additional_name: "/ importmap-rails"
|
|
49
49
|
additional_engine_cart_rails_options: "--css=bootstrap"
|
|
50
50
|
|
|
51
|
-
- rails_version: "~> 8.1.0
|
|
51
|
+
- rails_version: "~> 8.1.0"
|
|
52
52
|
blacklight_version: 'https://github.com/projectblacklight/blacklight.git'
|
|
53
53
|
ruby: "3.3"
|
|
54
54
|
additional_name: "/ esbuild"
|
|
@@ -57,13 +57,13 @@ jobs:
|
|
|
57
57
|
# BLACKLIGHT 9 and with Rails 8 and 8.1
|
|
58
58
|
#
|
|
59
59
|
|
|
60
|
-
- rails_version: "~> 8.1.0
|
|
60
|
+
- rails_version: "~> 8.1.0"
|
|
61
61
|
blacklight_version: '~> 9.0'
|
|
62
62
|
ruby: "3.4"
|
|
63
63
|
additional_name: "/ importmap-rails"
|
|
64
64
|
additional_engine_cart_rails_options: "--css=bootstrap"
|
|
65
65
|
|
|
66
|
-
- rails_version: "~> 8.1.0
|
|
66
|
+
- rails_version: "~> 8.1.0"
|
|
67
67
|
blacklight_version: '~> 9.0'
|
|
68
68
|
ruby: "3.4"
|
|
69
69
|
additional_name: "/ esbuild"
|
|
@@ -85,13 +85,13 @@ jobs:
|
|
|
85
85
|
# BLACKLIGHT 8, can test with use importmaps and esbuild, also rails 8 and 8.1
|
|
86
86
|
# and a bit of 7.2
|
|
87
87
|
|
|
88
|
-
- rails_version: "~> 8.1.0
|
|
88
|
+
- rails_version: "~> 8.1.0"
|
|
89
89
|
blacklight_version: "~> 8.0"
|
|
90
90
|
ruby: "3.3"
|
|
91
91
|
additional_name: "/ importmap-rails, propshaft"
|
|
92
92
|
additional_engine_cart_rails_options: "-a propshaft --css=bootstrap"
|
|
93
93
|
|
|
94
|
-
- rails_version: "~> 8.1.0
|
|
94
|
+
- rails_version: "~> 8.1.0"
|
|
95
95
|
blacklight_version: "~> 8.0"
|
|
96
96
|
ruby: "3.3"
|
|
97
97
|
additional_engine_cart_rails_options: "-a propshaft --javascript=esbuild --css=bootstrap"
|
|
@@ -131,24 +131,31 @@ jobs:
|
|
|
131
131
|
|
|
132
132
|
|
|
133
133
|
# BLACKLIGHT 7, only test with esbuild, not sure if it supports importmaps, it won't generate it
|
|
134
|
+
# Blacklight 7 generator uses old `Bundler.with_clean_env`, so needs a bundler < 4. (there is no
|
|
135
|
+
# bundler 3!)
|
|
134
136
|
|
|
135
137
|
- rails_version: "7.2.1"
|
|
136
138
|
blacklight_version: "~> 7.0"
|
|
137
139
|
ruby: "3.3"
|
|
138
140
|
additional_engine_cart_rails_options: "--javascript=esbuild"
|
|
139
141
|
additional_name: "/ esbuild, sprockets"
|
|
142
|
+
bundler: "2.7.2"
|
|
140
143
|
|
|
144
|
+
# This combo failed on BL 7.42.0, and we didn't have the capacity to fix/support.
|
|
145
|
+
# https://github.com/projectblacklight/blacklight_range_limit/issues/339
|
|
141
146
|
- rails_version: "7.2.1"
|
|
142
|
-
blacklight_version: "
|
|
147
|
+
blacklight_version: "7.41.0"
|
|
143
148
|
ruby: "3.3"
|
|
144
149
|
additional_engine_cart_rails_options: "--javascript=esbuild --css=bootstrap -a propshaft"
|
|
145
150
|
additional_name: "/ esbuild, propshaft"
|
|
151
|
+
bundler: "2.7.2"
|
|
146
152
|
|
|
147
153
|
- rails_version: "7.1.4"
|
|
148
154
|
blacklight_version: "~> 7.0"
|
|
149
155
|
ruby: "3.2"
|
|
150
156
|
additional_engine_cart_rails_options: "--javascript=esbuild"
|
|
151
157
|
additional_name: "/ esbuild, sprockets"
|
|
158
|
+
bundler: "2.7.2"
|
|
152
159
|
|
|
153
160
|
|
|
154
161
|
env:
|
|
@@ -161,7 +168,10 @@ jobs:
|
|
|
161
168
|
uses: ruby/setup-ruby@v1
|
|
162
169
|
with:
|
|
163
170
|
ruby-version: ${{ matrix.ruby }}
|
|
164
|
-
bundler:
|
|
171
|
+
#bundler: ${{ matrix.bundler != '' && matrix.bundler || 'latest' }}
|
|
172
|
+
# Bundler locked to <4, see https://github.com/projectblacklight/blacklight_range_limit/pull/328
|
|
173
|
+
bundler: ${{ matrix.bundler != '' && matrix.bundler || '2.7.2' }}
|
|
174
|
+
|
|
165
175
|
|
|
166
176
|
- name: Install dependencies
|
|
167
177
|
run: bundle install
|
data/.solr_wrapper.yml
CHANGED
|
@@ -6,9 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
port: 8983
|
|
8
8
|
verbose: true
|
|
9
|
-
version: 9.
|
|
9
|
+
version: 9.10.1
|
|
10
10
|
<% ENV['CI'] && FileUtils.mkdir_p('ci_dl_solr_dist') %>
|
|
11
11
|
download_dir: <%= 'ci_dl_solr_dist' if ENV['CI'] %>
|
|
12
12
|
collection:
|
|
13
13
|
dir: solr/conf/
|
|
14
14
|
name: blacklight-core
|
|
15
|
+
env:
|
|
16
|
+
SOLR_OPTS: "-Dsolr.config.lib.enabled=true"
|
data/README.md
CHANGED
|
@@ -19,7 +19,8 @@ Decimal numbers and Dates are NOT supported; they theoretically could be in the
|
|
|
19
19
|
|
|
20
20
|
* Javascript requires you to be using either rails-importmaps or a package.json-based builder like jsbundling-rails or vite-ruby. Legacy "sprockets-only" is not supported, however propshaft or sprockets can be used as your base asset pipeline.
|
|
21
21
|
|
|
22
|
-
* Blacklight 7.0+. Rails 7.0
|
|
22
|
+
* Blacklight 7.0+. Rails 7.0+.
|
|
23
|
+
* Note blacklight 7.x >= 7.42.0 are no longer tested in CI, see https://github.com/projectblacklight/blacklight_range_limit/issues/339. They might still work.
|
|
23
24
|
|
|
24
25
|
|
|
25
26
|
# Installation
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
9.
|
|
1
|
+
9.3.0
|
|
@@ -47,15 +47,15 @@ module BlacklightRangeLimit
|
|
|
47
47
|
# Specified field and parameters are specified in incoming parameters
|
|
48
48
|
# range_field, range_start, range_end
|
|
49
49
|
def fetch_specific_range_limit(solr_params)
|
|
50
|
-
field_key =
|
|
50
|
+
field_key = _bl_range_limit_app_params[:range_field] # what field to fetch for
|
|
51
51
|
|
|
52
|
-
unless
|
|
53
|
-
|
|
52
|
+
unless _bl_range_limit_app_params[:range_start].present? && _bl_range_limit_app_params[:range_start].kind_of?(String) &&
|
|
53
|
+
_bl_range_limit_app_params[:range_end].present? && _bl_range_limit_app_params[:range_end].kind_of?(String)
|
|
54
54
|
raise BlacklightRangeLimit::InvalidRange
|
|
55
55
|
end
|
|
56
56
|
|
|
57
|
-
start =
|
|
58
|
-
finish =
|
|
57
|
+
start = _bl_range_limit_app_params[:range_start].to_i
|
|
58
|
+
finish = _bl_range_limit_app_params[:range_end].to_i
|
|
59
59
|
|
|
60
60
|
add_range_segments_to_solr!(solr_params, field_key, start, finish )
|
|
61
61
|
|
|
@@ -69,14 +69,29 @@ module BlacklightRangeLimit
|
|
|
69
69
|
return solr_params
|
|
70
70
|
rescue BlacklightRangeLimit::InvalidRange
|
|
71
71
|
# This will make Rails return a 400
|
|
72
|
-
raise ActionController::BadRequest, "invalid range_start (#{
|
|
72
|
+
raise ActionController::BadRequest, "invalid range_start (#{_bl_range_limit_app_params[:range_start]}) or range_end (#{_bl_range_limit_app_params[:range_end]})"
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
bl_version = Gem.loaded_specs["blacklight"]&.version
|
|
76
|
+
|
|
77
|
+
# get the query params correct way for old or newer blacklight
|
|
78
|
+
#
|
|
79
|
+
# https://github.com/projectblacklight/blacklight/pull/3851
|
|
80
|
+
# https://github.com/projectblacklight/blacklight/pull/3849
|
|
81
|
+
if bl_version && bl_version < Gem::Version.new("9.1.0")
|
|
82
|
+
def _bl_range_limit_app_params
|
|
83
|
+
blacklight_params
|
|
84
|
+
end
|
|
85
|
+
else
|
|
86
|
+
def _bl_range_limit_app_params
|
|
87
|
+
search_state.params
|
|
88
|
+
end
|
|
73
89
|
end
|
|
74
90
|
|
|
75
91
|
# hacky polyfill for new Blacklight behavior we need, if we don't have it yet
|
|
76
92
|
#
|
|
77
93
|
# https://github.com/projectblacklight/blacklight/pull/3213
|
|
78
94
|
# https://github.com/projectblacklight/blacklight/pull/3443
|
|
79
|
-
bl_version = Gem.loaded_specs["blacklight"]&.version
|
|
80
95
|
if bl_version && (bl_version <= Gem::Version.new("8.6.1"))
|
|
81
96
|
def facet_value_to_fq_string(facet_field, value, use_local_params: true)
|
|
82
97
|
facet_config = blacklight_config.facet_fields[facet_field]
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# Meant to be in a Controller, included in our ControllerOverride module.
|
|
2
2
|
module BlacklightRangeLimit
|
|
3
3
|
module SegmentCalculation
|
|
4
|
-
|
|
5
4
|
protected
|
|
6
5
|
|
|
7
6
|
# Calculates segment facets within a given start and end on a given
|
|
@@ -12,7 +11,8 @@ module BlacklightRangeLimit
|
|
|
12
11
|
#
|
|
13
12
|
# Changes solr_params passed in.
|
|
14
13
|
def add_range_segments_to_solr!(solr_params, facet_field, min, max)
|
|
15
|
-
raise InvalidRange,
|
|
14
|
+
raise InvalidRange, 'The min date must be before the max date' if min > max
|
|
15
|
+
|
|
16
16
|
field_config = blacklight_config.facet_fields[facet_field.to_s]
|
|
17
17
|
|
|
18
18
|
return solr_params unless field_config
|
|
@@ -26,7 +26,7 @@ module BlacklightRangeLimit
|
|
|
26
26
|
# Now make the boundaries into actual filter.queries.
|
|
27
27
|
0.upto(boundaries.length - 2) do |index|
|
|
28
28
|
first = boundaries[index]
|
|
29
|
-
last = boundaries[index+1].to_i - 1
|
|
29
|
+
last = boundaries[index + 1].to_i - 1
|
|
30
30
|
|
|
31
31
|
solr_params[:"facet.query"] << "#{field_config.field}:[#{first} TO #{last}]"
|
|
32
32
|
end
|
|
@@ -43,7 +43,8 @@ module BlacklightRangeLimit
|
|
|
43
43
|
# be turned into inclusive ranges, the FINAL boundary will be one
|
|
44
44
|
# unit more than the actual end of the last range later computed.
|
|
45
45
|
def boundaries_for_range_facets(first, last, num_div)
|
|
46
|
-
raise ArgumentError,
|
|
46
|
+
raise ArgumentError, 'The first date must be before the last date' if last < first
|
|
47
|
+
|
|
47
48
|
# arithmetic issues require last to be one more than the actual
|
|
48
49
|
# last value included in our inclusive range
|
|
49
50
|
last += 1
|
|
@@ -54,58 +55,55 @@ module BlacklightRangeLimit
|
|
|
54
55
|
|
|
55
56
|
# Don't know what most of these variables mean, just copying
|
|
56
57
|
# from Flot.
|
|
57
|
-
dec = -1 *
|
|
58
|
-
magn = (10
|
|
59
|
-
norm =
|
|
58
|
+
dec = -1 * Math.log10(delta).floor
|
|
59
|
+
magn = (10**(-1 * dec)).to_f
|
|
60
|
+
norm = magn == 0 ? delta : (delta / magn) # norm is between 1.0 and 10.0
|
|
60
61
|
|
|
61
62
|
size = 10
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
63
|
+
if norm < 1.5
|
|
64
|
+
size = 1
|
|
65
|
+
elsif norm < 3
|
|
66
|
+
size = 2
|
|
67
|
+
# special case for 2.5, requires an extra decimal
|
|
68
|
+
if norm > 2.25
|
|
69
|
+
size = 2.5
|
|
70
|
+
dec + 1
|
|
71
|
+
end
|
|
72
|
+
elsif norm < 7.5
|
|
73
|
+
size = 5
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
size *= magn
|
|
77
|
+
|
|
78
|
+
boundaries = []
|
|
79
|
+
|
|
80
|
+
start = floorInBase(first, size)
|
|
81
|
+
i = 0
|
|
82
|
+
v = Float::MAX
|
|
83
|
+
prev = nil
|
|
84
|
+
begin
|
|
85
|
+
prev = v
|
|
86
|
+
v = start + i * size
|
|
87
|
+
boundaries.push(v.to_i)
|
|
88
|
+
i += 1
|
|
89
|
+
end while (v < last && v != prev)
|
|
90
|
+
|
|
91
|
+
# Can create dups for small ranges, tighten up
|
|
92
|
+
boundaries.uniq!
|
|
93
|
+
|
|
94
|
+
# That algorithm i don't entirely understand will sometimes
|
|
95
|
+
# extend past our first and last, tighten it up and make sure
|
|
96
|
+
# first and last are endpoints.
|
|
97
|
+
boundaries.delete_if { |b| b <= first || b >= last }
|
|
98
|
+
boundaries.unshift(first)
|
|
99
|
+
boundaries.push(last)
|
|
100
|
+
|
|
101
|
+
boundaries
|
|
101
102
|
end
|
|
102
103
|
|
|
103
104
|
# Cribbed from Flot. Round to nearby lower multiple of base
|
|
104
105
|
def floorInBase(n, base)
|
|
105
|
-
|
|
106
|
+
base * (n / base).floor
|
|
106
107
|
end
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
108
|
end
|
|
111
109
|
end
|
|
@@ -77,9 +77,9 @@ module BlacklightRangeLimit
|
|
|
77
77
|
# chart.js is dependency of blacklight-range-limit, currently is not working
|
|
78
78
|
# as vendored importmaps, but instead must be pinned to CDN. You may want to update
|
|
79
79
|
# versions perioidically.
|
|
80
|
-
pin "chart.js", to: "https://
|
|
80
|
+
pin "chart.js", to: "https://cdn.jsdelivr.net/npm/chart.js@4.5.1/+esm"
|
|
81
81
|
# single dependency of chart.js:
|
|
82
|
-
pin "@kurkle/color", to: "https://
|
|
82
|
+
pin "@kurkle/color", to: "https://cdn.jsdelivr.net/npm/@kurkle/color@0.4.0/dist/color.esm.min.js"
|
|
83
83
|
EOS
|
|
84
84
|
end
|
|
85
85
|
else
|
data/package.json
CHANGED
data/solr/conf/schema.xml
CHANGED
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
<dynamicField name="*_isi" type="int" stored="true" indexed="true" multiValued="false"/>
|
|
72
72
|
<dynamicField name="*_isim" type="int" stored="true" indexed="true" multiValued="true"/>
|
|
73
73
|
|
|
74
|
-
<!--
|
|
74
|
+
<!-- IntegerPointField (_it...) (for faster range queries) -->
|
|
75
75
|
|
|
76
76
|
<dynamicField name="*_iti" type="tint" stored="false" indexed="true" multiValued="false"/>
|
|
77
77
|
<dynamicField name="*_itim" type="tint" stored="false" indexed="true" multiValued="true"/>
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
<dynamicField name="*_dtsi" type="date" stored="true" indexed="true" multiValued="false"/>
|
|
94
94
|
<dynamicField name="*_dtsim" type="date" stored="true" indexed="true" multiValued="true"/>
|
|
95
95
|
|
|
96
|
-
<!--
|
|
96
|
+
<!-- DatePointField (_dtt...) (for faster range queries) -->
|
|
97
97
|
|
|
98
98
|
<dynamicField name="*_dtti" type="tdate" stored="false" indexed="true" multiValued="false"/>
|
|
99
99
|
<dynamicField name="*_dttim" type="tdate" stored="false" indexed="true" multiValued="true"/>
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
<dynamicField name="*_lsi" type="long" stored="true" indexed="true" multiValued="false"/>
|
|
114
114
|
<dynamicField name="*_lsim" type="long" stored="true" indexed="true" multiValued="true"/>
|
|
115
115
|
|
|
116
|
-
<!--
|
|
116
|
+
<!-- LongPointField (_lt...) (for faster range queries) -->
|
|
117
117
|
|
|
118
118
|
<dynamicField name="*_lti" type="tlong" stored="false" indexed="true" multiValued="false"/>
|
|
119
119
|
<dynamicField name="*_ltim" type="tlong" stored="false" indexed="true" multiValued="true"/>
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
<dynamicField name="*_dbsi" type="double" stored="true" indexed="true" multiValued="false"/>
|
|
134
134
|
<dynamicField name="*_dbsim" type="double" stored="true" indexed="true" multiValued="true"/>
|
|
135
135
|
|
|
136
|
-
<!--
|
|
136
|
+
<!-- DoublePointField (_dbt...) (for faster range queries) -->
|
|
137
137
|
|
|
138
138
|
<dynamicField name="*_dbti" type="tdouble" stored="false" indexed="true" multiValued="false"/>
|
|
139
139
|
<dynamicField name="*_dbtim" type="tdouble" stored="false" indexed="true" multiValued="true"/>
|
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
<dynamicField name="*_fsi" type="float" stored="true" indexed="true" multiValued="false"/>
|
|
154
154
|
<dynamicField name="*_fsim" type="float" stored="true" indexed="true" multiValued="true"/>
|
|
155
155
|
|
|
156
|
-
<!--
|
|
156
|
+
<!-- FloatPointField (_ft...) (for faster range queries) -->
|
|
157
157
|
|
|
158
158
|
<dynamicField name="*_fti" type="tfloat" stored="false" indexed="true" multiValued="false"/>
|
|
159
159
|
<dynamicField name="*_ftim" type="tfloat" stored="false" indexed="true" multiValued="true"/>
|
|
@@ -175,6 +175,16 @@
|
|
|
175
175
|
<dynamicField name="*_coordinate" type="tdouble" indexed="true" stored="false" />
|
|
176
176
|
|
|
177
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
|
+
|
|
178
188
|
<dynamicField name="*_srpt" type="location_rpt" stored="true" indexed="true" multiValued="true" />
|
|
179
189
|
<dynamicField name="*_bbox" type="bbox" stored="true" indexed="true" />
|
|
180
190
|
|
|
@@ -221,23 +231,23 @@
|
|
|
221
231
|
<fieldType name="rand" class="solr.RandomSortField" omitNorms="true"/>
|
|
222
232
|
|
|
223
233
|
<!-- Default numeric field types. -->
|
|
224
|
-
<fieldType name="int" class="solr.
|
|
225
|
-
<fieldType name="float" class="solr.
|
|
226
|
-
<fieldType name="long" class="solr.
|
|
227
|
-
<fieldType name="double" class="solr.
|
|
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"/>
|
|
228
238
|
|
|
229
|
-
<!--
|
|
230
|
-
<fieldType name="tint" class="solr.
|
|
231
|
-
<fieldType name="tfloat" class="solr.
|
|
232
|
-
<fieldType name="tlong" class="solr.
|
|
233
|
-
<fieldType name="tdouble" class="solr.
|
|
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"/>
|
|
234
244
|
|
|
235
245
|
<!-- The format for this date field is of the form 1995-12-31T23:59:59Z
|
|
236
246
|
Optional fractional seconds are allowed: 1995-12-31T23:59:59.999Z
|
|
237
247
|
-->
|
|
238
|
-
<fieldType name="date" class="solr.
|
|
239
|
-
<!-- A
|
|
240
|
-
<fieldType name="tdate" class="solr.
|
|
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"/>
|
|
241
251
|
|
|
242
252
|
|
|
243
253
|
<!-- This point type indexes the coordinates as separate fields (subFields)
|
|
@@ -253,6 +263,9 @@
|
|
|
253
263
|
-->
|
|
254
264
|
<fieldType name="point" class="solr.PointType" dimension="2" subFieldSuffix="_d"/>
|
|
255
265
|
|
|
266
|
+
<!-- A specialized field for geospatial search filters and distance sorting. -->
|
|
267
|
+
<fieldType name="location" class="solr.LatLonPointSpatialField" docValues="true"/>
|
|
268
|
+
|
|
256
269
|
<!-- An alternative geospatial field type new to Solr 4. It supports multiValued and polygon shapes.
|
|
257
270
|
For more information about this and other Spatial fields new to Solr 4, see:
|
|
258
271
|
http://wiki.apache.org/solr/SolrAdaptersForLuceneSpatial4
|
|
@@ -263,7 +276,7 @@
|
|
|
263
276
|
<field name="bbox" type="bbox" />
|
|
264
277
|
<fieldType name="bbox" class="solr.BBoxField"
|
|
265
278
|
geo="true" distanceUnits="kilometers" numberType="_bbox_coord" storeSubFields="false"/>
|
|
266
|
-
<fieldType name="_bbox_coord" class="solr.
|
|
279
|
+
<fieldType name="_bbox_coord" class="solr.DoublePointField" docValues="true" stored="false"/>
|
|
267
280
|
|
|
268
281
|
<fieldType name="text" class="solr.TextField" omitNorms="false">
|
|
269
282
|
<analyzer>
|
|
@@ -373,3 +386,4 @@
|
|
|
373
386
|
</types>
|
|
374
387
|
|
|
375
388
|
</schema>
|
|
389
|
+
|
|
@@ -8,3 +8,8 @@ if ENV['BLACKLIGHT_VERSION']
|
|
|
8
8
|
end
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
+
|
|
12
|
+
# pin json to less than 3 in Gemfile until Rails has some releases that work
|
|
13
|
+
# with json 3, at which point we can relax for versions that can handle it
|
|
14
|
+
# https://github.com/rails/rails/pull/58601
|
|
15
|
+
gem "json", "< 3"
|