countTopDocs,true);
}
//gather the results from all the plugins
for (int i = 0; i < plugins.length; i++) {
ISearchResult result = plugins[i].getResults();
//iterate over all the documents
double sumGroup = 0;
//sum for all the direct score of the nodes found it in the same set
for (int j = 0; j < result.getDocuments().size();
j++) {
DocumStruct doc = (DocumStruct) result.getDocuments()
.get(j);
sumGroup = sumGroup +
PluginManager.getCategoryStores()
.getDirectScore(doc.getCategoryName(),
doc.getId());
}
//calculate the average
double average = 0.0;
if (result.getDocuments().size() > 0) {
average = sumGroup / result.getDocuments().size();
}
//case of "term AND categoryname:X" and set of term < set of categoryname:X (1 category in the system)
//store the new average score for each document in the set
for (int j = 0; j < result.getDocuments().size();
j++) {
DocumStruct doc = (DocumStruct) result.getDocuments()
.get(j);
//create a new document set and it to the list
listLinks.add(new DocumSetStruct(
doc.getCategoryName(), doc.getId(),