From page 475 of the Alfresco Developer Guide…
Category searches use the PATH field, but you construct a path using the classification hierarchy. Suppose that sample-a.pdf is classified under “Languages/German”, and sample-b.pdf is classified under “Languages/German/Swiss-German”. Now consider the following two searches:
PATH:”/cm:categoryRoot/cm:generalclassifiable/cm:Languages/cm:German/*”
PATH:”/cm:categoryRoot/cm:generalclassifiable/cm:Languages/cm:German//*”
The first search will return sample-a.pdf because it is classified as “German” and the “Swiss-German” category. sample-b.pdf won’t be returned because sample-b.pdf is under a subcategory, “Swiss-German”. The second search uses double slashes (“//”) at the end to denote that matches should include “German” as well as anything classified under a subcategory. It returns both documents and the “Swiss-German” subcategory.
So the category searches, as shown above, will return both objects that have been categorized (“members”) and also the category nodes. If what you want are only documents and not categories, you can use “member” as follows:
PATH:”/cm:categoryRoot/cm:generalclassifiable/cm:Languages/cm:German/member”
PATH:”/cm:categoryRoot/cm:generalclassifiable/cm:Languages/cm:German//member”
The first search would return only sample-a.pdf, while the second search would return sample-a.pdf and sample-b.pdf.
A handy little hack to get the Lucene full-text search query syntax is to use the web client to build your search, then save the search, then use the Node Browser to go look at the search string Alfresco saved.
[UPDATE: I just realized you posted this comment regarding the CMIS tutorial so this answer isn’t going to help you at all. CMIS queries don’t support categories, so, unfortunately, if you’re using CMIS, you’re out-of-luck for now