Skip to content

Instantly share code, notes, and snippets.

@ThomasBush
Created May 1, 2015 12:57
Show Gist options
  • Save ThomasBush/793773c6e75bbbf9bed4 to your computer and use it in GitHub Desktop.
Save ThomasBush/793773c6e75bbbf9bed4 to your computer and use it in GitHub Desktop.
Algolia Index question
algoliasearch index_name: "products" do
# currently working
attribute :id, :product_number, :name, :family_id, :slug, :collection_id, :benefits, :categories
# refined indices I would like to have
attribute :id, :product_number, :name, :family_id, :slug, :collection_id
attribute :benefits do
{ id: benefits.id, name: benefits.name }
end
attribute :categories do
{ id: categories.id, name: categories.name }
end
# tags used for filtering
tags do
[benefits_ids, categories_ids]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment