Re: How to get how many folders and sub folders are present in a site ?
Please, never recommend using the luceneSearch operation. That operation is a legacy holdover from Alfresco 2.x/3.x. Lucene is no longer the primary search language, and since Alfresco 4.x has not received any of the various performance improvements that have been accorded to FTS / CMIS. Ideally, only ever use the generic query() operation and specifically use the "fts-alfresco" or "cmis-strict"/"cmis-alfresco" query languages.