We have over 100,000 contacts to query the system to get this error.
SOSL: System.QueryException: Non-selective query against large object type (more than 100000 rows)
However, this error is only expected if we use SOQL. We are using SOSL instead and expect to return one record with the below query:
FIND :tmpVar1 IN ALL FIELDS RETURNING
Contact(Id, FirstName, LastName, MailingStreet, AccountId
WHERE (((LastName IN :tmpVar3 OR Name IN :tmpVar4)
AND mailingStreet IN :tmpVar5
AND (AccountId = :tmpVar6 OR AccountId = NULL OR Account.Name = 'Citizen')))
AND MUSW__Confidential__c = FALSE)
tempvar1
is a string eg. 'test name'tempvar3
and 4 is a list of 1 string eg. {'test name'}tempvar5
is a list of null eg {null}tempvar6
is a salesforce id
any ideas (using SOSL is a Salesforce recommended way to NOT get this error)