By default, Endeca returns 10 records per page. I have 2 queries -
1. Is it possible to customize this to any other number. Say, I want 100 results per page. Where do I make this configuration change?
2. Also, in extension to the 1st question if there is a requirement such that we let the user decide, how many results per page he wants, by giving him 10, 30, 60 in a drop down. How will this be done?
On way to achieve this if you are using Experience manager/Page builder in your application is to configure the number of records to return per page (default value can be set and a range of value can be given to choose) in Cartridges. This way Work bench user can configure this property.
With CRS aplication this is implemented in MainContent-ResultsList.xml cartridge. You could refer CartridgeDevGuide.pdf/XMgrDevGuide.pdf for more details on cartridge development.
Thanks for your answer but I am not working with either exp mgr or page builder. I am simply working with dev studio and workbench. Is there any other way to achieve this customization? Pls let me know.
I'm not sure why are not able to access the doc. Basically you use No & navNum query parameters to control pagination. One is the offset and the other tells how many results to be returned. You can implement pages on these parameters along with totalNumERecs. If you have access to endeca_jspref you refer the pagination implementation.
This can be easily achieved using setNavNumERecs() and setNavERecsOffset().
setNavNumERecs() - This is for the number of records to be displayed per page ( current page ).
setNavERecsOffset() - The parameter for this method sets the value of the starting record for the current page.
As any endeca query this query will be StateLESS too. As user selects the next or previous button , change the value of the NavERecsOffset accordingly and hit the MDEX with new query . Query can be maintained in query cache.
If we need to give flexibility to the end user to select number of records per page , we need to change the value of NavNumERecs accordingly and hit the MDEX.
P.S. - Other regular pagination logics like displaying the last page, displaying the first page if the total num of records is less than NavNumErecs etc. need to be taken care of.