Tire does not paginate
I tried to follow the explanations and examples to paginate with Tire. In
fact, I want to successively retrieve all my documents stored in
Elasticsearch. The following did not work out for me:
Tire::Search::Scan.new('my_documents') { from 0; size 5 }.results.first.name
=> "Doducment JK33DG
Tire::Search::Scan.new('my_documents') { from 1; size 5 }.results.first.name
=> "Doducment JK33DG
Tire::Search::Scan.new('my_documents') { from 30; size 5 }.results.first.name
=> "Doducment JK33DG
I just keep on receiving the same documents with the requests. The same is
true if I pass the pagination parameters through the option.
Tire::Search::Scan.new('my_documents',{ :page => 10, :size => 1
}).results.first.record.name
=> "Doducment JK33DG
What am I missing here?
No comments:
Post a Comment