Skip to content

acts_as_ludia has many error with ludia1.5.2 and postgresql 8.3 , @@Has change? so I use %% to make it work.

Notifications You must be signed in to change notification settings

destinyd/acts_as_ludia_dd_hack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

ActsAsLudia
===========

ActsAsLudiaはLudiaによるPostgreSQLの高速全文検索機能をRuby on Railsに付加
するプラグインです.

ActsAsLudiaはActiveRecordモジュールにfind_fulltextメソッドを追加します.


example:

class Article < ActiveRecord::Base
  acts_as_ludia
end

Article.find_fulltext({:col1 => ["hoge moge", "hoho"]})
 # => SELECT * FROM models WHERE col1 @@ '*D+ hoge moge OR hoho';

Article.find_fulltext({:col1 => "hoge", :col2 => ["moge", "hoho"]}, :all => true)
 # => SELECT * FROM models WHERE col1 @@ '*D+ hoge' OR col2 @@ '*D+ moge OR hoho';

 # Snippet
Article.find_fulltext({:col1 => "hoge moge"}, :snippet => true)
Article.find_fulltext({:col1 => "hoge moge"}, :snippet => {:length => 45, :decorations => ['<em>', '</em>'])
Article.find_fulltext({:col1 => "hoge moge"}, :snippet => true, :css => {:class => "other_ludia_class"})

About

acts_as_ludia has many error with ludia1.5.2 and postgresql 8.3 , @@Has change? so I use %% to make it work.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published