CommonFacetBuilder (Lucene 10.5.0 sandbox API)
Description: declaration: package: org.apache.lucene.sandbox.facet.utils, class: CommonFacetBuilder

Package org.apache.lucene.sandbox.facet.utils

# Class CommonFacetBuilder

java.lang.Object
org.apache.lucene.sandbox.facet.utils.FacetBuilder
org.apache.lucene.sandbox.facet.utils.CommonFacetBuilder

public final class CommonFacetBuilder extends FacetBuilder
Common `FacetBuilder` that works with any `FacetCutter` and `OrdToLabel` provided by user.

WARNING: This API is experimental and might change in incompatible ways in the next release.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CommonFacetBuilder(String dimension, FacetCutter cutter, OrdToLabel ordToLabel)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `final FacetResult`
  `getResult()`
  Get results for this request.
  `final CommonFacetBuilder`
  `withSortByCount()`
  Sort results by count.
  `final CommonFacetBuilder`
  `withTopN(int n)`
  Request top N results only.

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

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

- ## Constructor Details

  - ### CommonFacetBuilder

    public CommonFacetBuilder(String dimension, FacetCutter cutter, OrdToLabel ordToLabel)

- ## Method Details

  - ### withTopN

    public final CommonFacetBuilder withTopN(int n)
    Request top N results only. If not set, return all results.

  - ### withSortByCount

    public final CommonFacetBuilder withSortByCount()
    Sort results by count.

  - ### getResult

    public final FacetResult getResult()
    Description copied from class: `FacetBuilder`
    Get results for this request.
    Specified by:
      `getResult` in class `FacetBuilder`