I have a Linq query as
var mdls = (from mdl in query dbSession.Query<MyModel>("MyIndex")
orderby mdl.Name
select dept).Skip(page.Value).Take(4);
Where “MyIndex” is a simple index defined in RavenDB. I know that while querying an Index in RavenDB it returns “TotalResults”. See here
How can i get the query result which has the TotalResult property?
If you are executing a LuceneQuery you get a DocumentQuery returned that has a QueryResult property that contains TotalResults so you can access it as follows:
If you’re executing a LINQ Query instead then you can call Count() on the query before limiting it with Skip and Take: