Technically, you can't have an MVA field, as MVA stands for multi- 
valued attribute. The more reliable way to get the results you want is:
   define_index do
     # ...
     has users(:id), :as => :user_ids
   end

   MyModel.search :with => {:user_ids => 33}

Not entirely sure if what you're doing will always work (but maybe it  
will).

-- 
Pat

On 24/07/2009, at 3:58 PM, Christopher wrote:

>
> Say I have something like:
>
> class MyModel < ActiveRecord::Base
>  has_many :users, :through => :permissions
>
>  define_index do
>    indexes users(:id), :as => user_ids
>  end
>
> How do I search for a user id using extended query syntax?
>
> MyModel.search "@user_ids 33", for example, doesn't work.
>
> Thanks,
> Christopher
>
> >


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