sunspot 0.10.2 → 0.10.3
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.
- data/History.txt +4 -0
- data/README.rdoc +1 -2
- data/VERSION.yml +1 -1
- data/lib/sunspot/query/highlighting.rb +2 -2
- data/lib/sunspot/query/local.rb +3 -0
- data/spec/api/query/highlighting_spec.rb +2 -2
- data/spec/api/query/local_spec.rb +8 -0
- metadata +2 -2
data/History.txt
CHANGED
data/README.rdoc
CHANGED
data/VERSION.yml
CHANGED
@@ -27,8 +27,8 @@ module Sunspot
|
|
27
27
|
if fragment_size = @options[:fragment_size]
|
28
28
|
params[:"hl.fragsize"] = fragment_size
|
29
29
|
end
|
30
|
-
if @options[:
|
31
|
-
params[:"hl.
|
30
|
+
if @options[:merge_contiguous_fragments]
|
31
|
+
params[:"hl.mergeContiguous"] = 'true'
|
32
32
|
end
|
33
33
|
if @options[:phrase_highlighter]
|
34
34
|
params[:"hl.usePhraseHighlighter"] = 'true'
|
data/lib/sunspot/query/local.rb
CHANGED
@@ -8,6 +8,9 @@ module Sunspot
|
|
8
8
|
#
|
9
9
|
class Local #:nodoc:
|
10
10
|
def initialize(coordinates, radius)
|
11
|
+
if radius < 1
|
12
|
+
raise ArgumentError, "LocalSolr does not seem to support a radius of less than 1 mile."
|
13
|
+
end
|
11
14
|
@coordinates, @radius = Util::Coordinates.new(coordinates), radius
|
12
15
|
end
|
13
16
|
|
@@ -105,11 +105,11 @@ describe 'highlighted fulltext queries', :type => :query do
|
|
105
105
|
it 'enables merging of continuous fragments' do
|
106
106
|
session.search(Post) do
|
107
107
|
keywords 'test' do
|
108
|
-
highlight :
|
108
|
+
highlight :merge_contiguous_fragments => true
|
109
109
|
end
|
110
110
|
end
|
111
111
|
connection.should have_last_search_with(
|
112
|
-
:"hl.
|
112
|
+
:"hl.mergeContiguous" => 'true'
|
113
113
|
)
|
114
114
|
end
|
115
115
|
|
@@ -51,4 +51,12 @@ describe 'local query' do
|
|
51
51
|
connection.should have_last_search_with(:lat => 40.7, :long => -73.5)
|
52
52
|
end
|
53
53
|
end
|
54
|
+
|
55
|
+
it 'raises ArgumentError if radius is less than 1' do
|
56
|
+
lambda do
|
57
|
+
session.search Post do
|
58
|
+
near [40, -70], 0.5
|
59
|
+
end
|
60
|
+
end.should raise_error(ArgumentError)
|
61
|
+
end
|
54
62
|
end
|
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: 0.10.
|
4
|
+
version: 0.10.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mat Brown
|
@@ -17,7 +17,7 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2009-10-
|
20
|
+
date: 2009-10-15 00:00:00 -04:00
|
21
21
|
default_executable:
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|