<commit_before># pg_search

http://github.com/Casecommons/pg_search/

[<img src="https://secure.travis-ci.org/Casecommons/pg_search.png?branch=master"
alt="Build Status" />](http://travis-ci.org/Casecommons/pg_search)
[<img src="https://gemnasium.com/Casecommons/pg_search.png" alt="Dependency Status"
/>](https://gemnasium.com/Casecommons/pg_search)
[<img src="https://codeclimate.com/github/Casecommons/pg_search.png"
/>](https://codeclimate.com/github/Casecommons/pg_search) 
[<img src="https://coveralls.io/repos/Casecommons/pg_search/badge.png?branch=master"
alt="Coverage Status" />](https://coveralls.io/r/Casecommons/pg_search) 
[<img src="https://badge.fury.io/rb/pg_search.png" alt="Gem Version"
/>](http://badge.fury.io/rb/pg_search)

## DESCRIPTION

PgSearch builds named scopes that take advantage of PostgreSQL's full text
search.

Read the blog post introducing PgSearch at http://pivotallabs.com/pg-search/

## REQUIREMENTS

*   Ruby 1.9.2 or later
*   Active Record 3.1 or later
*   PostgreSQL
*   [PostgreSQL contrib packages for certain
    features](https://github.com/Casecommons/pg_search/wiki/Installing-Postgres-Contrib-Modules)


## INSTALL

    gem install pg_search

### Rails 3.1 or later, Ruby 1.9.2 or later

In Gemfile

    gem 'pg_search'

### Rails 3.0

The newest versions of PgSearch no longer support Rails 3.0. However, the 0.5
series still works. It's not actively maintained, but submissions are welcome
for backports and bugfixes.

    gem 'pg_search', "~> 0.5.7"

The 0.5 branch lives at
https://github.com/Casecommons/pg_search/tree/0.5-stable

### Rails 2

The newest versions of PgSearch no longer support Rails 2. However, the 0.2
series still works. It's not actively maintained, but submissions are welcome
for backports and bugfixes.

    gem 'pg_search', "~> 0.2.0"

The 0.2 branch lives at
https://github.com/Casecommons/pg_search/tree/0.2-stable

### Other Active Record projects

In addition to installing and requiring the gem, you may want to include the
PgSearch rake tasks in your Rakefile. This isn't necessary for Rails projects,
which gain the Rake tasks via a Railtie.

````ruby
load "pg_search/tasks.rb"
````

### Ruby 1.8.7 or earlier

The newest versions of PgSearch no longer support Ruby 1.8.7. However, the 0.6
series still works. It's not actively maintained, but submissions are welcome
for backports and bugfixes.<commit_msg>Prefer vanilla to Github-flavored markdown<commit_after># pg_search

http://github.com/Casecommons/pg_search/

[<img src="https://secure.travis-ci.org/Casecommons/pg_search.png?branch=master"
alt="Build Status" />](http://travis-ci.org/Casecommons/pg_search)
[<img src="https://gemnasium.com/Casecommons/pg_search.png" alt="Dependency Status"
/>](https://gemnasium.com/Casecommons/pg_search)
[<img src="https://codeclimate.com/github/Casecommons/pg_search.png"
/>](https://codeclimate.com/github/Casecommons/pg_search) 
[<img src="https://coveralls.io/repos/Casecommons/pg_search/badge.png?branch=master"
alt="Coverage Status" />](https://coveralls.io/r/Casecommons/pg_search) 
[<img src="https://badge.fury.io/rb/pg_search.png" alt="Gem Version"
/>](http://badge.fury.io/rb/pg_search)

## DESCRIPTION

PgSearch builds named scopes that take advantage of PostgreSQL's full text
search.

Read the blog post introducing PgSearch at http://pivotallabs.com/pg-search/

## REQUIREMENTS

*   Ruby 1.9.2 or later
*   Active Record 3.1 or later
*   PostgreSQL
*   [PostgreSQL contrib packages for certain
    features](https://github.com/Casecommons/pg_search/wiki/Installing-Postgres-Contrib-Modules)


## INSTALL

    gem install pg_search

### Rails 3.1 or later, Ruby 1.9.2 or later

In Gemfile

    gem 'pg_search'

### Rails 3.0

The newest versions of PgSearch no longer support Rails 3.0. However, the 0.5
series still works. It's not actively maintained, but submissions are welcome
for backports and bugfixes.

    gem 'pg_search', "~> 0.5.7"

The 0.5 branch lives at
https://github.com/Casecommons/pg_search/tree/0.5-stable

### Rails 2

The newest versions of PgSearch no longer support Rails 2. However, the 0.2
series still works. It's not actively maintained, but submissions are welcome
for backports and bugfixes.

    gem 'pg_search', "~> 0.2.0"

The 0.2 branch lives at
https://github.com/Casecommons/pg_search/tree/0.2-stable

### Other Active Record projects

In addition to installing and requiring the gem, you may want to include the
PgSearch rake tasks in your Rakefile. This isn't necessary for Rails projects,
which gain the Rake tasks via a Railtie.

    load "pg_search/tasks.rb"

### Ruby 1.8.7 or earlier

The newest versions of PgSearch no longer support Ruby 1.8.7. However, the 0.6
series still works. It's not actively maintained, but submissions are welcome
for backports and bugfixes.
{'fraction_non_alphanumeric': 0.12086540461826503, 'fraction_numerical': 0.01747451633035157, 'mean_word_length': 4.342222222222222, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 17, 'https://': 22, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6997457', 'n_tokens_mistral': 1657, 'n_tokens_neox': 1577, 'n_words': 464}