You should be able to use the :classes option to get the results for specific classes:
ThinkingSphinx.search 'foo', :classes => [Spider] But, given you're using the old syntax (ThinkingSphinx::Search.search) - what version of Thinking Sphinx are you using? -- Pat On 08/03/2010, at 7:52 AM, tilt wrote: > Hi, > > I've been trying to make the Sphinx filter my search results - call > them animals - by their subclass, e.g. spiders. > > ...I've tried > > 1.) filtering by the column that tells Rails of which class the given > dataset is by setting up an index on type (with or without an alias) > and adding :type => "Spider" to the search conditions (either to the > "conditions" or the "with" hash) > > 2.) filtering by class using the condition ":class_crc => > Spider.to_crc32" in the "with" hash which is passed to the > ThinkingSphinx::Search.search method > > Nothing worked out unfortunately, nor could I find any solutions on > the web or in this mailing list. > > Is there a common way to deal with STI using the TS plugin? > > Thanks for help! > > Best regards > > -- > 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.
