advanced search logic'