WITH CASE WHEN apoc.text.clean($term) = "" THEN NULL ELSE apoc.text.clean($term) END AS normalizedTerm MATCH (p:Profile {profileType: 'OrchAdminProfile'})<-[:ASSIGNED_TO]-(:Vendor) WHERE apoc.text.clean(p.profileName) CONTAINS normalizedTerm OR apoc.text.clean(toString(p.profileName)) = normalizedTerm RETURN DISTINCT p ORDER BY p.profileName ASC SKIP toInteger($offset) LIMIT toInteger($limit)