Created
July 5, 2015 13:45
-
-
Save thomasdavis/f7f314e3f09824c767a0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include AlgoliaSearch | |
algoliasearch do | |
# all attributes will be sent | |
attributesForFaceting [:part_name] | |
add_attribute :part_name do | |
Part.find(part_id).name | |
end | |
customRanking ['asc(part_name)', 'asc(name)'] | |
add_slave 'Equipment_cost_asc' do | |
attributesToIndex [:cost] | |
customRanking ['asc(cost)'] | |
end | |
add_slave 'Equipment_cost_desc' do | |
attributesToIndex [:cost] | |
customRanking ['desc(cost)'] | |
end | |
add_slave 'Equipment_weight_asc' do | |
attributesToIndex [:weight] | |
customRanking ['asc(weight)'] | |
end | |
add_slave 'Equipment_weight_desc' do | |
attributesToIndex [:weight] | |
customRanking ['desc(weight)'] | |
end | |
# add_attribute :thumbnail do | |
# if avatar | |
# avatar.path | |
# else | |
# 'none' | |
# end | |
# end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment