org.apache.lucene.facet.taxonomy
Class TaxonomyFacets

java.lang.Object
  extended by org.apache.lucene.facet.Facets
      extended by org.apache.lucene.facet.taxonomy.TaxonomyFacets
Direct Known Subclasses:
FloatTaxonomyFacets, IntTaxonomyFacets

public abstract class TaxonomyFacets
extends Facets

Base class for all taxonomy-based facets impls.


Field Summary
protected  int[] children
          Maps parent ordinal to its child, or -1 if the parent is childless.
protected  FacetsConfig config
          FacetsConfig provided to the constructor.
protected  String indexFieldName
          Index field name provided to the constructor.
protected  int[] siblings
          Maps an ordinal to its sibling, or -1 if there is no sibling.
protected  TaxonomyReader taxoReader
          TaxonomyReader provided to the constructor.
 
Constructor Summary
protected TaxonomyFacets(String indexFieldName, TaxonomyReader taxoReader, FacetsConfig config)
          Sole constructor.
 
Method Summary
 List<FacetResult> getAllDims(int topN)
          Returns topN labels for any dimension that had hits, sorted by the number of hits that dimension matched; this is used for "sparse" faceting, where many different dimensions were indexed, for example depending on the type of document.
protected  FacetsConfig.DimConfig verifyDim(String dim)
          Throws IllegalArgumentException if the dimension is not recognized.
 
Methods inherited from class org.apache.lucene.facet.Facets
getSpecificValue, getTopChildren
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

indexFieldName

protected final String indexFieldName
Index field name provided to the constructor.


taxoReader

protected final TaxonomyReader taxoReader
TaxonomyReader provided to the constructor.


config

protected final FacetsConfig config
FacetsConfig provided to the constructor.


children

protected final int[] children
Maps parent ordinal to its child, or -1 if the parent is childless.


siblings

protected final int[] siblings
Maps an ordinal to its sibling, or -1 if there is no sibling.

Constructor Detail

TaxonomyFacets

protected TaxonomyFacets(String indexFieldName,
                         TaxonomyReader taxoReader,
                         FacetsConfig config)
                  throws IOException
Sole constructor.

Throws:
IOException
Method Detail

verifyDim

protected FacetsConfig.DimConfig verifyDim(String dim)
Throws IllegalArgumentException if the dimension is not recognized. Otherwise, returns the FacetsConfig.DimConfig for this dimension.


getAllDims

public List<FacetResult> getAllDims(int topN)
                             throws IOException
Description copied from class: Facets
Returns topN labels for any dimension that had hits, sorted by the number of hits that dimension matched; this is used for "sparse" faceting, where many different dimensions were indexed, for example depending on the type of document.

Specified by:
getAllDims in class Facets
Throws:
IOException


Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.