updates to vclassgroupCache to set individual count of classgroup without adding the counts of the classes in the classgroup but instead getting the results numFound. For NIHVIVO-3456

This commit is contained in:
hjkhjk54 2011-12-08 19:47:46 +00:00
parent 8cf98a75fa
commit c7303bb623

View file

@ -295,9 +295,11 @@ public class VClassGroupCache {
log.debug("query: " + query);
QueryResponse rsp = solrServer.query(query);
//Get individual count
long individualCount = rsp.getResults().getNumFound();
log.debug("Number of individuals found " + individualCount);
group.setIndividualCount((int) individualCount);
//get counts for classes
group.setIndividualCount(0);
FacetField ff = rsp.getFacetField( VitroSearchTermNames.RDFTYPE );
List<Count> counts = ff.getValues();
for( Count ct: counts){
@ -312,7 +314,6 @@ public class VClassGroupCache {
for( VClass clz : group){
if( clz.getURI().equals(classUri)){
clz.setEntityCount( (int) individualsInClass );
group.setIndividualCount( ((int)individualsInClass + group.getIndividualCount()));
}
}