Print this page

Inconsistent Search Results between Global/Sidebar Search and SOSL query

Knowledge Article Number 000194065
Description Scenario-
More than 2000 records that match the criteria on an object.
System Admin fires following SOSL query-
1)  FIND {Alpha*} IN ALL FIELDS RETURNING Account(id, name) 
-> Total 250 rows returned. 

2) SELECT Id, Name FROM Account WHERE Name LIKE '%Alpha%' 
-> Total 2217 rows returned 
Out of them one is AlphaOmega
This is not shown at all in query 1 results.

Issue-
Why do we see inconsistent results between SOSL and SOQL results?
AlphaOmega should have shown on query 1 results.
Why is it missing?
Resolution
In SOSL, we do have a limit on the number of records we return per entity if it is an admin user or if it is a public sharing entity. 
 
Workaround- 
You can override this limit in SOSL per entity by giving the OFFSET as follows- 
FIND {Alpha*} IN ALL FIELDS RETURNING Account(id, name OFFSET 0) 
You will see account "AlphaOmega" being returned here.




promote demote