private List<FacetResult> sumAssociations() throws IOException {
  DirectoryReader indexReader=DirectoryReader.open(indexDir);
  IndexSearcher searcher=new IndexSearcher(indexReader);
  TaxonomyReader taxoReader=new DirectoryTaxonomyReader(taxoDir);
  FacetsCollector fc=new FacetsCollector();
  FacetsCollector.search(searcher,new MatchAllDocsQuery(),10,fc);
  Facets tags=new TaxonomyFacetSumIntAssociations("$tags",taxoReader,config,fc);
  Facets genre=new TaxonomyFacetSumFloatAssociations("$genre",taxoReader,config,fc);
  List<FacetResult> results=new ArrayList<>();
  results.add(tags.getTopChildren(10,"tags"));
  results.add(genre.getTopChildren(10,"genre"));
  indexReader.close();
  taxoReader.close();
  return results;
}

private List < FacetResult > sumAssociations ( ) throws IOException { DirectoryReader indexReader = DirectoryReader . open ( indexDir ) ; IndexSearcher searcher = new IndexSearcher ( indexReader ) ; TaxonomyReader taxoReader = new DirectoryTaxonomyReader ( taxoDir ) ; FacetsCollector fc = new FacetsCollector ( ) ; FacetsCollector . search ( searcher , new MatchAllDocsQuery ( ) , 10 , fc ) ; Facets tags = new TaxonomyFacetSumIntAssociations ( "$tags" , taxoReader , config , fc ) ; Facets genre = new TaxonomyFacetSumFloatAssociations ( "$genre" , taxoReader , config , fc ) ; List < FacetResult > results = new ArrayList < > ( ) ; results . add ( tags . getTopChildren ( 10 , "tags" ) ) ; results . add ( genre . getTopChildren ( 10 , "genre" ) ) ; indexReader . close ( ) ; taxoReader . close ( ) ; return results ; }
user runs a query and aggregates facets by summing their association values .
