I am getting all the results of elasticsearch through my php interface. Now I need to show 20 results per page, and idea is total number of hits divided by 20 equals number of pages. And as I need 20 results per page can anyone help me with the code how to write it?
Display the first 20 results by calling this URL /_search?size=20 and have an option called load more, and when he clicks it fire this URL /_search?size=20&from=20 and keep adding 20 to the 'from' param in the URL each time he clicks load more.
You can also have like pagination with page numbers.
So each page result would be /_search?size=20&from={page_number-1}*20
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.