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 CHANGED
@@ -1,3 +1,6 @@
1
+ == 0.10.5 2009-10-22
2
+ * Fix highlighting for multiple-model search
3
+
1
4
  == 0.10.4 2009-10-20
2
5
  * Add adjust_params method, allowing experts to manually edit Solr params
3
6
  * Track adds and deletes separately in session, and expose delete_dirty? method
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :minor: 10
3
- :patch: 4
3
+ :patch: 5
4
4
  :major: 0
data/lib/sunspot.rb CHANGED
@@ -323,7 +323,7 @@ module Sunspot
323
323
  #
324
324
  # objects...<Object>:: Objects to remove from the index
325
325
  #
326
- def remove!
326
+ def remove!(*objects)
327
327
  session.remove!(*objects)
328
328
  end
329
329
 
@@ -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] || raise(
53
- UnrecognizedFieldError,
54
- "No text field configured for #{@types * ', '} with name '#{field_name}'"
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
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 00:00:00 -04:00
20
+ date: 2009-10-22 00:00:00 -04:00
21
21
  default_executable:
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency