This content has been marked as final. Show 7 replies
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.
Refer the following guide "http://docs.oracle.com/cd/E28910_01/MDEX.622/pdf/BasicDevGuide.pdf"
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 could not find in the dev guide what I'm looking for. Could you tell me where you were looking?
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.
I was able to fix this using - nequery.setNavNumERecs(number) just before query() method. Thanks!
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.