I am using Salesforce's parameterized search API - https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_search_parameterized.htm - to search my SF instance. However, it sometimes runs quite slow and I want to just the counts to begin with. I see there's a record count API - https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_record_count.htm - but it doesn't accept search terms.
Is there a way to combine these both ? Should I just use the query and use a SOSL query that would just return the counts ? Any pointers on what that SOSL query would look like ?