Skip to content

Commit

Permalink
Merge branch 'v1'
Browse files Browse the repository at this point in the history
Conflicts:
	HISTORY
  • Loading branch information
pat committed Sep 15, 2012
2 parents e83018c + 10c4c29 commit b905a6e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
6 changes: 6 additions & 0 deletions 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.

Expand Down
1 change: 1 addition & 0 deletions lib/thinking_sphinx.rb
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion lib/thinking_sphinx/search.rb
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions spec/thinking_sphinx/search_spec.rb
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit b905a6e

Please sign in to comment.