# Google Cloud Discovery Engine V1 Client - Class NumberConstraint (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 NumberConstraint.

Constraint expression of a number field. Example: price \< 100.

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

## 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 numerical field as defined in the schema. |
| `↳ comparison` | `int` The comparison operation performed between the field value and the value specified in the constraint. |
| `↳ value` | `float` The value specified in the numerical constraint. |
| `↳ query_segment` | `string` Identifies the keywords within the search query that match a filter. |

### getFieldName

Name of the numerical field as defined in the schema.

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

### setFieldName

Name of the numerical field as defined in the schema.

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

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

### getComparison

The comparison operation performed between the field value and the
value specified in the constraint.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [Comparison](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.NumberConstraint.Comparison). |

### setComparison

The comparison operation performed between the field value and the
value specified in the constraint.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [Comparison](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.NumberConstraint.Comparison). |

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

### getValue

The value specified in the numerical constraint.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `float` |   |

### setValue

The value specified in the numerical constraint.

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

| **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` |   |