diff --git a/HISTORY b/HISTORY index 4698ab3e0..62b72de09 100644 --- a/HISTORY +++ b/HISTORY @@ -1,3 +1,9 @@ +Edge: +* Use full query in excerpts so double-stemming of terms is avoided (Jason Rust). +* Fix thinking_sphinx:version rake task. +* Directly compare non-string non-nil facet values for facet filters. +* Don't bother checking with Sphinx whether documents exist when trying to update them. We're catching failures already (and Sphinx usually doesn't care anyway). + 2.0.13 - August 10th 2012 * 1.4.13 changes. diff --git a/lib/thinking_sphinx.rb b/lib/thinking_sphinx.rb index c2a7fb0c7..07cb51fe3 100644 --- a/lib/thinking_sphinx.rb +++ b/lib/thinking_sphinx.rb @@ -23,6 +23,7 @@ require 'thinking_sphinx/search' require 'thinking_sphinx/search_methods' require 'thinking_sphinx/deltas' +require 'thinking_sphinx/version' require 'thinking_sphinx/adapters/abstract_adapter' require 'thinking_sphinx/adapters/mysql_adapter' diff --git a/lib/thinking_sphinx/search.rb b/lib/thinking_sphinx/search.rb index c289b63bb..4077b63bd 100644 --- a/lib/thinking_sphinx/search.rb +++ b/lib/thinking_sphinx/search.rb @@ -362,7 +362,7 @@ def excerpt_for(string, model = nil) client.excerpts( { :docs => [string.to_s], - :words => results[:words].keys.join(' '), + :words => query, :index => index.split(',').first.strip }.merge(options[:excerpt_options] || {}) ).first diff --git a/spec/thinking_sphinx/search_spec.rb b/spec/thinking_sphinx/search_spec.rb index ee26e8f33..10a61144a 100644 --- a/spec/thinking_sphinx/search_spec.rb +++ b/spec/thinking_sphinx/search_spec.rb @@ -1309,7 +1309,7 @@ :matches => [], :words => {'one' => {}, 'two' => {}} }) - @search = ThinkingSphinx::Search.new(:classes => [Alpha]) + @search = ThinkingSphinx::Search.new('reading comprehension', :classes => [Alpha]) end it "should return the Sphinx excerpt value" do @@ -1341,9 +1341,9 @@ @search.excerpt_for('string', Beta) end - it "should join the words together" do + it "should use the query string" do @client.should_receive(:excerpts) do |options| - options[:words].should == @search.results[:words].keys.join(' ') + options[:words].should == 'reading comprehension' end @search.excerpt_for('string', Beta)