# Class FacetOptions (5.0.3)

    public final class FacetOptions

A `FacetOptions` represents facet options such as the number of facets to discover
(`discoveryLimit`), the number of values to be included in each discovered
facet (`discoveryValueLimit`), and the depth of the results to check (`depth`).
Note that discovery is disabled when `discoveryLimit` is zero.


For example, to discover 10 facets with 5 values each over 1000 extended results:


       FacetOptions facetOption = FacetOptions.newBuilder()
           .setDiscoverLimit(10)
           .setDiscoverValueLimit(5)
           .setDepth(1000)
           .build();
     
## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> FacetOptions

## Inherited Members

[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)

## Static Methods

### newBuilder()

    public static FacetOptions.Builder newBuilder()

Creates and returns an empty Builder.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.search.FacetOptions.Builder` | a Builder which can construct a facet options. |

### newBuilder(FacetOptions options)

    public static FacetOptions.Builder newBuilder(FacetOptions options)

Creates and returns a Builder that reflects the given options.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `options` | `https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.search.FacetOptions` the options that the returned builder will reflect. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.search.FacetOptions.Builder` | a new builder with values set from the given options. |

## Methods

### getDepth()

    public Integer getDepth()

Returns the number of documents from the search result to be analyzed for facet discovery
or null if unset.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html` |   |

### getDiscoveryLimit()

    public Integer getDiscoveryLimit()

Returns the number of facets to be discovered or null if unset.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html` |   |

### getDiscoveryValueLimit()

    public Integer getDiscoveryValueLimit()

Returns the maximum number of values for each discovered facet or null if unset.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html` |   |

### toString()

    public String toString()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

**Overrides** [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--)