It is possible to return duplicate results to the user when the shardsPerDayThreshold property is set.
This was discovered when using the collapseUids option which rolls up all document ranges into shard ranges. Shard ranges are returned from the index to the query iterator until the shardsPerDayThreshold is triggered. At this point a day range is sent to the query iterator and the previous ranges are searched again.
For example, if a document hits on shard 20190314_0 through _9, and the shardsPerDayThreshold is set to 5, the following ranges would be searched. A user would see duplicate results for shards 0-4.
20190314_0
20190314_1
20190314_2
20190314_3
20190314_4
20190314
There are several ways to mitigate this issue.
Set the shardsPerDayThreshold to be greater than the number of shards per day
Set the eventPerDayThreshold to the maximum integer value
It is possible to return duplicate results to the user when the shardsPerDayThreshold property is set.
This was discovered when using the collapseUids option which rolls up all document ranges into shard ranges. Shard ranges are returned from the index to the query iterator until the shardsPerDayThreshold is triggered. At this point a day range is sent to the query iterator and the previous ranges are searched again.
For example, if a document hits on shard 20190314_0 through _9, and the shardsPerDayThreshold is set to 5, the following ranges would be searched. A user would see duplicate results for shards 0-4.
There are several ways to mitigate this issue.