public void SearchExtremes(object q, IResult near, IResult far)
{
var _far = new Result (this.Count);
foreach (var docid in this.Iterate()) {
double d = this.DB.Dist (q, this.DB [docid]);
if (!near.Push (docid, d)) {
_far.Push (docid, -d);
}
}
foreach (var p in _far) {
far.Push (p.ObjID, -p.Dist);
}
}