Try our conversational search powered by Generative AI!

Loading...
Area: Optimizely Search & Navigation
ARCHIVED This content is retired and no longer maintained. See the latest version here.

Recommended reading 

Introduction

Similar to LINQ the EPiServer Find .NET API has the methods Skip and Take to bypass a number of search results and specify how many search results should be returned respectively. Unlike LINQ search results are by default limited to 10 and the maximum value that can be specified using the Take method is 1000. In other words, Take(1001) or Take(int.MaxValue) will throw an excpetion. If more than a thousand result items are needed, use multiple search requests.

Examples

Below is an example of using the Skip and Take methods for pagination:

C#
string searchQuery = //From query string or similar
int page = //From query string or similar
int pageSize = 15;

client.Search<BlogPost>()
    .For(searchQuery)
    .Skip((page - 1)*pageSize)
    .Take(pageSize)
    .GetResult();
Do you find this information helpful? Please log in to provide feedback.

Last updated: Sep 26, 2013

Recommended reading