views:

46

answers:

1

ruby on rails ferret search:.only 10 records are getting from table.For pagination i did it ,but only 10 records are getting even though there exists more records satisfying the search condition.if any of you know how to solve this,please reply. no limit is given.if it is not a ferret search all records are getting from table , and pagination is working

the code is:

@search_sd_ticket_result=ServiceDeskTicket.find_with_ferret(params[:sd_ticket][:servicedeskticket]).paginate :per_page =>5, :page=>params[:page]

A: 

There will be default limit in your code. so it will return only 10 records at a time.please put your code here so that one could able to tell you what is the exact problem.

Do you use :limit=> 10 or :per_page => 10 somewhere in your code.

Ref link:- http://blog.zmok.net/articles/2006/10/18/full-text-search-in-ruby-on-rails-3-ferret

Salil
i didn't use :limit . code is pasted in the question.
jissy
you used :per_page =>5.so you should not get more that 5 records at a time change it to :per_page =>100 if you want 100 recorde per page.
Salil
:limit => :all generated all the records.now working.find_with_ferret( ,:limit => :all).paginate :per_page =>10, :page=>params[:page]
jissy