def get_page_parameter(request):
    """
    Return the ``page`` parameter of the request's GET parameters. This
    number is used in combination with the ``limit`` parameter to
    perform pagination on queries to the database or Elasticsearch. It
    needs to be a positive integer. If the page is not indicated or
    invalid, the default page is returned.

    Args:
        ``request`` (django.http.HttpRequest): The request object with
        parameter ``page`` set.

    Returns:
        ``int``. The page.
    """
    DEFAULT_PAGE = 1
    try:
        page = int(request.GET.get('page', DEFAULT_PAGE))
    except ValueError:
        page = DEFAULT_PAGE
    if page <= 0:
        return DEFAULT_PAGE
    return page