checkHits(resultSort, "Sort by custom criteria: "); // check for duplicates
// besides the sorting both sets of hits must be identical
for(int hitid=0;hitid<resultSort.length; ++hitid) {
Integer idHitDate = Integer.valueOf(resultSort[hitid].doc); // document ID from sorted search
if(!resultMap.containsKey(idHitDate)) {
log("ID "+idHitDate+" not found. Possibliy a duplicate.");
}
assertTrue(resultMap.containsKey(idHitDate)); // same ID must be in the Map from the rank-sorted search
// every hit must appear once in both result sets --> remove it from the Map.
// At the end the Map must be empty!