function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
niraj kumar 45niraj kumar 45 

SOSL Query not searching in 5 year older records

I have created a dynamic SOSL Query for existing SOQL query.But I am not getting all the records which I am getting 
form SOQL query.

When I compared the records which are missing from the SOSL then I found that those missing records where Created 5 Years ago from now.
So can this be the reason for not showing the records in SOSL?
I am new to SOSL.Please guide me.
Daniel MasonDaniel Mason
To Query Archived/Deleted records in SOQL, use ALL ROWS in statement .

If you add ALL ROWS at the end of a SOQL query, archived and deleted records will be included in the results.
Here's an example below of query returning ALL tasks:
1SELECT Id FROM Task ALL ROWS
As you can probably imagine, pulling all deleted and archived records into the results could a be hard to manage...so using the "IsDeleted" and "IsArchived" after the "WHERE" clause can help filter the results:
 
1SELECT Id FROM Task ALL ROWS WHERE IsDeleted = false AND IsArchived = fals
JVIowaJVIowa
Is it possible to use ALL ROWS in SOSL?  I can't seem to get the syntax to work.