Adhoc query with advanced search options