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: 06d94f7de37bd42e2766b04b245a4529620124558e275e7f6a0aca6b905978ab
4
- data.tar.gz: 1966e3348ed17403862dc3d677225e2da0da85d62b6d1071f1c7ad7d9a3c423c
3
+ metadata.gz: f9749564050cadeb45de77d96ed183f7bb07a856b5199fea3bbede0365147e97
4
+ data.tar.gz: 5bdedfb6911ecbad36de8314822b536c6fb698e6432dcea03bd23be14672dcf7
5
5
  SHA512:
6
- metadata.gz: 93134646633877883e4b3ea6b6f8308f4c40d2806daf78a249816bf92dddf7ca80c0f06e48a12a5e85c84665e26fb0666d181a5b71ba8c88462ccd2a6160479e
7
- data.tar.gz: c31692b2cb14e5cae05ecc294f5d9ce7fb761d9712ad838a78f037eb3a107c03d05c13e6ef2f52055d32047a0fd9679ea044ac16156cf90c1464e510a3ee3fb0
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| solr_value v } * ' OR '})"
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
  #
@@ -1,3 +1,3 @@
1
1
  module Sunspot
2
- VERSION = '2.7.0'
2
+ VERSION = '2.7.1'
3
3
  end
@@ -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
@@ -1,4 +1,5 @@
1
1
  require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require 'uri'
2
3
 
3
4
  describe Sunspot::SessionProxy::Retry5xxSessionProxy do
4
5
 
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', '< 2.6'
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.0
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-06-07 00:00:00.000000000 Z
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: '2.6'
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: '2.6'
54
+ version: '3'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: pr_geohash
57
57
  requirement: !ruby/object:Gem::Requirement