Skip to content

Instantly share code, notes, and snippets.

@bartocc
Created March 11, 2010 08:40
Show Gist options
  • Save bartocc/328968 to your computer and use it in GitHub Desktop.
Save bartocc/328968 to your computer and use it in GitHub Desktop.
define_index do
# fields
indexes corporate_name, :sortable => true, :as => :rs
indexes id, :as => :newid
indexes external_id, :as => :oldid
indexes usual_corporate_name, :as => :rsu
indexes [contacts.first_name, contacts.last_name], :as => :nom_contact
indexes contacts.role, :as => :role_contact
indexes categories.label, :as => :categorie
indexes addresses.city.region.name, :as => :wilaya
indexes addresses.city.name, :as => :ville
indexes tags.name, :as => :tag
indexes categories.tags.name, :as => :categorie_tag
indexes assoc(:properties, :value), :as => :prop
# attributes
has :id, created_at, updated_at
has last_validation_at
# other
set_property :delta => :delayed
end
define_index do
indexes assoc(:properties, :value), :as => :rc
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment