I'd definitely use an attribute (has) instead of field (indexes) -  
Sphinx will be doing a straight compare instead of using its textual  
searching mechanisms, which I'm pretty sure would add some extra  
overhead.

Cheers

-- 
Pat

On 03/02/2009, at 8:44 PM, Dan Pickett wrote:

> I'm using true - not sure of any serious perfomance considerations  
> here as the casting/prep for sending the filter to Sphinx happens in  
> Thinking Sphinx and Riddle.
>
> On Tue, Feb 3, 2009 at 8:08 AM, Thibaut Barrère <[email protected] 
> > wrote:
>
> Hello,
>
> I'm wondering what most people do to filter by a boolean attribute. I
> have a checkbox in my UI. If it's checked, then I need to only include
> items with the attribute set to true.
>
> Partner.search(:with => { :my_boolean => true })  # has :my_boolean
>
> or
>
> Partner.search(:conditions => { :my_boolean => 1 }) #
> indexes :my_boolean // true doesn't work here
>
> seem to work both.
>
> I tend to prefer the first option. I'm not sure what are the
> implications (performance, size etc).
>
> What do you use ?
>
> -- Thibaut
>
>
>
> >


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