Hi Court3nay, I'm not seeing the link between the forum post and your issue. Not feeling particularly awake tho.
That aside, sphinx converts string attributes to integers depending on alphabetical ordering, so it's not easy to filter on strings. If you were storing gender as an integer somehow, it'd be fine. Given you'd only be having two values tho, alpha ordering should be easy to guess, so try 0 for f, 1 for m (or 1 and 2). Whether that's reliable, I've no idea. Cheers -- Pat On 21/02/2009, at 10:06 AM, court3nay <[email protected]> wrote: > > Hey, I'm having an annoying issue with the :with directive.. it > basically isn't picking up the attribute, or just plain doing weird > things with it. Is there a way to turn this on? The Sphinx ML claims > it is possible: http://www.sphinxsearch.com/forum/view.html?id=1935 > > I'm doing this > > class User > define_index do > indexes :email, :created_at > indexes profile.full_name, :as => :full_name, :sortable => true > indexes profile.website, :as => :website > indexes profile.about, :as => :about > # indexes profile.gender, :as => :gender > > has profile.gender, :as => :gender > has :site_id > set_property :delta => true > end > end > > But doing this totally doesn't work, even after re-config/re-index/ > restart/delete sphinx dir. > >>> User.search "fred", :with => { :gender => "m" } > => [] >>> User.search "fred", :with => { :gender => "f" } > => [] >>> User.search "fred", :with => { :gender => "" } > => [#<User id: 13, login: nil, ....>] >>> _[0].profile.gender > => "m" > > > > Court3nay > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
