org.apache.lucene.facet.search

## Class FacetResult

- java.lang.Object
- - org.apache.lucene.facet.search.FacetResult

    public class FacetResult
    extends Object

Result of faceted search.

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

### Constructor Summary

Constructors
Constructor and Description
`FacetResult(FacetRequest facetRequest, FacetResultNode rootNode, int numValidDescendants)`

### Method Summary

Methods
`FacetRequest` `getFacetRequest()` Request for which this result was obtained.
`FacetResultNode` `getFacetResultNode()` Facet result node matching the root of the `facet request`.
`int` `getNumValidDescendants()` Number of descendants of `root facet result node`, up till the requested depth.
`String` `toString()`
`String` `toString(String prefix)` String representation of this facet result.

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

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

### Constructor Detail

#### FacetResult

    public FacetResult(FacetRequest facetRequest,
               FacetResultNode rootNode,
               int numValidDescendants)

### Method Detail

#### getFacetResultNode

    public final FacetResultNode getFacetResultNode()

Facet result node matching the root of the `facet request`.

See Also:
  `getFacetRequest()`, `FacetRequest.categoryPath`

#### getNumValidDescendants

    public final int getNumValidDescendants()

Number of descendants of `root facet result node`, up till the requested depth. Typically -- have value != 0. This number does not include the root node.

See Also:
  `getFacetRequest()`, `FacetRequest.getDepth()`

#### getFacetRequest

    public final FacetRequest getFacetRequest()

Request for which this result was obtained.

#### toString

    public String toString(String prefix)

String representation of this facet result. Use with caution: might return a very long string.

Parameters:
  `prefix` - prefix for each result line
See Also:
  `toString()`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`