On 10/03/10 22:09, ct9a wrote:
I just read and found out that ":with" is used for attributes
filtering.
Realising that, I have changed the use of  :condition with :with.

This is how my search looks like.


         @search = Part.search(
           params[:search][:by_keyword],
           :with =>  { :status =>  Status.find_by_name('live') },
           :page      =>  params[:page],
           :per_page  =>  10
           :order     =>  :updated_at,
           :sort_mode =>  :desc
         )

Nevertheless, I am still facing the same error, " NoMethodError
(undefined method `>>' for #<Status:0x2b8386bcc390>):"

Any ideas?

Since an instance of Status is a complex object I'm not sure how TS is supposed to know what to do with it? I think {:status => 'live'} or {:status => Status.find_by_name('live').id} is more appropriate depending on what you've indexed on.

Regards,
Andrew

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