Skip to content

Instantly share code, notes, and snippets.

@jwo
Created February 19, 2015 17:20
Show Gist options
  • Save jwo/933a8c79fc16006355ac to your computer and use it in GitHub Desktop.
Save jwo/933a8c79fc16006355ac to your computer and use it in GitHub Desktop.
pgsearch that doesn't suck
class Quote < ActiveRecord::Base
include PgSearch
pg_search_scope :search,
:against => [:text, :author, :keywords],
:using => {
:tsearch => {
dictionary: "english",
prefix: true,
any_word: true
}
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment