# User Defined Mapping Match Types

[Zingg Enterprise Feature](#user-content-fn-1)[^1]

**Leveraging domain expertise to push matching accuracy. Also save time massaging data before matching.**

While the Zingg matching algorithms learn the variations from the user labels, completely different attributes pose a challenge to matching accuracy. In the case of nicknames, or company abberviations, domain input can greatly enhance matching accuracy. Zingg's `MAPPING` match type is built for such cases.

To leverage user expertise for nicknames for example, the user can supply Zingg with a mapping json file `nicknames.json` which denotes nicknames. Zingg has prebuilt mappings for company names, nicknames etc. Or you can define your own mappings too.

Here is the structure of the json:

<pre class="language-json"><code class="lang-json"><strong>[  
</strong>  ["Will", "Bill", "William"],
  ["John", "Johnny", "Jack"],
  ["Robert", "Rob", "Bob", "Bobby"],
  ["Charles", "Charlie", "Chuck"],
  ["James", "Jim", "Jimmy"],
  ["Thomas", "Tom", "Tommy"]
...
]   
</code></pre>

Each line here represents common nicknames which represent the same name.

To use this mapping within Zingg, define the field's match type as `MAPPING_<filename>` which in our case would be `mapping_nicknames`

```json
"fieldDefinition":[
   	{
   		"fieldName" : "name",
   		"matchType" : "mapping_nicknames, fuzzy",
   		"fields" : "name",
   		"dataType": "string"
   	}
```

### Transform and Match

The `MAPPING` match type can also be used to transform and normalise categorical data. Let us say different data sources have different representations of gender. In one, gender is represented as M and F, in another it is noted as Male, Female and in the third as 1 and 2. Instead of transforming the gender column beforehand, one could create a mapping json called `gender.json` .

<pre><code><strong>[  
</strong>  ["M", "Male", "1"],
  ["F", "Female", "2"]
]  
</code></pre>

When we use it for the gender field like below, Zingg would automatically handle the transformation so that you don't have to.

```
"fieldDefinition":[
   	{
   		"fieldName" : "gender",
   		"matchType" : "mapping_gender, exact",
   		"fields" : "gender",
   		"dataType": "string"
   	},
```

[^1]: Zingg Enterprise is the suite of proprietary products licensed by Zingg. Please refer to <https://www.zingg.ai/product/zingg-entity-resolution-compare-versions> for individual tier features.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.zingg.ai/latest/stepbystep/configuration/adv-matchtypes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
