Reputation: 6363
I'm wondering what's the best approach for getting back the total number of records for a search, and at the same time, get back the Nth 128 record block segment of data which seems to be the cap imposed by RavenDb run-time.
For instance given this query, I also need to know the total number of records.
var bookmarks = session.Query<Bookmark>()
.OrderByDescending(i => i.DateCreated)
.Skip(pageCount * (pageNumber – 1))
.Take(pageCount)
.ToList();
Thank you, Stephen
Upvotes: 4
Views: 173
Reputation: 6839
RavenQueryStatistics stats;
var bookmarks = session.Query<Bookmark>()
.OrderByDescending(i => i.DateCreated)
.Skip(pageCount * (pageNumber – 1))
.Take(pageCount)
.Statistics(out stats)
.ToList();
int bookmarksFound = stats.TotalResults;
Upvotes: 7