During a RavenDB request, I notice that it does not receive the expected results immediately. Maybe this is due to indexing, I do not know.
For instance:
int ACount = session.Query<Patron>() .Count(); int BCount = session.Query<Theaters>() .Count(); int CCount = session.Query<Movies>() .Where(x => x.Status == "Released") .Count(); int DCount = session.Query<Promotions>() .Count();
When I do this, then ACount and BCount get their values ββright the first time they start). However, CCount and DCount do not get their values ββup to three or four runs. They show a 0 (zero) value in the first few runs.
Why is this happening for the two lower and not for the two upper queries? If this is due to outdated results (or indexes), then how can I modify my queries to get accurate results every time I run it the first time. Thank you for your help.
source share