I have multiple separate models that are all indexed by Sphinx. My goal is to be able to search all of them and return the results all sorted by a specific field, integrated with each other. For example, I want to search a model Asset and a model Person, returning a list ordered by the field name.
Currently, I am using this (optionally with a search string): ThinkingSphinx::Search.search :classes => [Person, Asset], :order => :name_sort This returns all people ordered by name, followed by all assets ordered by name. However, if I have the two people named Link and Zelda and two assets named Master Sword and Tri-Force, I want them returned in the following order: Link, Master Sword, Tri-Force, Zelda. Is this possible in Sphinx/ThinkingSphinx? P.S. The Asset model is currently the base class for Single Table Inheritance, and I'm able to search the subclasses in this manner (the various classes are returned intermingled). I don't want to include the new models as a subclass to Asset as they have no columns in common, nor will other new models I'm going to add. In fact, Assets has a column named title that I'm indexing with the :as => :name option so that I could hopefully sort both Asset and Person on the field name. -- 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.
