Quest

Extremely naive full text search implementation for ActiveRecord based on naive-search by Tomas Jogin (github.com/tjogin/naive-search). Orders results by relevance and gives you detailed info on the search results. Works like this:

Installation

gem install quest

Usage

class Person < ActiveRecord::Base
  quest_on :name, :surname, :description
end

This makes the specified fields searchable like so:

Person.quest_for 'my query'

Optionally, you can specify the order and limit of results to return from the database:

class Person < ActiveRecord::Base
  quest_on :name, :surname, :description, :order => "id desc", :limit => 20
end

Note that the search results will still be re-ordered based on fuzzy “relevance”, this simply specifies how many results to retrieve from the database, and in which order. Also note that small limits combined with broad searches yields terrible results. The default limit is 1 000.

License

This project uses MIT-LICENSE.