On Tue, Oct 17, 2006 at 09:30:50AM +0900, David Balmain wrote: > On 10/17/06, koloa <[EMAIL PROTECTED]> wrote: [..] > > > > @test = > > County.find_by_contents(@params['search_string'],:first_doc=>0,:num_docs=>10) > > For starters, :first_doc is now :offset and :num_docs is now :limit, > as of Ferret 0.10.0.
right, though aaf still works with the old naming, too ;-) [..] > > if this is the case, is there an easier way and also a way to count how > > many sets or how many pages there are in a table for a given query? > > would i just get a total from the array and then divide by 10 docs? > > etc...? > > I'm not sure about easier way but you can get the total number of > matching hits from @test.total_hits. On the other hand, @test.size > will be the number of hits returned. exactly. I didn't try this, but it should be possible to use a Rails Paginator to handle the whole pagination stuff. Jens -- webit! Gesellschaft für neue Medien mbH www.webit.de Dipl.-Wirtschaftsingenieur Jens Krämer [EMAIL PROTECTED] Schnorrstraße 76 Tel +49 351 46766 0 D-01069 Dresden Fax +49 351 46766 66 _______________________________________________ Ferret-talk mailing list [email protected] http://rubyforge.org/mailman/listinfo/ferret-talk

