Hi,
I have a Job model and a location model. So ajob belongs to a location and a location can have many jobs.
Im trying to use acts as tsearch to search for keywords that match everything in the Jobs and Locations table.
How do i specify to search the relationship model.
acts_as_tsearch :vectors => { :local => "default", :auto_update_index => true, :fields => { "a" => {:columns => ["jobs.title"], :weight => 1}, "b" => {:columns => ["locations.name"], :weight => 0.4} }, :tables => { :locations => { :from => "locations left outer join jobs on locations.id = jobs.location_id", :where => "jobs.location_id = locations.id" } }
} I also tried @jobs = Job.find_by_tsearch(query, :include => :location, :limit => :all)
but im not getting what i expect back.
everything in the jobs table is coming bakc onk but nothing for the locations.
Anybody help?
JB