Hi Rahul

This is possible - although it requires you to create your query strings 
manually.

  Link.search "@(name, tag_name) #{query}", :match_mode => :extended
  Link.search "@(name, description) #{query}", :match_mode => :extended

It's important to note you *must* use the extended (or extended2) match mode - 
Thinking Sphinx automatically uses this when you use :conditions, but 
:conditions isn't so useful for the kind of queries you want.

Hope this helps.

Cheers

-- 
Pat

On 09/08/2010, at 10:31 PM, rahul100885 wrote:

> Hi All,
> 
> I have following links model indexed like following,
> 
> define_index do
>    set_property :delta => true
>    indexes :name, :as => :link_name, :prefixes => true
>    indexes :description, :as => :link_description, :prefixes => true
>    indexes tags(:name), :as=>:tag_name, :prefixes => true
> 
>    where "links.deleted_at is null"
>  end
> 
> In that I have two types of search set
> 1. search using name and tags (It should not include description)
> 2. search using name and description (It should not include tags)
> 
> So how can I use 'or' in search
> 
> Link.search :conditions => { :link_name => query
> 'OR'  :link_description => query}
> 
> 
> Like that I have many other model in which I have different sets of
> attributes for search.
> 
> Thanks & Regards,
> Rahul P. Chaudhari
> 
> -- 
> 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