Encoding path segments on reduced custom query