Created
April 16, 2009 21:11
-
-
Save ryanb/96659 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Article < ActiveRecord::Base | |
xapit do |index| | |
index.text :description do |desc| | |
desc.split.map do |word| | |
if word.include? '-' | |
[word, word.gsub('-', ''), word.gsub('-', ' ')] | |
else | |
word | |
end | |
end.flatten | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment