Hi Navneet

Just to confirm: is categories an array? Because :conditions doesn't accept 
arrays, only strings. So we should get the query valid because getting caught 
up with the result set (as that may influence things).

If you want to search to cover multiple values for a field, then you'll need to 
bundle it up something like "(alpha | beta | gamma)". So, categories becomes 
something like this:

  "(#{categories.join(' | ')})"

Give that a spin in your :conditions, see if the results are what you were 
hoping for.

Cheers

-- 
Pat

On 06/11/2010, at 7:09 AM, plumreef wrote:

> Hi,
> I've thinking sphinx working for the most part. Here's the issue:
>       @results =Model.search keywords, :conditions => {:division =>
> division, :category =>categories}
> 
> The result set I get back comprises of all the categories passed even
> if division is nil for them. How can I ensure that the results I get
> back DO NOT have either division or category  as NIL.
> 
> Thanks,
> Navneet
> 
> -- 
> 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