aboutsummaryrefslogtreecommitdiffstats
path: root/spec/integration/xapian_search_highlighting_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/integration/xapian_search_highlighting_spec.rb')
-rw-r--r--spec/integration/xapian_search_highlighting_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/integration/xapian_search_highlighting_spec.rb b/spec/integration/xapian_search_highlighting_spec.rb
index 7bd64c995..65a34cf91 100644
--- a/spec/integration/xapian_search_highlighting_spec.rb
+++ b/spec/integration/xapian_search_highlighting_spec.rb
@@ -26,4 +26,14 @@ describe 'highlighting search results' do
highlight_matches(phrase, matches).should == '<mark>department</mark>'
end
+ it 'highlights stemmed words even if the stem is unhelpful' do
+ # Stemming returns 'bore' as the word to highlight which can't be
+ # matched in the original phrase.
+ phrase = 'boring'
+ search = ActsAsXapian::Search.new([PublicBody], phrase, :limit => 1)
+ matches = search.words_to_highlight(:regex => true, :include_original => true)
+
+ highlight_matches(phrase, matches).should == '<mark>boring</mark>'
+ end
+
end