hotsh/rstat.us — Issue #419: Search is word order dependent
Author: clnclarinet
Created: 2011-10-29 03:51:08+00:00
State: open
Labels: bug

Because we're using a regex, the word order of the query must match the word order of the query terms in the update.

Here's a failing test case to go in search_test:

before do
@update_text = "These aren't the droids you're looking for!"
Factory(:update, :text => @update_text)
end

it "gets a match for words in the update out of order" do
visit "/search"

fill_in "q", :with => "for looking"
click_button "Search"

assert_match @update_text, page.body
end

Personally, this isn't what I'd expect... but I really don't want to write a real search from scratch. There's a lot of stuff we're not doing (stemming, ranking, etc).

I havent been keeping up with what the new hotness is in search gems, but that's the solution I'd favor for this issue.