Integrate PostgreSQL Full Text Search to Rails Applications
Add this line to your application's Gemfile:
gem 'pg_searchable', github: 'ngonzalez/pg_searchable'
rails g pg_searchable:install
class Collection < ActiveRecord::Base
has_many :books
searchable :name, books: { tag: [:name] }
end
Collection.search "Example"
- Fork it ( https://github.com/ngonzalez/pg_searchable/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request