Browse files

Merge branch 'v1'

Conflicts:
	HISTORY
  • Loading branch information...
2 parents e83018c + 10c4c29 commit b905a6e359afc241e7ff1b915284f8096b1c9b2e @pat committed Sep 15, 2012
Showing with 11 additions and 4 deletions.
  1. +6 −0 HISTORY
  2. +1 −0 lib/thinking_sphinx.rb
  3. +1 −1 lib/thinking_sphinx/search.rb
  4. +3 −3 spec/thinking_sphinx/search_spec.rb
View
6 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.
View
1 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'
View
2 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
View
6 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)

0 comments on commit b905a6e

Please sign in to comment.