org.apache.lucene.facet.taxonomy

## Class IntTaxonomyFacets

- java.lang.Object
- - org.apache.lucene.facet.Facets
  - - org.apache.lucene.facet.taxonomy.TaxonomyFacets
    - - org.apache.lucene.facet.taxonomy.IntTaxonomyFacets

- Direct Known Subclasses:
    FastTaxonomyFacetCounts, TaxonomyFacetCounts, TaxonomyFacetSumIntAssociations

      public abstract class IntTaxonomyFacets
      extends TaxonomyFacets

  Base class for all taxonomy-based facets that aggregate to a per-ords int[].

- - ### Field Summary

    - ### Fields inherited from class org.apache.lucene.facet.taxonomy.TaxonomyFacets

      `config, indexFieldName, parents, taxoReader`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `IntTaxonomyFacets(String indexFieldName, TaxonomyReader taxoReader, FacetsConfig config, FacetsCollector fc)` Sole constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Number` | `getSpecificValue(String dim, String... path)` Return the count or value for a specific path.
    `FacetResult` | `getTopChildren(int topN, String dim, String... path)` Returns the topN child labels under the specified path.
    `protected int` | `getValue(int ordinal)` Get the count for this ordinal.
    `protected void` | `increment(int ordinal)` Increment the count for this ordinal by 1.
    `protected void` | `increment(int ordinal, int amount)` Increment the count for this ordinal by `amount`..
    `protected void` | `rollup()` Rolls up any single-valued hierarchical dimensions.
    `protected boolean` | `useHashTable(FacetsCollector fc, TaxonomyReader taxoReader)` Return true if a sparse hash table should be used for counting, instead of a dense int[].

    - ### Methods inherited from class org.apache.lucene.facet.taxonomy.TaxonomyFacets

      `childrenLoaded, getAllDims, getChildren, getSiblings, siblingsLoaded, verifyDim`

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

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

- - ### Constructor Detail

    - #### IntTaxonomyFacets

          protected IntTaxonomyFacets(String indexFieldName,
                                      TaxonomyReader taxoReader,
                                      FacetsConfig config,
                                      FacetsCollector fc)
                               throws IOException

      Sole constructor.
      Throws:
        `IOException`

  - ### Method Detail

    - #### useHashTable

          protected boolean useHashTable(FacetsCollector fc,
                                         TaxonomyReader taxoReader)

      Return true if a sparse hash table should be used for counting, instead of a dense int[].

    - #### increment

          protected void increment(int ordinal)

      Increment the count for this ordinal by 1.

    - #### increment

          protected void increment(int ordinal,
                                   int amount)

      Increment the count for this ordinal by `amount`..

    - #### getValue

          protected int getValue(int ordinal)

      Get the count for this ordinal.

    - #### rollup

          protected void rollup()
                         throws IOException

      Rolls up any single-valued hierarchical dimensions.
      Throws:
        `IOException`

    - #### getSpecificValue

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

      Description copied from class: `Facets`
      Return the count or value for a specific path. Returns -1 if this path doesn't exist, else the count.
      Specified by:
        `getSpecificValue` in class `Facets`
      Throws:
        `IOException`

    - #### getTopChildren

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

      Description copied from class: `Facets`
      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.
      Specified by:
        `getTopChildren` in class `Facets`
      Throws:
        `IOException`

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