Bulk Inserts and Index
I want to perform a bulk insert and then perform some queries on some existing views. The problem is that, from what I have read, the documents are actually indexed when they are written on disk, so a workaround is to use observers to determine when the documents are written and then perform a dummy query with stale = false, but this requires to be done after the documents are written on disk.
Since I want to make a bulk insert observing many documents might not be feasible (in terms of memory and performance).
Is there any better way to solve this problem?
Is there any way to check how many documents are not written on disk, so I can wait for that value to be 0
and then perform the dummy queries?
ps. I am using Java Client but if there is a workaround using the REST API it is also acceptable.