I need to create a custom search on Lightning Component where I should be able to search the text from all the objects through SOSL. I followed the module on trailhead and was able to create a custom search through SOSL query. However, the example given in the module searches the text in specific/defined objects. I have read everywhere that if we dont mention the objects (and RETURNING) in the query, by default it searches from all objects, however Im not able to get the syntax of SOSL to search the text from all objects. I tried with many attempts but still no luck.
Please help me with a simple syntax to search the text from all objects and not just Accounts. Here's the query for the same-
List<List<SObject>> results = [FIND :searchText IN ALL FIELDS RETURNING Account(Id ORDER BY CreatedDate LIMIT 10)];
Thanks in advance.