Jump to content

The ultimate community for Ruby on Rails developers.


Photo

how to avoid the records that are not in database without reindexing solr

solr pagination

  • Please log in to reply
No replies to this topic

#1 lavanya

lavanya

    Passenger

  • Members
  • 1 posts

Posted 19 March 2014 - 09:49 AM

i have a model Ticket which has 4 records.. I deleted first 2 records in the database..

 

search = Sunspot.new_search(Ticket) do

  paginate(:page => 1, :per_page => 2)

end

 

list = search.execute

list.results

 

list.results returns [ ] for page 1 and the remaining 2 records for page 2.

 

Ideally it should have been 1 page with 2 records. is it possible to avoid the records that not in database without re-indexing solr?







Also tagged with one or more of these keywords: solr, pagination

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users