Adds 'native' full-text search support to Arel.
In order to produce this query (MySQL Full-Text syntax):
SELECT * FROM people
WHERE MATCH (name) AGAINST ('expression')
You could use this Arel construct:
people = Arel::Table.new(:people)
expr = people[:name].match('expression')
Arel Full-Text only supports MySQL currently. Open an issue if you wish to add support to a different database.
You can also include search modifiers to further optimize your query.
people = Arel::Table.new(:people)
expr = people[:name].match('expression', boolean_mode: true)
Will result in:
SELECT * FROM people
WHERE MATCH (name) AGAINST ('expression' IN BOOLEAN MODE)
people = Arel::Table.new(:people)
expr = people[:name].match('expression', query_expansion: true)
Will result in:
SELECT * FROM people
WHERE MATCH (name) AGAINST ('expression' WITH QUERY EXPANSION)
CREATE FULLTEXT INDEX index_id ON table (column);
Arel Full-Text is released under a MIT License.
Portions of this software are licensed from Arel, copyrighted 2007-2010 to Nick Kallen, Bryan Helmkamp, Emilio Tagua, Aaron Patterson.