Skip to content

Instantly share code, notes, and snippets.

@jacqui
Created July 23, 2010 20:14
Show Gist options
  • Select an option

  • Save jacqui/487982 to your computer and use it in GitHub Desktop.

Select an option

Save jacqui/487982 to your computer and use it in GitHub Desktop.
def attributes_for_indexing
attributes.reject{ |key, value| ['_id', 'created_at', 'email', 'name', 'project_id', 'tags', 'updated_at'].include?(key) }
end
Sunspot.setup(Submission) do
text :name, :boost => 2.0
text :email, :boost => 2.0
text :project_id, :boost => 2.0
date :created_at
date :updated_at
string :name, :stored => true
string :email, :stored => true
text :others do
attributes_for_indexing.values
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment