Class LongValueFacetCounts


  • public class LongValueFacetCounts
    extends Facets
    Facets implementation that computes counts for all unique long values, more efficiently counting small values (0-1023) using an int array, and switching to a HashMap for values above 1023. Retrieve all facet counts, in value order, with getAllChildrenSortByValue(), or get the topN values sorted by count with getTopChildrenSortByCount(int).
    WARNING: This API is experimental and might change in incompatible ways in the next release.
    • Method Detail

      • getAllChildren

        public FacetResult getAllChildren​(String dim,
                                          String... path)
                                   throws IOException
        Description copied from class: Facets
        Returns all child labels with non-zero counts under the specified path. Users should make no assumptions about ordering of the children. Returns null if the specified path doesn't exist or if this dimension was never seen.
        Specified by:
        getAllChildren in class Facets
        Throws:
        IOException
      • getTopChildren

        public FacetResult getTopChildren​(int topN,
                                          String dim,
                                          String... path)
        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
      • getTopChildrenSortByCount

        public FacetResult getTopChildrenSortByCount​(int topN)
        Returns the specified top number of facets, sorted by count.
      • getAllChildrenSortByValue

        public FacetResult getAllChildrenSortByValue()
        Returns all unique values seen, sorted by value.
      • getSpecificValue

        public Number getSpecificValue​(String dim,
                                       String... path)
        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
      • getAllDims

        public List<FacetResult> getAllDims​(int topN)
        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