2

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.

4
  • 2
    IDs are unique for the org
    – EricSSH
    Commented Aug 22, 2016 at 17:07
  • @EricSSH : Yes I am aware, and those IDs were taken from their respective orgs
    – Jason Lee
    Commented Aug 22, 2016 at 17:11
  • 2
    You seem to have indicated this question is already answered here: How do I SOSL across objects, matching all records with FIND clause?
    – Adrian Larson
    Commented Aug 23, 2016 at 16:43
  • I flagged it as a duplicate, you should be able to agree with it and the Community user will close it automatically.
    – Adrian Larson
    Commented Aug 23, 2016 at 17:07

1 Answer 1

0

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 .