hello Andrew,
Bingo. I just made changes using "Status.find_by_name('live')"
and yet it still fails.
Here's how my codes look like:
if (params[:search][:by_keyword])
@search = Part.search(
params[:search][:by_keyword],
:with => { :status_id => Status.find_by_name('live').id },
:page => params[:page],
:per_page => 10
)
I purposely changed the status_id in the database to different values and
rebuilt the thinking sphinx index.
Ran the search but could not get any results.
Any ideas?
Hellpppp.....
On 10 March 2010 22:40, Andrew France
<[email protected]<andrew%[email protected]>
> wrote:
> 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]<thinking-sphinx%[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.