Jens Kraemer wrote:
> On Wed, Jul 04, 2007 at 03:19:29PM +0200, crissy crissy wrote:
>> Hi, I had ferret working wonderfully but i am regretting doing a gem
>> update today.
>> I had alot of trouble first installing it and was really happy to have
>> it working. The upgrade was from 0.3.1 to 0.4.0.
>
> So you're using acts_as_Ferret 0.4.0 now. What version of Ferret are you
> running? I'd suggest 0.11.x .
>
> Rebuilding your index might help also. How do the pieces of code where
> you use acts_as_ferret look like? I'm not sure but there may have been
> some API changes from 0.3.1 to 0.4 .
>
> cheers,
> Jens
>
>
> --
> Jens Kr�mer
> webit! Gesellschaft f�r neue Medien mbH
> Schnorrstra�e 76 | 01069 Dresden
> Telefon +49 351 46766-0 | Telefax +49 351 46766-66
> [EMAIL PROTECTED] | www.webit.de
>
> Amtsgericht Dresden | HRB 15422
> GF Sven Haubold, Hagen Malessa
Hi Jens,
Thankyou for your reply.
I'm running ferret 0.11.4
The code is just your stock standard AAF stuff(mostly stolen from the
railenvy tutorial;-)
def search
@query = params[:query]
if @query.blank?
flash[:error] = "Query was blank"
redirect_to(:action => 'index')
else
@total, @books = Book.full_text_search(@query, :page =>
(params[:page]||1))
@pages = pages_for(@total)
render_cloud
@total_hits = Book.total_hits(@query)
end
end
and in the Book Model;
def self.full_text_search(q, options = {})
return nil if q.nil? or q==""
default_options = {:limit => 10, :page => 1}
options = default_options.merge options
# get the offset based on what page we're on
options[:offset] = options[:limit] *
(options.delete(:page).to_i-1)
# now do the query with our options
results = Book.find_by_contents(q, options)#, :conditions =>
conditions)
return [results.total_hits, results]
end
I'm at a loss as to what to do.
--
Posted via http://www.ruby-forum.com/.
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk