Hi Will

You're using SQL syntax in your sphinx_scope, which Sphinx (and  
Thinking Sphinx) won't understand.

However, the following should do the job:

   sphinx_scope(:first_name_like) { |first_name|
     {:conditions => {:first_name => "*#{first_name}*"}}
   }

This will require you to have wildcard syntax set up, though. See  
about halfway down this page:
http://freelancing-god.github.com/ts/en/advanced_config.html

Cheers

-- 
Pat

On 24/11/2009, at 7:55 AM, Will Clark wrote:

> I need to search for users where the end user will submit separate
> values for name, city, email, and keyword, which would be compared
> against users.name, users.city, users.email, users.description.
>
> At first, I thought I'd be able to use sphinx_scope like this:
>
> sphinx_scope(:first_name_like) { |first_name| { :conditions =>
> ["first_name ILIKE ?","%#{first_name}%"] } }
>
> But that won't work. How would you go about doing something like that,
> or is this a situation where ThinkingSphinx/Sphinx is not the right
> tool for the job.
>
> --
>
> 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= 
> .
>
>

--

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