Little update. So I have it almost working, but am still not
understanding what is going on exactly.
indexes and habtm....
has_and_belongs_to_many :makes
define_index do
indexes dealership_name, :sortable => true
indexes dealership_zip
indexes makes.name, :as => :makes
set_property :enable_star => true
set_property :min_infix_len => 3
end
search:
@dealers = DealerAccount.search "*#{value}*", :order
=> :dealership_name, :sort_mode => :desc
This results in dealership names and makes (honda,porsche,etc) being
searchable just how I want it. It also allows me to search by zip
codes...sorta. So if you put int 970 you get all the dealerships in
zipcodes: 970[0-9][0-9], one of which is in 97006. so if i do 970 i
get that dealership and bunch more, but if I do 9700 it doesn't have
any results.
By getting rid of the makes index all together I am able to search by
9700 and it works fine. There must be something I'm missing....
Thanks for your help.
Erik
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Thinking Sphinx" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/thinking-sphinx?hl=en
-~----------~----~----~----~------~----~------~--~---