Added support for custom query and search result format