Search for potential matches for entity specified in JSON with scoring
Learn how the Scored Matches API returns potential matches with scoring for entities provided in the JSON request body, based on rules in the entity type configuration.
The Scored Matches API returns potential matches with scoring for entities provided in the JSON request body, based on rules in the entity type configuration.
For each matched entity, the score is calculated as follows:
totalScore
= MAX(standaloneScore
of all
matched rules) + SUM(incrementalScore
of ALL matched rules including
the rule from standaloneScore
)
Request
POST {TenantURL}/entities/_scoredmatches
Parameter | Required | Description | |
---|---|---|---|
Headers |
Authorization
| Yes | Information about authentication access token in Bearer
<accessToken> format. For more information, see Authentication API. |
Body | Yes | JSON array with objects representing entity objects to be matched. | |
Query |
max
| No | Defines the maximum number of returned matches. The default value is 200. |
rules
| No | Defines match rule URI s to be used in matching. This
parameter can be used several times in a request. Each time the
parameter must specify one match rule URI, for example:
rules=configuration/entityTypes/Individual/matchGroups/matchGroup1&rules=
configuration/entityTypes/Individual/matchGroups/matchGroup2 | |
options
| No | Comma-separated list of different options, which affect entity's
JSON content in the response. Available options:
| |
select | Comma-separated list of properties from the entity structure that
must be returned in a response. Allows you to return a partial entity
object. Example: To ensure improved
performance of
If the Request has the select parameter, there must not be any space between the query parameters. | ||
offset | No | Integer value that can be used to organize pagination in the response. The default value is 0. | |
cleanse | No | When it is set to true, the API cleanses the attribute values of the entities. Then the cleansed entities are matched with the entities in the tenant. The default value is false. |
Response
Returns all matches of posted entity with scoring and rules the entity matched on. Note that an error can be returned instead of entities collection.
Request
POST {
TenantURL
}
/entities/_scoredmatchesHeaders: Authorization: Bearer 204938 ca-2 cf7-44 b0-b11a-1 b4c59984512[{
"type": "configuration/entityTypes/HCP",
"attributes": {
"FirstName": [{
"value": "William"
}],
"MiddleName": [{
"value": "James"
}],
"LastName": [{
"value": "Harley"
}],
"SuffixName": [{
"value": "Mr."
}],
"Degrees": [{
"value": {
"Degree": [{
"value": "Lord"
}]
}
}],
"Address": [{
"value": {
"AddressLine1": [{
"value": "USA, VI, Milwakee, Liberty plate 1234"
}],
"Zip": [{
"value": {
"Zip5": [{
"value": "123456"
}]
}
}]
}
}],
"ME": [{
"value": "123"
}]
}
}]
Response
In the response, for every entity:
[{
"index": 0,
"object": [{
"URI": "entities/HCP.testSearchDuplicatesForNonExistentEntity.2",
"type": "configuration/entityTypes/HCP",
"matchScore": 51,
"matchGroups": [
"configuration/entityTypes/HCP/matchGroups/PersonByMESuspect"
],
"attributes": {...
},
...
}, {
"URI": "entities/HCP.testSearchDuplicatesForNonExistentEntity.1",
"type": "configuration/entityTypes/HCP",
"matchScore": 81,
"matchGroups": [
"configuration/entityTypes/HCP/matchGroups/PersonByNameSuffixAddrAuto",
"configuration/entityTypes/HCP/matchGroups/PersonByNameSuffixDegreeAddrSuspect",
"configuration/entityTypes/HCP/matchGroups/PersonByNameSuffixDegreeAddrAuto"
],
"attributes": {...
},
...
}],
"successful": true
}]