outoftime-sunspot 0.9.3 → 0.9.4

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
- :patch: 3
2
+ :patch: 4
3
3
  :major: 0
4
4
  :minor: 9
@@ -136,15 +136,15 @@ module Sunspot
136
136
  unless @value.nil?
137
137
  super
138
138
  else
139
- "-#{escape(@field.indexed_name)}:[* TO *]"
139
+ "#{escape(@field.indexed_name)}:[* TO *]"
140
140
  end
141
141
  end
142
142
 
143
- def to_negated_boolean_phrase
144
- unless @value.nil?
145
- super
143
+ def negated?
144
+ if @value.nil?
145
+ !super
146
146
  else
147
- "#{escape(@field.indexed_name)}:[* TO *]"
147
+ super
148
148
  end
149
149
  end
150
150
 
@@ -225,7 +225,7 @@ module Sunspot
225
225
  end
226
226
 
227
227
  def negate
228
- SameAs.new(@object, !@negated)
228
+ SameAs.new(@object, !negated?)
229
229
  end
230
230
  end
231
231
  end
@@ -383,6 +383,18 @@ describe 'Search' do
383
383
  )
384
384
  end
385
385
 
386
+ it 'should create a disjunction with empty restriction' do
387
+ session.search Post do
388
+ any_of do
389
+ with(:average_rating, nil)
390
+ with(:average_rating).greater_than(3.0)
391
+ end
392
+ end
393
+ connection.should have_last_search_with(
394
+ :fq => '-(average_rating_f:[* TO *] AND -average_rating_f:[3\.0 TO *])'
395
+ )
396
+ end
397
+
386
398
  it 'should restrict by dynamic string field with equality restriction' do
387
399
  session.search Post do
388
400
  dynamic :custom_string do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: outoftime-sunspot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3
4
+ version: 0.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mat Brown