function getSortedFullTextSearch(query:string, fieldName:string) { var resultList:java.util.Vector = new java.util.Vector(); var documenColl:NotesDocumentCollection = database.FTSearch(query); var tempDoc:NotesDocument = tempDc.getFirstDocument(); var tempTreeMap:java.util.TreeMap = new java.util.TreeMap(); // fill the treeMap while (tempDoc != null) { // set the value of the field in "fieldName" as key for sorting with this criteria tempTreeMap.put(tempDoc.getItemValueString(fieldname), tempDoc); tempDoc = tempDc.getNextDocument(tempDoc); } // iterate through treemap to get sorted resultlist var tempColl:java.util.Collection = tempTreeMap.values(); var tempIt:java.util.Iterator = tempColl.iterator(); while (tempIt.hasNext()) { resultList.add(tempIt.next()); } return resultList; }