Created
January 25, 2013 16:36
-
-
Save raysrashmi/4635845 to your computer and use it in GitHub Desktop.
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
| define_index do | |
| indexes name, :sortable => true, :infixes => true | |
| indexes nickname, :sortable => true, :infixes => true | |
| indexes city_code | |
| indexes address | |
| indexes state | |
| indexes city, :sortable => true, :infixes => true | |
| set_property :enable_star => 1 # Both are needed to allow stars in search | |
| set_property :min_prefix_len => 1 # Both are needed to allow stars in search | |
| has "RADIANS(latitude)", :as => :latitude, :type => :float | |
| has "RADIANS(longitude)", :as => :longitude, :type => :float | |
| # join franchises | |
| end | |
| sphinx_scope(:ny_ca_and_ma_only) { | |
| {:conditions => ["gyms.address IS NOT NULL AND (gyms.state in (?)", ['MA', 'CA', 'NY']]} | |
| } | |
arunagw
commented
Jan 25, 2013
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment