I have a working fulltext search query which finds a text in a folder
map. Put("fulltext", matchString);
But this returns the number of total files matching the query, I need the total number of occurrences also. Is there a way I can get that ?
Didn't get the question above, however you are searching into dam, where full text search has its own limitation.
If the selected String is stored in any jcr property, then also matching Asset would come in result set. OOTB Full text Search would not search in Asset Binary like PDF's text, unless these files are indexed into a Solr set up.
It would be helpful to know, what we are trying to figure out by obtaining number of occurrences.
We can only find total matches (resources) via query. Not the total occurrences.
If you need this info on per asset level, then: