sunspot 0.10.4 → 0.10.5
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +3 -0
- data/VERSION.yml +1 -1
- data/lib/sunspot.rb +1 -1
- data/lib/sunspot/composite_setup.rb +8 -4
- data/spec/api/query/highlighting_spec.rb +9 -0
- metadata +2 -2
data/History.txt
CHANGED
data/VERSION.yml
CHANGED
data/lib/sunspot.rb
CHANGED
@@ -49,10 +49,14 @@ module Sunspot
|
|
49
49
|
# If no field with that name is configured for any of the enclosed types.
|
50
50
|
#
|
51
51
|
def text_fields(field_name)
|
52
|
-
text_fields_hash[field_name.to_sym]
|
53
|
-
|
54
|
-
|
55
|
-
|
52
|
+
if text_fields = text_fields_hash[field_name.to_sym]
|
53
|
+
text_fields.to_a
|
54
|
+
else
|
55
|
+
raise(
|
56
|
+
UnrecognizedFieldError,
|
57
|
+
"No text field configured for #{@types * ', '} with name '#{field_name}'"
|
58
|
+
)
|
59
|
+
end
|
56
60
|
end
|
57
61
|
|
58
62
|
#
|
@@ -48,6 +48,15 @@ describe 'highlighted fulltext queries', :type => :query do
|
|
48
48
|
connection.should have_last_search_with(:hl => 'on', :'hl.fl' => %w(title_text body_texts))
|
49
49
|
end
|
50
50
|
|
51
|
+
it 'should enable highlighting on multiple fields for multiple search types' do
|
52
|
+
session.search(Post, Namespaced::Comment) do
|
53
|
+
keywords 'test' do
|
54
|
+
highlight :body
|
55
|
+
end
|
56
|
+
end
|
57
|
+
connection.searches.last[:'hl.fl'].to_set.should == Set['body_text', 'body_texts']
|
58
|
+
end
|
59
|
+
|
51
60
|
it 'should raise UnrecognizedFieldError if try to highlight unexisting field via block call' do
|
52
61
|
lambda {
|
53
62
|
session.search(Post) do
|
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.5
|
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-22 00:00:00 -04:00
|
21
21
|
default_executable:
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|