29th Thu

acts_as_searchable_with_similarity

acts_as_searchable is one of the most useful plugins which's enabling us to add a fulltext search feature to our models/resources easily.

Unfortunately, it is lacking an interface to the features of searching by similarity provided by HyperEstraier.

So I wrote some codes to add an interface to exploit it. This is acts_as_searchable_with_similarity.

How to use?

Here is an example.

app/models/article.rb

   1  class Article < ActiveRecord::Base
   2    acts_as_searchable
   3  end
   4  
   5  Article.similarity_search(target_article,  :limit => 5)

posted by Pnggenki on Thu 29 Nov 2007 at 23:37

Search Words:

  • acts_as_searchable_with_similarity(4)

Comments:

or Preview
Tags
rails plugin search english
Social Bookmarks
  • Delicious6d036813873929e4799c612e7b324185?aggregate
  • B_entry232
  • Clip_16_12_w232