we get all the image keys for a car first, then we get all the keys for a car.dealers and then we join all those keys together and pass it into search with the or expression. We need to prioritize this result firstly by the car and then the most recent car image, and then by the car dealer and the most recent image of the car dealer. Right now the result returns only in the date order.
Is this possible? On Aug 2, 7:38 pm, Pat Allan <[email protected]> wrote: > Not sure if I quite understand this - do you want to prioritise a specific > image_holder_id, and then sort firstly within that id by date, and then all > other results by date? > > -- > Pat > > On 03/08/2011, at 12:04 PM, gerberdata wrote: > > > > > > > > > Looking to get some help and ideas for this issue I have here. Maybe > > one of the excellent minds on > > this board can help > > > @images = Image.search > > key1,key2,key3 , :per_page=>1, :page=>pos, :order=>"created_at > > DESC", :match_mode => :boolean > > > I need to be able to sort as follows > > > 1. keep the created_at DESC as the first sort > > 2. have an additional sort which sorts on the image_holder_id > > > here is the indexing for image_holder_id > > has :image_holder_id, :as => :holder_id > > > so can picture it this way I have a url for one particular cars > > profile and > > I want to show the images of the car first and then the related > > things to car > > > imageofcar1 created today image_holder:current_car > > imageofcar2 created today image_holder:current_car > > imageofcardealer created today image_holder:car_dealer > > imageofcardealer created today image_holder:car_dealer > > imageofcardealer created yesterday image_holder:car_dealer > > imageofcardealer created yesterday image_holder:car_dealer > > > But my current result is this > > imageofcardealer created today image_holder:car_dealer > > imageofcar1 created today image_holder:current_car > > imageofcardealer created today image_holder:car_dealer > > imageofcar2 created today image_holder:current_car > > imageofcardealer created yesterday image_holder:car_dealer > > imageofcardealer created yesterday image_holder:car_dealer > > > this is wrong because I want to show the imagesofcars first then the > > images of cardealers > > > -- > > 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 > > athttp://groups.google.com/group/thinking-sphinx?hl=en. -- 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.
