7 Replies Latest reply: May 6, 2013 5:37 AM by Waste Ideas RSS

    Endeca Pagination customization

    EndecaUser2013
      Hi,

      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?

      Please let me know.

      Thanks a lot!
        • 1. Re: Endeca Pagination customization
          1004987
          Hello,

          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,
          Sugun
          • 2. Re: Endeca Pagination customization
            961148
            Refer the following guide "http://docs.oracle.com/cd/E28910_01/MDEX.622/pdf/BasicDevGuide.pdf"

            http://docs.oracle.com/cd/E28910_01/MDEX.622/pdf/BasicDevGuide.pdf

            Regards,
            Ram
            • 3. Re: Endeca Pagination customization
              EndecaUser2013
              Hi Sugun,

              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.
              • 4. Re: Endeca Pagination customization
                EndecaUser2013
                Hi Ram,
                I could not find in the dev guide what I'm looking for. Could you tell me where you were looking?

                Thanks.
                • 5. Re: Endeca Pagination customization
                  961148
                  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.

                  Regards,
                  Ram
                  • 6. Re: Endeca Pagination customization
                    EndecaUser2013
                    I was able to fix this using - nequery.setNavNumERecs(number) just before query() method. Thanks!
                    • 7. Re: Endeca Pagination customization
                      Waste Ideas
                      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.

                      Rgrds,
                      Mayank Batra