# Acts\_as\_searchable pagination

**URL:** <https://www.ruby-forum.com/t/acts-as-searchable-pagination/73368>\
**Category:** Rails\
**Created:** [October 24, 2006, 8:01am UTC](https://www.ruby-forum.com/t/acts-as-searchable-pagination/73368 "2006-10-24T08:01:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Petr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ac8455/32.png) [@Petr](https://www.ruby-forum.com/u/Petr)\
**Post date:** [October 24, 2006, 8:01am UTC](https://www.ruby-forum.com/t/acts-as-searchable-pagination/73368/1 "2006-10-24T08:01:23Z")

</div>

Hi,  
Who uses acts\_as\_searchable? How do you deal with pagination? Can it  
“plug in” to the paginate function in Rails?

Petr

---

<div class="post-metadata">

**Author:** ![Petr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ac8455/32.png) [@Petr](https://www.ruby-forum.com/u/Petr)\
**Post date:** [October 24, 2006, 7:31pm UTC](https://www.ruby-forum.com/t/acts-as-searchable-pagination/73368/2 "2006-10-24T19:31:17Z")

</div>

Petr wrote:

> Hi,  
> Who uses acts\_as\_searchable? How do you deal with pagination? Can it  
> “plug in” to the paginate function in Rails?
> 
> Petr

Hi Petr,

If you’re using the solr part of the acts\_as\_searchable plugin I suggest  
you switching over to this new acts\_as\_solr plugin. That’s what I did  
about 2 days ago and I’m much happier with the features provided by it.

In your case if you need to do the pagination, simply do  
YourModel.find\_by\_solr(“query”, :start =\> 0, :rows =\> 10) or if you want  
the result to return only the ids, then do  
YourModel.find\_id\_by\_solr(“query”, :start =\> 0, :rows =\> 10)

If it interests you: [http://acts-as-solr.rubyforge.org/](http://acts-as-solr.rubyforge.org/)

Thanks,

Jimmy

---

<div class="post-metadata">

**Author:** ![Petr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ac8455/32.png) [@Petr](https://www.ruby-forum.com/u/Petr)\
**Post date:** [October 25, 2006, 4:43am UTC](https://www.ruby-forum.com/t/acts-as-searchable-pagination/73368/3 "2006-10-25T04:43:28Z")

</div>

Does this use Hyperestraier too?

I guess Id have to write my Next/Previous page function myself (easy), i  
was just wondering if theres a way to integrate it into the paginate  
rails object (Paginate.new). Cheers

Petr

Jimmy wrote:

> Petr wrote:
> 
> > Hi,  
> > Who uses acts\_as\_searchable? How do you deal with pagination? Can it  
> > “plug in” to the paginate function in Rails?
> > 
> > Petr
> 
> Hi Petr,
> 
> If you’re using the solr part of the acts\_as\_searchable plugin I suggest  
> you switching over to this new acts\_as\_solr plugin. That’s what I did  
> about 2 days ago and I’m much happier with the features provided by it.
> 
> In your case if you need to do the pagination, simply do  
> YourModel.find\_by\_solr(“query”, :start =\> 0, :rows =\> 10) or if you want  
> the result to return only the ids, then do  
> YourModel.find\_id\_by\_solr(“query”, :start =\> 0, :rows =\> 10)
> 
> If it interests you: [http://acts-as-solr.rubyforge.org/](http://acts-as-solr.rubyforge.org/)
> 
> Thanks,
> 
> Jimmy
