# Google Cloud Discovery Engine V1 Client - Class StringConstraint (1.11.1)

1.11.1 (latest) 1.11.0 1.10.1 1.9.1 1.8.0 1.7.0 1.6.1 1.5.1 1.4.0 1.3.3 1.2.0 1.1.0 1.0.0 0.11.3 0.8.0 0.7.1 0.6.0 0.5.0 0.4.0 0.3.0 0.2.0 0.1.1 Reference documentation and code samples for the Google Cloud Discovery Engine V1 Client class StringConstraint.

Constraint expression of a string field.

Generated from protobuf message `google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.StringConstraint`

## Namespace

Google \\ Cloud \\ DiscoveryEngine \\ V1 \\ SearchResponse \\ NaturalLanguageQueryUnderstandingInfo \\ StructuredExtractedFilter

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ field_name` | `string` Name of the string field as defined in the schema. |
| `↳ values` | `string[]` Values of the string field. The record will only be returned if the field value matches one of the values specified here. |
| `↳ query_segment` | `string` Identifies the keywords within the search query that match a filter. |

### getFieldName

Name of the string field as defined in the schema.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setFieldName

Name of the string field as defined in the schema.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getValues

Values of the string field. The record will only be returned if the
field value matches one of the values specified here.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setValues

Values of the string field. The record will only be returned if the
field value matches one of the values specified here.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string[]` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getQuerySegment

Identifies the keywords within the search query that match a filter.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setQuerySegment

Identifies the keywords within the search query that match a filter.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |