ryanb (owner)

Revisions

gist: 96659 Download_button fork
public
Public Clone URL: git://gist.github.com/96659.git
Embed All Files: show embed
Text only #
1
2
3
4
5
6
7
8
9
10
11
12
13
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