From 4d9c89d0e416825eb52a720d74230f547454ba31 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 30 May 2014 15:48:10 +0100 Subject: Use regex based highlighting --- spec/controllers/general_controller_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spec/controllers/general_controller_spec.rb') diff --git a/spec/controllers/general_controller_spec.rb b/spec/controllers/general_controller_spec.rb index 7590a5b42..f9c307913 100644 --- a/spec/controllers/general_controller_spec.rb +++ b/spec/controllers/general_controller_spec.rb @@ -188,7 +188,7 @@ describe GeneralController, 'when using xapian search' do it 'should highlight words for a user-only request' do get :search, :combined => "bob/users" - assigns[:highlight_words].should == ['bob'] + assigns[:highlight_words].should == [/\b(bob)\w*\b/iu] end it 'should show spelling corrections for a user-only request' do -- cgit v1.2.3 From f23b89f3474847cdd14ba892c5a7259964e18148 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Tue, 24 Jun 2014 16:08:32 +0100 Subject: Handle unhelpful stemming Stemming returns 'bore' as the word to highlight which can't be matched in the original phrase. Also removes duplicates from the results --- spec/controllers/general_controller_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spec/controllers/general_controller_spec.rb') diff --git a/spec/controllers/general_controller_spec.rb b/spec/controllers/general_controller_spec.rb index f9c307913..c0a9d57d3 100644 --- a/spec/controllers/general_controller_spec.rb +++ b/spec/controllers/general_controller_spec.rb @@ -188,7 +188,7 @@ describe GeneralController, 'when using xapian search' do it 'should highlight words for a user-only request' do get :search, :combined => "bob/users" - assigns[:highlight_words].should == [/\b(bob)\w*\b/iu] + assigns[:highlight_words].should == [/\b(bob)\w*\b/iu, /\b(bob)\b/iu] end it 'should show spelling corrections for a user-only request' do -- cgit v1.2.3