Created
November 9, 2011 01:37
-
-
Save markbrown4/1350036 to your computer and use it in GitHub Desktop.
solr translated fields from Globalize3
This file contains hidden or 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
class Job < ActiveRecord::Base | |
translates :title | |
globalize_accessors :locales => I18n.available_locales, :attributes => translated_attribute_names | |
searchable do | |
I18n.available_locales.each do |locale| | |
sym = ("title_" + locale.to_s).to_sym | |
# sorting | |
string(sym) { eval(sym) } | |
# keyword / fulltext searching | |
text(sym, :default_boost => 2) { eval(sym) } | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment