Tuesday, August 28, 2012

Configure PostgreSQL full-text search using pg_search gem for partial word match


class Listing < ActiveRecord::Base
  include PgSearch
  pg_search_scope :search_by_title_and_description, against: [:title, :description], using: { tsearch: { prefix: true } }
end

No comments: