fix for executing callback unnecessarily multiple times when no results are returned from index
only log duplicate doc adds if debug log is true
merging from master