# Google Cloud Retail V2 Client - Class SearchMode (2.5.3)

2.5.3 (latest) 2.5.2 2.4.0 2.3.1 2.2.1 2.1.3 2.0.0 1.7.0 1.6.4 1.5.0 1.4.2 1.3.1 1.2.1 1.1.1 1.0.1 Reference documentation and code samples for the Google Cloud Retail V2 Client class SearchMode.

The search mode of each search request.

Protobuf type `google.cloud.retail.v2.SearchRequest.SearchMode`

## Namespace

Google \\ Cloud \\ Retail \\ V2 \\ SearchRequest

## Methods

### static::name

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `mixed` |

### static::value

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `mixed` |

## Constants

### SEARCH_MODE_UNSPECIFIED

    Value: 0

Default value. In this case both product search and faceted search will
be performed. Both
[SearchResponse.SearchResult](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchResponse.SearchResult)
and [SearchResponse.Facet](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchResponse.Facet)
will be returned.

Generated from protobuf enum `SEARCH_MODE_UNSPECIFIED = 0;`

### PRODUCT_SEARCH_ONLY

    Value: 1

Only product search will be performed. The faceted search will be
disabled.

Only
[SearchResponse.SearchResult](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchResponse.SearchResult)
will be returned.
[SearchResponse.Facet](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchResponse.Facet) will
not be returned, even if
[SearchRequest.facet_specs](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchRequest#_Google_Cloud_Retail_V2_SearchRequest__getFacetSpecs__)
or
[SearchRequest.dynamic_facet_spec](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchRequest#_Google_Cloud_Retail_V2_SearchRequest__getDynamicFacetSpec__)
is set.

Generated from protobuf enum `PRODUCT_SEARCH_ONLY = 1;`

### FACETED_SEARCH_ONLY

    Value: 2

Only faceted search will be performed. The product search will be
disabled.

When in this mode, one or both of
[SearchRequest.facet_specs](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchRequest#_Google_Cloud_Retail_V2_SearchRequest__getFacetSpecs__)
and
[SearchRequest.dynamic_facet_spec](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchRequest#_Google_Cloud_Retail_V2_SearchRequest__getDynamicFacetSpec__)
should be set. Otherwise, an INVALID_ARGUMENT error is returned. Only
[SearchResponse.Facet](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchResponse.Facet) will
be returned.
[SearchResponse.SearchResult](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchResponse.SearchResult)
will not be returned.

Generated from protobuf enum `FACETED_SEARCH_ONLY = 2;`