I am attempting to search for records that contain some text and limit the search results to a group of Ids.
For simplicity, I'll remove the "search for text" part in this question.

The problematic query looks like this

FIND {* OR *} IN ALL FIELDS RETURNING  Lead(Id, Name, Company Where Id IN ('someId')) , Contact(Id, Name, AccountId, Phone, MobilePhone, Email, MailingAddress Where Id IN('someId'))  

In the sandbox, this query returns 0 rows no matter what if I enter a Lead's Id.. However if I split the SOSL into two parts with one for Lead and one for Contact, both can return records.

Combined : combined

Combined with contact ID : combined with contactid

Lead by itself : lead by itself

In the dev org however, the query works without a hitch even if I enter a Lead's ID.

Combined : combined dev

Lead by itself: lead by itself on dev

Is there some sort of setting that I should be looking for or is this correct behavior?

I know that IDs are unique to each org, the IDs shown in the examples above were taken from the org that I was testing on, I am not using the same ID everywhere to test.


1 Answer 1


The answer

if you have large amounts of data you'll get burned by search result truncations the filter in the returning clauses are applied after the search index is processed, so if you hit the search result limits, you can not find your records. – superfell

Not the answer you're looking for? Browse other questions tagged .