ApexSensei

Drills SOQL queries

Search names with SOSL

SOSL searches text across several objects at once and returns one list per object, in the order you wrote after RETURNING.

Your task

Complete findNames so one SOSL search returns the names of matching Accounts, then the last names of matching Contacts.

public class AS_6C2F11FEB11B_NameSearch {
    public static List<String> findNames(String term) {
        return new List<String>();
    }
}

Requirements

  1. returnsMatchingAccountNames should pass
  2. returnsContactLastNames should pass
  3. listsAccountsFirstInNameOrder should pass
  4. returnsEmptyListForShortTerms should pass
  5. usesOneSearchForBothObjects should pass
  6. returnsEmptyListWhenNothingMatches should pass

Sign in to open this drill