sunspot 2.7.0 → 2.7.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9749564050cadeb45de77d96ed183f7bb07a856b5199fea3bbede0365147e97
|
4
|
+
data.tar.gz: 5bdedfb6911ecbad36de8314822b536c6fb698e6432dcea03bd23be14672dcf7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1850a3b888c9589cb98878344d76d95882ebd95f8aae56095767a0ed3b49787a1c65cb5f1c3c84406afcc2c8cf8da4d533434b9e2850c3bd635a4417d45c14e4
|
7
|
+
data.tar.gz: 5d1a20b95d6f11caab821b186952d05e3c68a86b7e23bf673f451b23fa0429df0f4113e2a91cd12c50617375456b00d41656c7b5c7d402450b08e5df22b69b89
|
data/lib/sunspot/field.rb
CHANGED
@@ -243,6 +243,8 @@ module Sunspot
|
|
243
243
|
end
|
244
244
|
|
245
245
|
class TypeField #:nodoc:
|
246
|
+
MODULAR_MODEL_MARK = '\:\:'
|
247
|
+
|
246
248
|
class <<self
|
247
249
|
def instance
|
248
250
|
@instance ||= new
|
@@ -256,6 +258,10 @@ module Sunspot
|
|
256
258
|
def to_indexed(clazz)
|
257
259
|
clazz.name
|
258
260
|
end
|
261
|
+
|
262
|
+
def to_solr_conditional(value)
|
263
|
+
value.include?(MODULAR_MODEL_MARK) ? "\"#{value}\"" : value
|
264
|
+
end
|
259
265
|
end
|
260
266
|
|
261
267
|
class IdField #:nodoc:
|
@@ -317,9 +317,14 @@ module Sunspot
|
|
317
317
|
if @value.empty?
|
318
318
|
"[* TO *]"
|
319
319
|
else
|
320
|
-
"(#{@value.map { |v|
|
320
|
+
"(#{@value.map { |v| to_solr_conditional_per_value v } * ' OR '})"
|
321
321
|
end
|
322
322
|
end
|
323
|
+
|
324
|
+
def to_solr_conditional_per_value(v)
|
325
|
+
@field.respond_to?(:to_solr_conditional) ?
|
326
|
+
@field.to_solr_conditional(solr_value(v)) : "#{solr_value(v)}"
|
327
|
+
end
|
323
328
|
end
|
324
329
|
|
325
330
|
#
|
data/lib/sunspot/version.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
describe 'typed query' do
|
2
2
|
it 'properly escapes namespaced type names' do
|
3
3
|
session.search(Namespaced::Comment)
|
4
|
-
expect(connection).to have_last_search_with(:fq => ['type:Namespaced\:\:Comment'])
|
4
|
+
expect(connection).to have_last_search_with(:fq => ['type:"Namespaced\:\:Comment"'])
|
5
5
|
end
|
6
6
|
|
7
7
|
it 'builds search for multiple types' do
|
8
8
|
session.search(Post, Namespaced::Comment)
|
9
|
-
expect(connection).to have_last_search_with(:fq => ['type:(Post OR Namespaced\:\:Comment)'])
|
9
|
+
expect(connection).to have_last_search_with(:fq => ['type:(Post OR "Namespaced\:\:Comment")'])
|
10
10
|
end
|
11
11
|
|
12
12
|
it 'searches type of subclass when superclass is configured' do
|
data/sunspot.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |s|
|
|
25
25
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
26
26
|
s.require_paths = ["lib"]
|
27
27
|
|
28
|
-
s.add_dependency 'rsolr', '>= 1.1.1', '<
|
28
|
+
s.add_dependency 'rsolr', '>= 1.1.1', '< 3'
|
29
29
|
s.add_dependency 'pr_geohash', '~>1.0'
|
30
30
|
s.add_dependency 'bigdecimal'
|
31
31
|
s.add_development_dependency 'rake', '~> 13.2'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sunspot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.7.
|
4
|
+
version: 2.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mat Brown
|
@@ -30,7 +30,7 @@ authors:
|
|
30
30
|
autorequire:
|
31
31
|
bindir: bin
|
32
32
|
cert_chain: []
|
33
|
-
date: 2024-
|
33
|
+
date: 2024-07-16 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: rsolr
|
@@ -41,7 +41,7 @@ dependencies:
|
|
41
41
|
version: 1.1.1
|
42
42
|
- - "<"
|
43
43
|
- !ruby/object:Gem::Version
|
44
|
-
version: '
|
44
|
+
version: '3'
|
45
45
|
type: :runtime
|
46
46
|
prerelease: false
|
47
47
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -51,7 +51,7 @@ dependencies:
|
|
51
51
|
version: 1.1.1
|
52
52
|
- - "<"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '3'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: pr_geohash
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|