public class EngineInfo { public int Id{get;set;} public int? AircraftId { get; set; } public string SerialNumber { get; set; } public int Position { get; set; } public string RegNumber { get; set; } }
// Here is the code that uses the above model. I have 17,000 documents with this model.
ravenSession.Store(new AuthorizationUser { Id = "Authorization/Users/1", Name = "user-1", Permissions = { new OperationPermission { Allow = true, Operation = "EngineInfos/View", Tags = "Company/100" } } }); 1. var query = ravenSession.Query<EngineInfo>();
// When I write query.Count (), I see all the documents count ie., 17000. This ignores the authorization set in the before statement. If I add a where clause to the above statement, it works, and I could see the correct score. But I want to get all the documents for which the user has authorization.
2. var query = ravenSession.Query<EngineInfo>().ToList();
Now I get the correct account, taking into account authorization. But the problem is that if I don't mention Take (x), it will not return all the results. I tried using
RavenQueryStatistics queryStats; query.Statistics(out queryStats); queryStats.TotalResults
I still have not been able to get authorized results. I get all the bills.
Could you help me figure out the TotalCount search for query results without loading all the records?
My requirement is to display all the engines in the ExtJS substring search grid. I need to know the total number of records to display the calculation and display the number of pages (the number of pages is fixed).