1.0.0-beta25 (latest) 1.0.0-beta24

    public sealed class SearchRequest.Types.FacetSpec.Types.FacetKey : IMessage<SearchRequest.Types.FacetSpec.Types.FacetKey>, IEquatable<SearchRequest.Types.FacetSpec.Types.FacetKey>, IDeepCloneable<SearchRequest.Types.FacetSpec.Types.FacetKey>, IBufferMessage, IMessage

Reference documentation and code samples for the Discovery Engine v1beta API class SearchRequest.Types.FacetSpec.Types.FacetKey.

Specifies how a facet is computed.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> SearchRequest.Types.FacetSpec.Types.FacetKey

## Implements

[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[SearchRequest](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest)[Types](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types)[FacetSpec](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.FacetSpec)[Types](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.FacetSpec.Types)[FacetKey](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.FacetSpec.Types.FacetKey), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[SearchRequest](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest)[Types](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types)[FacetSpec](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.FacetSpec)[Types](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.FacetSpec.Types)[FacetKey](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.FacetSpec.Types.FacetKey), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[SearchRequest](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest)[Types](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types)[FacetSpec](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.FacetSpec)[Types](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.FacetSpec.Types)[FacetKey](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.FacetSpec.Types.FacetKey), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html)

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.DiscoveryEngine.V1Beta](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta)

## Assembly

Google.Cloud.DiscoveryEngine.V1Beta.dll

## Constructors

### FacetKey()

    public FacetKey()

### FacetKey(FacetKey)

    public FacetKey(SearchRequest.Types.FacetSpec.Types.FacetKey other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequesthttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.FacetSpechttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.FacetSpec.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.FacetSpec.Types.FacetKey` |

## Properties

### CaseInsensitive

    public bool CaseInsensitive { get; set; }

True to make facet keys case insensitive when getting faceting
values with prefixes or contains; false otherwise.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### Contains

    public RepeatedField<string> Contains { get; }

Only get facet values that contain the given strings. For example,
suppose "category" has three values "Action \> 2022",
"Action \> 2021" and "Sci-Fi \> 2022". If set "contains" to "2022", the
"category" facet only contains "Action \> 2022" and "Sci-Fi \> 2022".
Only supported on textual fields. Maximum is 10.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://learn.microsoft.com/dotnet/api/system.string` |   |

### Intervals

    public RepeatedField<Interval> Intervals { get; }

Set only if values should be bucketed into intervals. Must be set
for facets with numerical values. Must not be set for facet with text
values. Maximum number of intervals is 30.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.Interval` |   |

### Key

    public string Key { get; set; }

Required. Supported textual and numerical facet keys in
\[Document\]\[google.cloud.discoveryengine.v1beta.Document\] object, over
which the facet values are computed. Facet key is case-sensitive.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### OrderBy

    public string OrderBy { get; set; }

The order in which documents are returned.

Allowed values are:

- "count desc", which means order by
  \[SearchResponse.Facet.values.count\]\[google.cloud.discoveryengine.v1beta.SearchResponse.Facet.FacetValue.count\]
  descending.

- "value desc", which means order by
  \[SearchResponse.Facet.values.value\]\[google.cloud.discoveryengine.v1beta.SearchResponse.Facet.FacetValue.value\]
  descending.
  Only applies to textual facets.

If not set, textual values are sorted in [natural
order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
intervals are sorted in the order given by
\[FacetSpec.FacetKey.intervals\]\[google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey.intervals\].

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### Prefixes

    public RepeatedField<string> Prefixes { get; }

Only get facet values that start with the given string prefix. For
example, suppose "category" has three values "Action \> 2022",
"Action \> 2021" and "Sci-Fi \> 2022". If set "prefixes" to "Action", the
"category" facet only contains "Action \> 2022" and "Action \> 2021".
Only supported on textual fields. Maximum is 10.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://learn.microsoft.com/dotnet/api/system.string` |   |

### RestrictedValues

    public RepeatedField<string> RestrictedValues { get; }

Only get facet for the given restricted values. Only supported on
textual fields. For example, suppose "category" has three values
"Action \> 2022", "Action \> 2021" and "Sci-Fi \> 2022". If set
"restricted_values" to "Action \> 2022", the "category" facet only
contains "Action \> 2022". Only supported on textual fields. Maximum
is 10.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://learn.microsoft.com/dotnet/api/system.string` |   |