Full Text Search
create_table "posts" do |t|
t.column :title, :string, null: false
t.column :content, :string, null: false
t.full_text_searchable on: [{"title", 'A'}, {"content", 'C'}]
end class Post
include Clear::Model
#...
full_text_searchable
end
Post.create!({title: "About poney", content: "Poney are cool"})
Post.create!({title: "About dog and cat", content: "Cat and dog are cool. But not as much as poney"})
Post.create!({title: "You won't believe: She raises her poney like as star!", content: "She's col because poney are cool"})Additional parameters
Last updated