add ranging query.

Signed-off-by: Edward Fung <edwardfung@redso.com.hk>