+ Start a Discussion

How to calculate SOSL queries executed in a page

I want to calculate number of SOSL queries executed in  Visual Force page. Any suggestions how to do this?

Bhawani SharmaBhawani Sharma
Use Limits.getSoslQueries() method.
1) Open the Developer Console. Make sure the that logging options include query usage (Debug > Set Debug Levels > Profiling [Finest]).
2) Perform your search on the Visualforce page.
3) Open the log file, and scroll to the bottom. You'll see the total query time, number of queries, rows returned, etc.