Skip to content

Commit

Permalink
Updated README and changed extension to Markdown.
Browse files Browse the repository at this point in the history
  • Loading branch information
boone committed Jan 22, 2012
1 parent 8d8cb9f commit 34277ec
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions README → README.md
Original file line number Original file line Diff line number Diff line change
@@ -1,44 +1,43 @@
ActsAsFulltextable ActsAsFulltextable
================== ==================


[![Build Status](https://secure.travis-ci.org/boone/acts_as_fulltextable.png)](http://travis-ci.org/boone/acts_as_fulltextable)

It allows you to create an auxiliary to be used for full-text searches. It allows you to create an auxiliary to be used for full-text searches.
It behaves like a polymorphic association, so it can be used with any It behaves like a polymorphic association, so it can be used with any
ActiveRecord model. ActiveRecord model.


See http://blog.wonsys.net/posts/26-our-first-plugin-acts_as_fulltextable/ and This plugin is compatible with MySQL only.
http://code.google.com/p/wonsys/

Bug tracker: http://wonsysos.16bugs.com/


Only tested with MySQL 5.x The code is based on the original acts_as_fulltextable plugin: http://code.google.com/p/wonsys/


== Step 1 ## Step 1


Install the plugin: Install the plugin:
script/plugin install http://wonsys.googlecode.com/svn/plugins/acts_as_fulltextable/ script/plugin install https://boone@github.com/boone/acts_as_fulltextable.git


== Step 2 ## Step 2


Add the following code to the model that should be included in searches: Add the following code to the model that should be included in searches:
acts_as_fulltextable :fields, :to, :include, :in, :index acts_as_fulltextable :fields, :to, :include, :in, :index


== Step 3 ## Step 3


Create the migration: Create the migration:
script/generate fulltext_rows model1 model2 model3 ... script/generate fulltext_rows model1 model2 model3 ...


Then execute it: Then execute it:
rake db:migrate rake db:migrate


== Run searches ## Run searches


You can either run a search on a single model: You can either run a search on a single model:
Model.find_fulltext('query to run', :limit => 10, :offset => 0) Model.find_fulltext('query to run', :limit => 10, :offset => 0)


Or you can run it on more models at once: Or you can run it on more models at once:
FulltextRow.search('query to run', :only => [:only, :this, :models], :limit => 10, :offset => 0) FulltextRow.search('query to run', :only => [:only, :this, :models], :limit => 10, :offset => 0)


== Warning ## Warning


Should you add acts_as_fulltextable to a new model after the initial migration was run, Should you add acts_as_fulltextable to a new model after the initial migration was run,
you should execute the following piece of code (a migration or script/console are both fine): you should execute the following piece of code (a migration or script/console are both fine):
Expand All @@ -47,7 +46,9 @@ you should execute the following piece of code (a migration or script/console ar


It will add all of the model's instances to the index. It will add all of the model's instances to the index.


== Contact us ## Contact us

[boonedocks.net](http://boonedocks.net)



If you experience any issues, please file a bug report at: @boonedocks on Twitter
http://wonsysos.16bugs.com/

0 comments on commit 34277ec

Please sign in to comment.