Added support for distance when using 'near'