List of usage examples for org.apache.lucene.facet.taxonomy FacetLabel FacetLabel
public FacetLabel(final String... components)
From source file:org.meresco.lucene.numerate.TermNumerator.java
License:Open Source License
public int numerateTerm(String term) throws IOException { return taxoWriter.addCategory(new FacetLabel(term)); }
From source file:org.meresco.lucene.search.MerescoTaxonomyFacetCounts.java
License:Open Source License
/** Rolls up any single-valued hierarchical dimensions. */ protected void rollup() throws IOException { // Rollup any necessary dims: for (Map.Entry<String, DimConfig> ent : config.getDimConfigs().entrySet()) { String dim = ent.getKey(); DimConfig ft = ent.getValue();/*from ww w . jav a2 s.c o m*/ if (ft.hierarchical && ft.multiValued == false) { int dimRootOrd = taxoReader.getOrdinal(new FacetLabel(dim)); // It can be -1 if this field was declared in the // config but never indexed: if (dimRootOrd > 0) { values[dimRootOrd] += rollup(children[dimRootOrd]); } } } }