Commit 157619d0 authored by Ema Panz's avatar Ema Panz Committed by Markus Kalkbrenner

Add Pagination example (#527)

Add a pagination example, see #521
parent aa463671
......@@ -9,6 +9,15 @@ $client = new Solarium\Client($config);
// get a select query instance
$query = $client->createQuery($client::QUERY_SELECT);
// Pagination example
$resulsPerPage = 15;
$currentPage = 1;
// Set the number of results to return
$query->setRows($resultsPerPage);
// Set the 0-based result to start from, taking into account pagination
$query->setStart(($currentPage - 1) * $resultsPerPage);
// this executes the query and returns the result
$resultset = $client->execute($query);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment