IndexConfig: Add maxPages option

With an index system like Lucene, which only supports "pagination" by
skipping results, a search with a start offset actually has to iterate
through the skipped results. This means that paginating through a long
list of results is a quadratic operation.

Allow administrators to limit the amount of work done by such
pagination requests, by setting a limit on the number of pages of
results. Larger result sets may thus require larger limits (possibly
requiring extra permission) to paginate through.

Change-Id: Ie62f506e3b479992358f70a3c6d685749f43f0da
4 files changed