org.apache.lucene.facet

## Class Facets

- java.lang.Object
- - org.apache.lucene.facet.Facets

- Direct Known Subclasses:
    ConcurrentSortedSetDocValuesFacetCounts, DoubleRangeFacetCounts, LongRangeFacetCounts, MultiFacets, SortedSetDocValuesFacetCounts, TaxonomyFacets

      public abstract class Facets
      extends Object

  Common base class for all facets implementations.
  WARNING: This API is experimental and might change in incompatible ways in the next release.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Facets()` Default constructor.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract 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.
    `abstract Number` | `getSpecificValue(String dim, String... path)` Return the count or value for a specific path.
    `abstract FacetResult` | `getTopChildren(int topN, String dim, String... path)` Returns the topN child labels under the specified path.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Facets

          public Facets()

      Default constructor.

  - ### Method Detail

    - #### getTopChildren

          public abstract FacetResult getTopChildren(int topN,
                                                     String dim,
                                                     String... path)
                                              throws IOException

      Returns the topN child labels under the specified path. Returns null if the specified path doesn't exist or if this dimension was never seen.
      Throws:
        `IOException`

    - #### getSpecificValue

          public abstract Number getSpecificValue(String dim,
                                                  String... path)
                                           throws IOException

      Return the count or value for a specific path. Returns -1 if this path doesn't exist, else the count.
      Throws:
        `IOException`

    - #### getAllDims

          public abstract List<FacetResult> getAllDims(int topN)
                                                throws IOException

      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.
      Throws:
        `IOException`

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