I am using ravendb http api and cannot make two parallel dynamic queries return stale results. Even when the documents were created long time ago. The first hit is always stale without proper result. Second one returns correct results. When I run just one query, its all right.
Requests looks like this
indexes/dynamic/Definition/query=Type%253A%2522ServiceRequest%2522%2520
indexes/dynamic/Definition/query=Type%253A%2522Customer%2522%2520
I was trying to elaborate with cutOff parameter without the success. cutOff with a now +- year value still result stale for the first hit.
You are running a dynamic query. Likely what happens is that the first query is generating the index, the second one sees the index in the process of being created, and gives you no results (it just got the index). Then the first query returns, once it waited for the index to rebuild.
This is expected & by design. In general, you shouldn't be seeing this unless you have dynamic indexes that always come & go. You should be promoting them to auto indexes if that is the case.