woody2shoes / relevance_search

Search by number of fields that contain the word or words.

This URL has Read+Write access

commit  e3f35dc5cf630362aad7e28f579ac2e799e29086
tree    ac8bf07abea1d73afc8e43ad3715abaa8cb33052
parent  e9aaf0da80e6697522ad2d98689bf913ee09e6dd
name age message
file MIT-LICENSE Loading commit data...
file README
file Rakefile
file init.rb
file install.rb
directory lib/
directory tasks/
directory test/
file uninstall.rb
README
RelevanceSearch
===============

Relevance search was designed to return a set of ActiveRecord objects based on the number of attributes
on the object that include the search term.

TODO: Specify attributes included on the search
TODO: Multiple search terms
TODO: Relevance instance method
TODO: Custom secondary search column


Example
=======

Assume you have four records that look like this.

| id | name | address | city | state |
+----+------+---------+------+-------+
| 1  | term | address | term | term  |
| 2  | term | term    | term | term  |
| 3  | term | address | city | term  |
| 4  | term | address | term | term  |

When you call ObjectClass.relevance_search, you will get the following result set.


| id | name | address | city | state |
+----+------+---------+------+-------+
| 2  | term | term    | term | term  |
| 1  | term | address | term | term  |
| 4  | term | address | term | term  |
| 3  | term | address | city | term  |

This is because 2 has a relevance of 4. 1 & 4 have a relevance of 3. 1 is listed first because of a
secondary search on id


Copyright (c) 2009 Charles Max Wood, released under the MIT license