Add support for defining result range in for queries