Thak you, I used the same solution

--

Best regards,
Sergey Avseyev


On Fri, Oct 2, 2009 at 01:50, Pat Allan <[email protected]> wrote:

>
> Hi Sergey
>
> You can limit which classes you want to search on using the :classes
> option. This way, just search on classes that *do* have tag ids:
>
>   ThinkingSphinx.search 'foo',
>     :with    => {:tag_ids => 25},
>     :classes => [Page, ...]
>
> Cheers
>
> --
> Pat
>
> On 01/10/2009, at 5:30 PM, Sergey Avseyev wrote:
>
> >
> > Hi all, a have a proble with filtering by MVA's
> >
> > This is sample schema
> >
> > class Page < ActiveRecord::Base
> >  ...
> >
> >  define_index do
> >    indexes :name
> >    indexes :contents
> >
> >    has tags(:id), :as => :tag_ids
> >  end
> >
> >  ...
> > end
> >
> > class Discussion < ActiveRecord::Base
> >  ...
> >
> >  define_index do
> >    indexes :name
> >    indexes :contents
> >  end
> >
> >  ...
> > end
> >
> > In other words I have several models with and without taggings in
> > sphinx index. I want to perform search with optional tag filter (user
> > can use token "tag:" in query).
> >
> > ThinkingSphinx.search('foo', :with => {:tag_ids => [25]})
> >
> > This query founds also models without tags. This is my problem.
> > >
>
>
> >
>

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