By default only the first ten hits are returned when using EPiServer Find. That number can be increased to a thousand, but not more. Here's an example of how to get *all* hits. Use with caution :)
Clik here to view.
public IEnumerable<PageData> GetPages()
{
int totalNumberOfPages;
var query = SearchClient.Instance.Search<PageData>()
.Take(1000);
var batch = query.GetContentResult();
foreach (var page in batch)
{
yield return page;
}
totalNumberOfPages = batch.TotalMatching;
var nextBatchFrom = 1000;
while (nextBatchFrom < totalNumberOfPages)
{
batch = query.Skip(nextBatchFrom).GetContentResult();
foreach (var page in batch)
{
yield return page;
}
nextBatchFrom += 1000;
}
}
Image may be NSFW.
Clik here to view.
Image may be NSFW.
Clik here to view.
Image may be NSFW.
Clik here to view.
Image may be NSFW.Clik here to view.

Clik here to view.

Clik here to view.

Clik here to view.
