Paging Request

The search service also provides the ability to page the results of a search, so that a user is not bombarded with all the results on one page.

Contents

Request Parameters

The following table describes the parameters that are used when using the paging feature of a Search Request.

Name Description
pageKey
String
This is the pageKey sent back with a search request which has a pageSize parameter is set to a number less than the amount of results returned. It acts similar to a session Id and lasts for an extended amount of time to refer to the results of a search request. This way, to get certain pages of a result set, a user just enters the pageKey and the currentPage to view.

This is a required parameter for a page function call!
currentPage
Integer
Set this to return a specific page of the previous results.

Defaults to 1

Response Parameters

The response returned is in a similar format to the original request's response. For their descriptions please see the appropriate page:

For possible error messages and codes, refer to our Status Codes documentation for details

Advanced Paging Sample

In order to use the paging functionality, there must be a normal search call first which has an extra parameter, pageSize. That parameter tells the service how many results to use per page. If the amount of results returned is less than or equal to the pageSize, than there will only be one page. Otherwise, a pageKey is returned and that can be given to the page function to get other page results. Below is a sample to demonstrate.

The first step is to make an initial Search Request (The following sample is a Radius Search Request).

Origin: 
Page Size: 

Page Key: No key created yet

After that call, we can use the pageKey to determine what search result set to page through and use the current page to determine which page to look at.


Options Value(s)
Page Key:
Current Page:
Input Format:

(Output will be displayed below)

  © MapQuest, Inc. All rights reserved.    Privacy Policy | Terms of Use