limit( )


Limits the number of documents the search returns.

The limit() function defines the number of results a search returns in each page. Only one page of results is retrieved at a time. The next() and prev() functions are used to navigate the pages of a search result.

By default, limit is set to 25.

The maximum value that limit() can accept is 1000.

Method Declaration
Copy
Method Parameters
limitnumberRequired

The number of documents to return, which is also the pageSize of the results object.

Was this helpful?
Yes
No