Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

PostgreSQL Full Text Search #24

merged 2 commits into from Aug 7, 2012


None yet
3 participants

brocktimus commented Aug 7, 2012

The included changes implement full text searching on postgresql. This allows for indexes to be used during searching which can increase query speed to near sphinx / lucene levels.

An updated definition using this would be the following (where english is the locale).

scoped_search on: :name, full_text_search: :english

To gain the speed benefit an index must be manually created:

CREATE INDEX widgets_name_full_text_search ON widgets USING gin(to_tsvector('english', name));

This replaces ILIKE as the query used, however, it is not a drop in replacement for ILIKE in functionality. This performs more complex matching but at the same time doesn't do things like matching substrings.

@abenari abenari added a commit that referenced this pull request Aug 7, 2012

@abenari abenari Merge pull request #24 from brocktimus/master
PostgreSQL Full Text Search

@abenari abenari merged commit 98a938b into wvanbergen:master Aug 7, 2012


wvanbergen commented Aug 7, 2012

@brocktimus Thanks for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment