Hi Steph I'm hoping you're using an old version of Sphinx, because that would certainly explain this issue. In 0.9.9 (and maybe 1.10), Sphinx's string-sorting attributes were only useful within the context of a single index, not across several, because it was actually storing an integer indicating the order of all attribute values in that index.
If you upgrade to Sphinx 2.x (and if you're using 2.0.4, make sure you update to the latest Thinking Sphinx release - 1.4.12 for Rails 2, 2.0.12 for Rails 3), this should get things working as you expect. If it doesn't, let us know. Cheers -- Pat On 18/05/2012, at 1:58 AM, Steph wrote: > Hi, > > I'm at my wits end trying to figure this out, so I finally decided to > post here... > > I have an application with multi-model search implemented (let's say > class A, B, and C). All classes have a title and price defined. When I > try to sort by title (via SQL, extended mode "title_sort ASC"), the > sorting is not behaving as expected (both in full text search and > search using :with only). The results look something like this: > > item #1 (class A, title is "ABC") > item #2 (class A, title is "BCD") > item #3 (class A, title is "CDE") > item #4 (class B, title is "ABC") > item #5 (class A, title is "DEF") > item #6 (class B, title is "CDE") > item #7 (class C, title is "BCD") > item #8 (class C, title is "CDE") > > So, what I'm trying to say is that per model, the sort looks fine. But > when you mix multiple models together, there is odd weighting of each > class and there's not obvious reason for the sort. > > When I sort by price, the sort is behaving as expected. > > I initially thought there was a weighting / ranking issue and I tried > changing the rank mode, as well as adding index_weights to set the > index_weights of class A, B, and C to the same value. I even > considered combining all the data into one index and setting a static > "type" or "class" string on each to filter by class. Because sort by > price is working as expected, I also considered it has something to do > with string processing. > > I'd appreciate any help. > > Thanks, > > Steph > > -- > 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. > -- 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.
