Added support for 'nearest' and 'locate' queries