Hi Steve
What you'll need to do is something like this:
File.search "@(filename,description) *tmp*", :match_mode => :extended
It's worth noting that the ANY match mode you were using doesn't work with
field-specific matching (:conditions or what I'm doing above). Also, when you
use :conditions, the default match mode becomes :extended - but for OR logic,
it's a little more complex, hence the above solution.
Cheers
--
Pat
On 26/06/2012, at 7:05 PM, Steve Dierker wrote:
> Hello group,
>
> I just started to dig into ThinkingSphinx and Spihnx itself and I have
> a question which i could figure out by now.
> So my question is:
> Is it possible query a model with a name, a description and a filename
> like this:
>
> File.search :conditions => { :filename => "*tmp*", :description =>
> "*tmp*" }, :match_mode => :any
>
> I have already enabled wildcards, but the problem is if I do the above
> query Sphinx also dispalys results which only contain "*tmp*" in the
> filename column.
> So how do I manage to get a 'OR' connection between all the specified
> columns in :conditions?
>
> thanks a lot,
> Steve
>
> --
> 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.