Note: This task reuses the reader if it is already open. Otherwise a reader is opened at start and closed at the end.
Other side effects: counts additional 1 (record) for each retrieved (non null) document.