By default, entity matching requires an exact match for one of the entity entries.
This works well for single-word entity entry values and synonyms
but may present a problem for multi-word values and synonyms.
For example,
consider a *ball* entity
that should be matched for the following end-user expression parts:

- "ball"
- "red ball"
- "ball red"
- "small ball"
- "ball small"
- "small red ball"
- "small ball red"
- "red small ball"
- "red ball small"
- "ball small red"
- "ball red small"

For a match to occur,
you normally need to define an entity entry value and synonyms for each of these permutations.
However, with fuzzy matching enabled,
the ordering of the words in a value or synonym does not matter.
The following will trigger a match for all of the examples above:

- "ball"
- "red ball"
- "small ball"
- "small red ball"

## Create a fuzzy matching entity

### Console

1. Open the [Dialogflow CX console](https://dialogflow.cloud.google.com/cx/projects).
2. Choose your GCP project.
3. Select your agent.
4. Select the **Manage** tab.
5. Click **Entity Types**.
6. Click **Create**.
7. Check **Fuzzy matching**.
8. Complete remaining fields.
9. Click **Save**.

### API

Set the `EntityType.enableFuzzyExtraction` field to true.


<button class="devsite-dialog-button cloud-button cloud-button--primary" style="display: block; padding: 10px; margin-top: 10px; margin-bottom: 10px;" data-modal-dialog-id="cx-agent-reference-dialog-EntityType">Go to the EntityType API reference</button>
**Select a protocol and version for the EntityType reference:**

| Protocol | V3 | V3beta1 |
|---|---|---|
| REST | [EntityType resource](https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3/projects.locations.agents.entityTypes) | [EntityType resource](https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/projects.locations.agents.entityTypes) |
| RPC | [EntityType interface](https://docs.cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3#google.cloud.dialogflow.cx.v3.EntityTypes) | [EntityType interface](https://docs.cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3beta1#google.cloud.dialogflow.cx.v3beta1.EntityTypes) |
| C++ | [EntityTypesClient](https://googleapis.dev/cpp/google-cloud-dialogflow_cx/latest/classgoogle_1_1cloud_1_1dialogflow__cx_1_1EntityTypesClient.html) | Not available |
| C# | [EntityTypesClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.Cx.V3/latest/Google.Cloud.Dialogflow.Cx.V3.EntityTypesClient) | Not available |
| Go | [EntityTypesClient](https://docs.cloud.google.com/go/docs/reference/cloud.google.com/go/dialogflow/latest/cx/apiv3#cloud_google_com_go_dialogflow_cx_apiv3_EntityTypesClient) | Not available |
| Java | [EntityTypesClient](https://docs.cloud.google.com/java/docs/reference/google-cloud-dialogflow-cx/latest/com.google.cloud.dialogflow.cx.v3.EntityTypesClient) | [EntityTypesClient](https://docs.cloud.google.com/java/docs/reference/google-cloud-dialogflow-cx/latest/com.google.cloud.dialogflow.cx.v3beta1.EntityTypesClient) |
| Node.js | [EntityTypesClient](https://googleapis.dev/nodejs/dialogflow-cx/latest/v3.EntityTypesClient.html) | [EntityTypesClient](https://googleapis.dev/nodejs/dialogflow-cx/latest/v3beta1.EntityTypesClient.html) |
| PHP | Not available | Not available |
| Python | [EntityTypesClient](https://docs.cloud.google.com/python/docs/reference/dialogflow-cx/latest/google.cloud.dialogflowcx_v3.services.entity_types.EntityTypesClient) | [EntityTypesClient](https://docs.cloud.google.com/python/docs/reference/dialogflow-cx/latest/google.cloud.dialogflowcx_v3beta1.services.entity_types.EntityTypesClient) |
| Ruby | Not available | Not available |

<button class="devsite-dialog-close">Close</button>

<br />

## Limitations

The following limitations apply:

- Fuzzy matching cannot be enabled for [regexp entities](https://docs.cloud.google.com/dialogflow/docs/entities-regexp). These features are mutually exclusive.
- Fuzzy matching should not be enabled for entities which are used to match strict values like IDs, national identification numbers, and so on.