public DistanceComparator setNextReader(final AtomicReaderContext newContext) throws IOException {
final AtomicReader atomicReader = newContext.reader();
final Doubles unbasedLatitudeValues = FieldCache.DEFAULT.getDoubles( atomicReader, latitudeField, false );
final Doubles unbasedLongitudeValues = FieldCache.DEFAULT.getDoubles( atomicReader, longitudeField, false );
this.docBase = newContext.docBase;
final int numDocs = atomicReader.numDocs();
for ( int i = 0; i < numDocs; i++ ) {
//TODO avoid fully copying this structure
latitudeValues.put( this.docBase + i, unbasedLatitudeValues.get( i ) );
longitudeValues.put( this.docBase + i, unbasedLongitudeValues.get( i ) );
}