The problem is that the query you described will return ScriptNodes, not a list of metadata-values. That means that if I ask for all people that have created a document (cm:creator) I will get all documents in the system instead of the 100 authors.
Right now I loop trough the thousands of hits and add the authors in a hashmap to remove the duplicates and get the list of authors. But it is very slow an will only get slower the more documents I get into the system. Imagine a system with a couple of millions of documents and have to read the properties of every document to get the information you want.
Thanks in advance
Roland