I use the following query though the alfresco api to get file from a speficic directory : TYPE:"cm:folder" AND @cm\:name:"TESTDIRECTORY" AND -TYPE:"cm:thumbnail". I can get file from the TESTDIRECTORY folder but i also get doclib and webpreview files though i put -TYPE:"cm:thumbnail" in my request. Could someone tell me what i am doing wrong?
A shorter version of your query is this: +TYPE:"cm:folder" +@cm\:name:"TESTDIRECTORY"
It doesn't make sense to say that a type must be a cm:folder and at the same time must not be a cm:thumbnail. The thumbnail part is redundant.
I am executing your query in the node browser in Share in 4.2.d and it works as I would expect. Can you share the code you are using to execute the query (or describe where you are executing the query)?