Skip to content

Instantly share code, notes, and snippets.

@pat
Created January 11, 2009 08:31
Show Gist options
  • Save pat/45670 to your computer and use it in GitHub Desktop.
Save pat/45670 to your computer and use it in GitHub Desktop.
class User < ActiveRecord::Base
define_index do
indexes description
has id
end
end
>> User.create(:id=> 555,:description => "test").save
>> User.create(:id=> 556,:description => "test").save
>> User.create(:id=> 557,:description => "test").save
>> User.search "test", :with => {:id => [555]}
=> [#<User id: 555, description: "test">]
>> User.search "test", :with => {:id => [555,556]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment