If that's what you want, then I'd forgo using facets:

  Athlete.search_count(:with => {:sport_ids => 38})

Does that work for what you're trying to do?

-- 
Pat

On 21/03/2011, at 1:33 PM, gerberdata wrote:

> yeah I suppose so the only thing I don't understand is why am I
> getting id of 44 and 37 returned shouldn't I only get a count
> of athletes with sport_id of 38? Is this because if the athletes has
> lets say sport_id of 44 and a sport_id of 38 then it will return
> the counts of the other sport ids as well?  Is there a way to only get
> count of sport if 38?
> 
> On Mar 18, 3:27 pm, Pat Allan <[email protected]> wrote:
>> Given sport_ids is an array for each Athlete, I'm guessing you're getting 
>> all the sport ids for athletes that have 38 as *one* of their sport ids.
>> 
>> Does that make sense? Let me know if I've got it wrong.
>> 
>> Cheers
>> 
>> --
>> Pat
>> 
>> On 16/03/2011, at 9:32 PM, gerberdata wrote:
>> 
>> 
>> 
>>> Anyone know why when I do this:
>>> Athlete.facets :facets => [:sport_ids],:with => {:sport_ids => 38}
>> 
>>> I get this
>>> => {:sport_ids=>{38=>3373, 44=>1, 1=>1, 37=>1}}
>> 
>>> here is my facets definition in Model.
>>> has_many :sports , :through => :athlete_sports, :uniq => true
>>> has sports(:id), :as=>:sport_ids, :facet=>true
>> 
>>> --
>>> 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.
> 

-- 
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.

Reply via email to