Realtime
Initially, we will present the data models that will be used by the queries that will be displayed in this section.
Understanding the data sample for this chapter
Data Model: Student
Data: Student
Data model: Registry
Data: Registry
1. API/Endpoint
The endpoint to be used to query data is POST /api/v2/queries/filter:
The parameters are described below:
Pagination (Query Parameters)
- offset: The record position to start to get results from.
- pageSize: Number of records to get (limited to 1000).
- sortBy: Field to sort the information (Ex: mdmGoldenFieldAndValues.name , sortBy name).
- sortOrder: In case sortBy is used, the order to consider (Values : ASC or DESC).
- indexType: Index to query data from (STAGING/MASTER).
- fields: Fields returned in the response.
- tags: Filter by tag from Data Model.
- body: Json Request
Payload (JSON)
- mustList: List of filters that MUST be true to return record (It's the same AND at SQL).
- mustNotList: List of filters that MUST NOT be true to return record (It's the same NOT at SQL).
- shouldList: List of filters that SHOULD be true to return record (It's the same OR at SQL).
- minimumShouldMatch: Number of should filters that must match to be returned.
- aggregationList: Aggregations/summaries to get the result.
2. Filters
The filters are pieces of JSON code that should be used to create the effective query, and to add it in the needed filter payload (some samples: mustList, mustNotList or shouldList, depending on the use case).
The filter structure is the following:
- mdmFilterType: Type of filter to apply (verify the next section: Filter Types)
- mdmKey: Field to apply the filter
- mdmValue: Value to filter
- mdmRangeValues: Range to filter, in case the type requires it
- mdmPath: Field path, in the case of nested queries
TYPE_FILTER
This filter specifies the type (table name) to get the data from. All the queries must specify a type in the JSON attribute "mustList".
An example that will filter all records from student type. It’s the same that "select s.* from student s" at SQL. Note: In this case, the data model name was concatenated with "Golden".
JSON Request :
{
"mustList": [
{
"mdmFilterType": "TYPE_FILTER",
"mdmValue": "studentGolden"
}
]
}
JSON Response :
{
"count": 7,
"totalHits": 7,
"took": 2,
"hits": [
{
"mdmCounterForEntity": 20,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0083-10-14T00:00:00Z",
"gender": "M",
"staudentid": "3",
"phone": [
{
"mdmphonenumber": "91187226",
"mdmphonetype": "1"
},
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "4085075432"
}
],
"mdmaddress": [
{
"mdmstate": "CA",
"mdmzipcode": "94032",
"mdmcountry": "US",
"mdmcity": "Mountain View",
"mdmaddress1": "650 Castro Street",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "1",
"mdmname": "Antônio dos Santos"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5ac37080c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"e7434fd905c67f408f2834304e676e3e"
]
},
"_score": 1.4142135,
"mdmLastUpdated": "2018-04-04T14:23:40.833Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "3 Antônio dos Santos",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5ac37080c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "3"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ac45ae0c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 19,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "2011-09-11T00:00:00Z",
"gender": "M",
"staudentid": "5",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "47987654357"
}
],
"mdmaddress": [
{
"mdmstate": "SC",
"mdmzipcode": "89233004",
"mdmcountry": "Brasil",
"mdmcity": "Joinville",
"mdmaddress1": "Av Santos Dumont 935",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "3",
"mdmname": "Eduardo da Silva"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5acdf7d0c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"aa7da14444f8531fa4963c370ac84adf"
]
},
"_score": 1.4142135,
"mdmLastUpdated": "2018-04-04T13:48:29.987Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "5 Eduardo da Silva",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5acdf7d0c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "5"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5acf0940c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 27,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0058-09-05T00:00:00Z",
"gender": "",
"staudentid": "7",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "11976593432"
}
],
"mdmaddress": [
{
"mdmstate": "SP",
"numberaddress": "110",
"mdmzipcode": "89233004",
"mdmcountry": "Brasil",
"mdmaddress2": "",
"mdmcity": "Sao Paulo",
"mdmaddress1": "Av Blumenau",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "0",
"mdmname": "Joao Pereira"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5ad5e710c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"d01d5b92021bd878ba9f2d182ecad488"
]
},
"_score": 1.4142135,
"mdmLastUpdated": "2018-04-05T23:24:22.537Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "7 Joao Pereira",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5ad5e710c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "7"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ad6d170c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 30,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0088-01-03T00:00:00Z",
"gender": "F",
"staudentid": "1",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "47998493432"
}
],
"mdmaddress": [
{
"mdmstate": "SC",
"numberaddress": "100",
"mdmzipcode": "89233004",
"mdmcountry": "Brazil",
"mdmaddress2": "",
"mdmcity": "Joinville",
"mdmaddress1": "Rua Sao Paulo 123",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "2",
"mdmname": "Joana Silva da Cunha"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5aac8d20c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"82e8d5670d0d179255fb523bb85cc0e9"
]
},
"_score": 1.4142135,
"mdmLastUpdated": "2018-04-07T17:22:58.053Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "1 Joana Silva da Cunha",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:34Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5aac8d20c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "1"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ab4ca80c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 29,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0097-04-06T00:00:00Z",
"gender": "F",
"staudentid": "6",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "11998344432"
}
],
"mdmaddress": [
{
"mdmstate": "SP",
"mdmzipcode": "89233004",
"mdmcountry": "Brasil",
"mdmcity": "Sao Paulo",
"mdmaddress1": "Girassol 343",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "2",
"mdmname": "Juliana da Rosa Silva"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5ad1ef70c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"90f6e072dc37fdf557ddfca2b378bf8a"
]
},
"_score": 1.4142135,
"mdmLastUpdated": "2018-04-07T17:22:35.564Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "6 Juliana da Rosa Silva",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5ad1ef70c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "6"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ad300e0c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 28,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0091-11-03T00:00:00Z",
"gender": "F",
"staudentid": "2",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "47998493432"
}
],
"mdmaddress": [
{
"mdmstate": "SC",
"mdmzipcode": "89233004",
"mdmcountry": "Brazil",
"mdmcity": "Joinville",
"mdmaddress1": "Rua Jasmim 543",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "2",
"mdmname": "Carla Paula"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5abeb590c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"57f39965487768e3defde4238dc2a082"
]
},
"_score": 1.4142135,
"mdmLastUpdated": "2018-04-07T17:22:06.262Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "2 Carla Paula",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5abeb590c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "2"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5abfc700c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 31,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0083-02-23T00:00:00Z",
"gender": "F",
"staudentid": "4",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "4085075432"
}
],
"mdmaddress": [
{
"mdmstate": "CA",
"mdmzipcode": "94032",
"mdmcountry": "US",
"mdmcity": "San Jose",
"mdmaddress1": "3421 El Camino Real",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "3",
"mdmname": "Ana dos Santos"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5ac67dc0c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"51a2247e1a8ed06579c35754af9e13a9"
]
},
"_score": 1.4142135,
"mdmLastUpdated": "2018-04-07T17:23:27.385Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "4 Ana dos Santos",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5ac67dc0c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "4"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5acaea90c3ee11e792b20242ac110003"
}
]
}
The response attributes are described following:
- count - The total number of records returned respecting the records per pages.
- totalHits - The total number of records matches to filter applied.
- took - Runtime in milliseconds.
- hits - Collection of records returned of the query.
TERM_FILTER
This filter is used to filter data by term value, similar to SQL = operation. Example, that will filter records from studentGolden where "name" matches "joana". In this case, it is not case sensitive. It’s similar to "SELECT s.* FROM student s WHERE UPPER(s.mdmname) = UPPER("joana")" on SQL.
JSON Request
{
"mustList": [
{
"mdmFilterType": "TYPE_FILTER",
"mdmValue": "studentGolden"
},
{
"mdmFilterType": "TERM_FILTER",
"mdmKey": "mdmGoldenFieldAndValues.mdmname",
"mdmValue": "joana"
}
]
}
JSON Response
{
"count": 1,
"totalHits": 1,
"took": 1,
"hits": [
{
"mdmCounterForEntity": 1,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0088-01-03T00:00:00Z",
"gender": "F",
"staudentid": "1",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "47998493432"
}
],
"mdmaddress": [
{
"mdmstate": "SC",
"mdmzipcode": "89233004",
"mdmcountry": "Brazil",
"mdmcity": "Joinville",
"mdmaddress1": "Rua Sao Paulo 123",
"mdmaddresstype": "Residencial"
}
],
"mdmname": "Joana Silva"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5aac8d20c3ee11e792b20242ac110003"
]
},
"_score": 7.8581285,
"mdmLastUpdated": "2017-11-07T19:36:42.250Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 1,
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:34Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5aac8d20c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmCrossreference": {
"student": {
"code": "1"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ab4ca80c3ee11e792b20242ac110003"
}
]
}
The query is run on an indexed database, so if an exact match is required on a String field, the keyword .raw must be included. It’s similar to "SELECT s.* FROM student s WHERE s.mdmname = 'joana' " on SQL.
JSON Request
{
"mustList": [
{
"mdmFilterType": "TYPE_FILTER",
"mdmValue": "studentGolden"
},
{
"mdmFilterType": "TERM_FILTER",
"mdmKey": "mdmGoldenFieldAndValues.mdmname.raw",
"mdmValue": "joana"
}
]
}
In this case, there is no student named "joana".
JSON Response
{
"count": 0,
"totalHits": 0,
"took": 1,
"hits": []
}
The keyword ".folded" is included when the filter must be case insensitive and ignore diacritics. It’s similar to "SELECT s.* FROM student s WHERE s.mdmname LIKE UPPER(antonio)" on SQL.
JSON Request
{
"mustList": [
{
"mdmFilterType": "TYPE_FILTER",
"mdmValue": "studentGolden"
},
{
"mdmFilterType": "TERM_FILTER",
"mdmKey": "mdmGoldenFieldAndValues.mdmname.folded",
"mdmValue": "antonio"
}
]
}
This filter matches "Antônio dos Santos"
JSON Response
{
"count": 1,
"totalHits": 1,
"took": 1,
"hits": [
{
"mdmCounterForEntity": 8,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0083-10-14T00:00:00Z",
"gender": "M",
"staudentid": "3",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "4085075432"
}
],
"mdmaddress": [
{
"mdmstate": "CA",
"mdmzipcode": "94032",
"mdmcountry": "US",
"mdmcity": "Mountain View",
"mdmaddress1": "650 Castro Street",
"mdmaddresstype": "Residencial"
}
],
"mdmname": "Antônio dos Santos"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5ac37080c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"e7434fd905c67f408f2834304e676e3e"
]
},
"_score": 4.056321,
"mdmLastUpdated": "2018-04-03T00:46:22.315Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "3 Antônio dos Santos",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5ac37080c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "3"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ac45ae0c3ee11e792b20242ac110003"
}
]
}
Note: Using "mdmFilterType = TERM_FILTER" the "folded" will not treat input parameter (mdmValue) as insensitive and ignore diacritics. If you want this behavior you must use "mdmFilterType = MATCH_FILTER" that will be explained along with this documentation.
JSON Request
{
"mustList": [
{
"mdmFilterType": "TYPE_FILTER",
"mdmValue": "studentGolden"
},
{
"mdmFilterType": "TERM_FILTER",
"mdmKey": "mdmGoldenFieldAndValues.mdmname.folded",
"mdmValue": "ântonio"
}
]
}
JSON Response
{
"count": 0,
"totalHits": 0,
"took": 1,
"hits": []
}
Several filter types to simple filed (not nested) owns its nested version type. If you need to filter by a term inside a NESTED structure its needed to specify the mdmPath. The attribute mdmPath must be the path to the nested field.
Example, that will filter records where "mdmcity"(from nested address) matches "Mountain View".
JSON Request
{
"mustList": [
{
"mdmFilterType": "TYPE_FILTER",
"mdmValue": "studentGolden"
},
{
"mdmFilterType": "TERM_FILTER",
"mdmPath": "mdmGoldenFieldAndValues.mdmaddress",
"mdmKey": "mdmGoldenFieldAndValues.mdmaddress.mdmcity.raw",
"mdmValue": "Mountain View"
}
]
}
JSON Response
{
"count": 1,
"totalHits": 1,
"took": 1,
"hits": [
{
"mdmCounterForEntity": 8,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0083-10-14T00:00:00Z",
"gender": "M",
"staudentid": "3",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "4085075432"
}
],
"mdmaddress": [
{
"mdmstate": "CA",
"mdmzipcode": "94032",
"mdmcountry": "US",
"mdmcity": "Mountain View",
"mdmaddress1": "650 Castro Street",
"mdmaddresstype": "Residencial"
}
],
"mdmname": "Antônio dos Santos"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5ac37080c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"e7434fd905c67f408f2834304e676e3e"
]
},
"_score": 7.1779675,
"mdmLastUpdated": "2018-04-03T00:46:22.315Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "3 Antônio dos Santos",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5ac37080c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "3"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ac45ae0c3ee11e792b20242ac110003"
}
]
}
Besides the 'mustList' attribute, there is also a "shouldList" attribute. We can use "shouldList" just like an "OR" clause.
In the case below the filter will return students with name equal to 'Carla' or 'Joana'. It's similar to "SELECT * FROM student WHERE name = 'carla' OR name = 'joana' " on SQL.
JSON Request
{
"mustList": [
{
"mdmFilterType": "TYPE_FILTER",
"mdmValue": "studentGolden"
}
],
"shouldList": [
{
"mdmFilterType": "TERM_FILTER",
"mdmKey": "mdmGoldenFieldAndValues.mdmname",
"mdmValue": "joana"
},
{
"mdmFilterType": "TERM_FILTER",
"mdmKey": "mdmGoldenFieldAndValues.mdmname.folded",
"mdmValue": "antônio"
}
]
}
JSON Response
{
"count": 2,
"totalHits": 2,
"took": 1,
"hits": [
{
"mdmCounterForEntity": 30,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0088-01-03T00:00:00Z",
"gender": "F",
"staudentid": "1",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "47998493432"
}
],
"mdmaddress": [
{
"mdmstate": "SC",
"numberaddress": "100",
"mdmzipcode": "89233004",
"mdmcountry": "Brazil",
"mdmaddress2": "",
"mdmcity": "Joinville",
"mdmaddress1": "Rua Sao Paulo 123",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "2",
"mdmname": "Joana Silva da Cunha"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5aac8d20c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"82e8d5670d0d179255fb523bb85cc0e9"
]
},
"_score": 2.9474528,
"mdmLastUpdated": "2018-04-07T17:22:58.053Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "1 Joana Silva da Cunha",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:34Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5aac8d20c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "1"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ab4ca80c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 28,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0091-11-03T00:00:00Z",
"gender": "F",
"staudentid": "2",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "47998493432"
}
],
"mdmaddress": [
{
"mdmstate": "SC",
"mdmzipcode": "89233004",
"mdmcountry": "Brazil",
"mdmcity": "Joinville",
"mdmaddress1": "Rua Jasmim 543",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "2",
"mdmname": "Carla Paula"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5abeb590c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"57f39965487768e3defde4238dc2a082"
]
},
"_score": 2.9474528,
"mdmLastUpdated": "2018-04-07T17:22:06.262Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "2 Carla Paula",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5abeb590c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "2"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5abfc700c3ee11e792b20242ac110003"
}
]
}
TERMS_FILTER
This filter is similar to the TERM_FILTER mentioned above, but it allows to specify a group (list) of terms to be used in the query. The maximum number of terms allowed in this list is 5000.
Example, that will filter records where "name" matches either "Joana Silva" or "Carla Paula". It’s similar to "SELECT s.* FROM student s WHERE s.mdmname = 'Joana Silva' OR s.mdmname = 'Carla Paula'" on SQL.
JSON Request
{
"mustList": [
{
"mdmFilterType": "TYPE_FILTER",
"mdmValue": "studentGolden"
},
{
"mdmFilterType": "TERMS_FILTER",
"mdmKey": "mdmGoldenFieldAndValues.mdmname.raw",
"mdmValue": ["Joana Silva","Carla Paula"]
}
]
}
JSON Response
{
"count": 2,
"totalHits": 2,
"took": 1,
"hits": [
{
"mdmCounterForEntity": 1,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0088-01-03T00:00:00Z",
"gender": "F",
"staudentid": "1",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "47998493432"
}
],
"mdmaddress": [
{
"mdmstate": "SC",
"mdmzipcode": "89233004",
"mdmcountry": "Brazil",
"mdmcity": "Joinville",
"mdmaddress1": "Rua Sao Paulo 123",
"mdmaddresstype": "Residencial"
}
],
"mdmname": "Joana Silva"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5aac8d20c3ee11e792b20242ac110003"
]
},
"_score": 2.8996353,
"mdmLastUpdated": "2017-11-07T19:36:42.250Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 1,
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:34Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5aac8d20c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmCrossreference": {
"student": {
"code": "1"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ab4ca80c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 2,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0091-11-03T00:00:00Z",
"gender": "F",
"staudentid": "2",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "47998493432"
}
],
"mdmaddress": [
{
"mdmstate": "SC",
"mdmzipcode": "89233004",
"mdmcountry": "Brazil",
"mdmcity": "Joinville",
"mdmaddress1": "Rua Jasmim 543",
"mdmaddresstype": "Residencial"
}
],
"mdmname": "Carla Paula"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5abeb590c3ee11e792b20242ac110003"
]
},
"_score": 2.8996353,
"mdmLastUpdated": "2017-11-07T19:36:42.299Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 1,
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5abeb590c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmCrossreference": {
"student": {
"code": "2"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5abfc700c3ee11e792b20242ac110003"
}
]
}
For fields inside a NESTED structure, it is required to use the type TERMS_FILTER and specify the mdmPath.
Example, that will filter records where "mdmcity" matches either "Mountain View" or "Sao Paulo".
JSON Request
{
"mustList": [
{
"mdmFilterType": "TYPE_FILTER",
"mdmValue": "studentGolden"
},
{
"mdmFilterType": "TERMS_FILTER",
"mdmPath": "mdmGoldenFieldAndValues.mdmaddress",
"mdmKey": "mdmGoldenFieldAndValues.mdmaddress.mdmcity.raw",
"mdmValue": ["Mountain View","Sao Paulo"]
}
]
}
JSON Response
{
"count": 3,
"totalHits": 3,
"took": 1,
"hits": [
{
"mdmCounterForEntity": 8,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0083-10-14T00:00:00Z",
"gender": "M",
"staudentid": "3",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "4085075432"
}
],
"mdmaddress": [
{
"mdmstate": "CA",
"mdmzipcode": "94032",
"mdmcountry": "US",
"mdmcity": "Mountain View",
"mdmaddress1": "650 Castro Street",
"mdmaddresstype": "Residencial"
}
],
"mdmname": "Antônio dos Santos"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5ac37080c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"e7434fd905c67f408f2834304e676e3e"
]
},
"_score": 2.97511,
"mdmLastUpdated": "2018-04-03T00:46:22.315Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "3 Antônio dos Santos",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5ac37080c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "3"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ac45ae0c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 6,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0097-04-06T00:00:00Z",
"gender": "F",
"staudentid": "6",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "11998344432"
}
],
"mdmaddress": [
{
"mdmstate": "SP",
"mdmzipcode": "89233004",
"mdmcountry": "Brasil",
"mdmcity": "Sao Paulo",
"mdmaddress1": "Girassol 343",
"mdmaddresstype": "Residencial"
}
],
"mdmname": "Juliana Pereira"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5ad1ef70c3ee11e792b20242ac110003"
]
},
"_score": 2.6909852,
"mdmLastUpdated": "2017-11-07T19:36:42.464Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 1,
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5ad1ef70c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmCrossreference": {
"student": {
"code": "6"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ad300e0c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 7,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0058-09-05T00:00:00Z",
"gender": "M",
"staudentid": "7",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "11976593432"
}
],
"mdmaddress": [
{
"mdmstate": "SP",
"mdmzipcode": "89233004",
"mdmcountry": "Brasil",
"mdmcity": "Sao Paulo",
"mdmaddress1": "Av Blumenau",
"mdmaddresstype": "Residencial"
}
],
"mdmname": "Joao Pereira"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5ad5e710c3ee11e792b20242ac110003"
]
},
"_score": 2.6909852,
"mdmLastUpdated": "2017-11-07T19:36:42.508Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 1,
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5ad5e710c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmCrossreference": {
"student": {
"code": "7"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ad6d170c3ee11e792b20242ac110003"
}
]
}
RANGE_FILTER
This filter allows us to specify a range to get the results. Example, that will filter records where "siblingsnumber" is between 1 and 3. It’s similar to "SELECT s.* FROM student s WHERE s.siblingsnumber BETWEEN 1 AND 3" on SQL.
JSON Request
{
"mustList": [
{
"mdmFilterType": "TYPE_FILTER",
"mdmValue": "studentGolden"
},
{
"mdmFilterType": "RANGE_FILTER",
"mdmKey": "mdmGoldenFieldAndValues.siblingsnumber",
"mdmValue": [1,3]
}
]
}
JSON Response
{
"count": 2,
"totalHits": 2,
"took": 1,
"hits": [
{
"mdmCounterForEntity": 14,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0083-10-14T00:00:00Z",
"gender": "M",
"staudentid": "3",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "4085075432"
}
],
"mdmaddress": [
{
"mdmstate": "CA",
"mdmzipcode": "94032",
"mdmcountry": "US",
"mdmcity": "Mountain View",
"mdmaddress1": "650 Castro Street",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "1",
"mdmname": "Antônio dos Santos"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5ac37080c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"e7434fd905c67f408f2834304e676e3e"
]
},
"_score": 1.7320508,
"mdmLastUpdated": "2018-04-04T13:41:48.204Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "3 Antônio dos Santos",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5ac37080c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "3"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ac45ae0c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 19,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "2011-09-11T00:00:00Z",
"gender": "M",
"staudentid": "5",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "47987654357"
}
],
"mdmaddress": [
{
"mdmstate": "SC",
"mdmzipcode": "89233004",
"mdmcountry": "Brasil",
"mdmcity": "Joinville",
"mdmaddress1": "Av Santos Dumont 935",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "3",
"mdmname": "Eduardo da Silva"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5acdf7d0c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"aa7da14444f8531fa4963c370ac84adf"
]
},
"_score": 1.7320508,
"mdmLastUpdated": "2018-04-04T13:48:29.987Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "5 Eduardo da Silva",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5acdf7d0c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "5"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5acf0940c3ee11e792b20242ac110003"
}
]
}
Example, that will filter records where "siblingsnumber" is equal or greater than 3 It’s similar to "SELECT s.* FROM student s WHERE s.siblingsnumber >= 3" on SQL.
JSON Request
{
"mustList": [
{
"mdmFilterType": "TYPE_FILTER",
"mdmValue": "studentGolden"
},
{
"mdmFilterType": "RANGE_FILTER",
"mdmKey": "mdmGoldenFieldAndValues.siblingsnumber",
"mdmValue": [3,null]
}
]
}
JSON Response
{
"count": 1,
"totalHits": 1,
"took": 1,
"hits": [
{
"mdmCounterForEntity": 19,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "2011-09-11T00:00:00Z",
"gender": "M",
"staudentid": "5",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "47987654357"
}
],
"mdmaddress": [
{
"mdmstate": "SC",
"mdmzipcode": "89233004",
"mdmcountry": "Brasil",
"mdmcity": "Joinville",
"mdmaddress1": "Av Santos Dumont 935",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "3",
"mdmname": "Eduardo da Silva"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5acdf7d0c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"aa7da14444f8531fa4963c370ac84adf"
]
},
"_score": 1.7320508,
"mdmLastUpdated": "2018-04-04T13:48:29.987Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "5 Eduardo da Silva",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5acdf7d0c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "5"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5acf0940c3ee11e792b20242ac110003"
}
]
}
Example, that will filter records where "siblingsnumber" is equal or less than 2 It’s similar to "SELECT s.* FROM student s WHERE s.siblingsnumber <= 2" on SQL.
JSON Request
{
"mustList": [
{
"mdmFilterType": "TYPE_FILTER",
"mdmValue": "studentGolden"
},
{
"mdmFilterType": "RANGE_FILTER",
"mdmKey": "mdmGoldenFieldAndValues.siblingsnumber",
"mdmValue": [null,2]
}
]
}
JSON Response
{
"count": 5,
"totalHits": 5,
"took": 2,
"hits": [
{
"mdmCounterForEntity": 20,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0083-10-14T00:00:00Z",
"gender": "M",
"staudentid": "3",
"phone": [
{
"mdmphonenumber": "91187226",
"mdmphonetype": "1"
},
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "4085075432"
}
],
"mdmaddress": [
{
"mdmstate": "CA",
"mdmzipcode": "94032",
"mdmcountry": "US",
"mdmcity": "Mountain View",
"mdmaddress1": "650 Castro Street",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "1",
"mdmname": "Antônio dos Santos"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5ac37080c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"e7434fd905c67f408f2834304e676e3e"
]
},
"_score": 1.7320508,
"mdmLastUpdated": "2018-04-04T14:23:40.833Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "3 Antônio dos Santos",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5ac37080c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "3"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ac45ae0c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 27,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0058-09-05T00:00:00Z",
"gender": "",
"staudentid": "7",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "11976593432"
}
],
"mdmaddress": [
{
"mdmstate": "SP",
"numberaddress": "110",
"mdmzipcode": "89233004",
"mdmcountry": "Brasil",
"mdmaddress2": "",
"mdmcity": "Sao Paulo",
"mdmaddress1": "Av Blumenau",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "0",
"mdmname": "Joao Pereira"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5ad5e710c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"d01d5b92021bd878ba9f2d182ecad488"
]
},
"_score": 1.7320508,
"mdmLastUpdated": "2018-04-05T23:24:22.537Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "7 Joao Pereira",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5ad5e710c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "7"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ad6d170c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 30,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0088-01-03T00:00:00Z",
"gender": "F",
"staudentid": "1",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "47998493432"
}
],
"mdmaddress": [
{
"mdmstate": "SC",
"numberaddress": "100",
"mdmzipcode": "89233004",
"mdmcountry": "Brazil",
"mdmaddress2": "",
"mdmcity": "Joinville",
"mdmaddress1": "Rua Sao Paulo 123",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "2",
"mdmname": "Joana Silva da Cunha"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5aac8d20c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"82e8d5670d0d179255fb523bb85cc0e9"
]
},
"_score": 1.7320508,
"mdmLastUpdated": "2018-04-07T17:22:58.053Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "1 Joana Silva da Cunha",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:34Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5aac8d20c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "1"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ab4ca80c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 29,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0097-04-06T00:00:00Z",
"gender": "F",
"staudentid": "6",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "11998344432"
}
],
"mdmaddress": [
{
"mdmstate": "SP",
"mdmzipcode": "89233004",
"mdmcountry": "Brasil",
"mdmcity": "Sao Paulo",
"mdmaddress1": "Girassol 343",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "2",
"mdmname": "Juliana da Rosa Silva"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5ad1ef70c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"90f6e072dc37fdf557ddfca2b378bf8a"
]
},
"_score": 1.7320508,
"mdmLastUpdated": "2018-04-07T17:22:35.564Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "6 Juliana da Rosa Silva",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5ad1ef70c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "6"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ad300e0c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 28,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0091-11-03T00:00:00Z",
"gender": "F",
"staudentid": "2",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "47998493432"
}
],
"mdmaddress": [
{
"mdmstate": "SC",
"mdmzipcode": "89233004",
"mdmcountry": "Brazil",
"mdmcity": "Joinville",
"mdmaddress1": "Rua Jasmim 543",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "2",
"mdmname": "Carla Paula"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5abeb590c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"57f39965487768e3defde4238dc2a082"
]
},
"_score": 1.7320508,
"mdmLastUpdated": "2018-04-07T17:22:06.262Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "2 Carla Paula",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5abeb590c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "2"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5abfc700c3ee11e792b20242ac110003"
}
]
}
For fields inside a NESTED structure, it is required to use the type RANGE_FILTER and specify the mdmPath. Example, that will filter records where "mdmadress.numberaddress" is between 100 and 110.
JSON Request
{
"mustList": [
{
"mdmFilterType": "TYPE_FILTER",
"mdmValue": "studentGolden"
},
{
"mdmFilterType": "RANGE_FILTER",
"mdmKey": "mdmGoldenFieldAndValues.mdmaddress.numberaddress",
"mdmPath": "mdmGoldenFieldAndValues.mdmaddress",
"mdmValue": [100,110]
}
]
}
JSON Response
{
"count": 2,
"totalHits": 2,
"took": 1,
"hits": [
{
"mdmCounterForEntity": 23,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0088-01-03T00:00:00Z",
"gender": "F",
"staudentid": "1",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "47998493432"
}
],
"mdmaddress": [
{
"mdmstate": "SC",
"numberaddress": "100",
"mdmzipcode": "89233004",
"mdmcountry": "Brazil",
"mdmaddress2": "",
"mdmcity": "Joinville",
"mdmaddress1": "Rua Sao Paulo 123",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "0",
"mdmname": "Joana Silva"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5aac8d20c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"82e8d5670d0d179255fb523bb85cc0e9"
]
},
"_score": 1.7320508,
"mdmLastUpdated": "2018-04-05T00:41:03.664Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "1 Joana Silva",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:34Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5aac8d20c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "1"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ab4ca80c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 24,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0058-09-05T00:00:00Z",
"gender": "M",
"staudentid": "7",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "11976593432"
}
],
"mdmaddress": [
{
"mdmstate": "SP",
"numberaddress": "110",
"mdmzipcode": "89233004",
"mdmcountry": "Brasil",
"mdmaddress2": "",
"mdmcity": "Sao Paulo",
"mdmaddress1": "Av Blumenau",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "0",
"mdmname": "Joao Pereira"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5ad5e710c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"d01d5b92021bd878ba9f2d182ecad488"
]
},
"_score": 1.7320508,
"mdmLastUpdated": "2018-04-05T00:42:05.768Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "7 Joao Pereira",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5ad5e710c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "7"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ad6d170c3ee11e792b20242ac110003"
}
]
}
MATCH_FILTER
This filter allows you to query data that match the terms in the query. The advantage of this type of filter is that it analyzes the parameter input in the same way of the field you're searching. Using "folded" the analyze will treat input parameter (mdmValue) as insensitive and ignore diacritics.
Example, that will filter records where "name" contains "ânTonio".
JSON Request
{
"mustList": [
{
"mdmFilterType": "TYPE_FILTER",
"mdmValue": "studentGolden"
},
{
"mdmFilterType": "MATCH_FILTER",
"mdmKey": "mdmGoldenFieldAndValues.mdmname.folded",
"mdmValue": "ânTonio"
}
]
}
JSON Response
{
"count": 1,
"totalHits": 1,
"took": 1,
"hits": [
{
"mdmCounterForEntity": 20,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0083-10-14T00:00:00Z",
"gender": "M",
"staudentid": "3",
"phone": [
{
"mdmphonenumber": "91187226",
"mdmphonetype": "1"
},
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "4085075432"
}
],
"mdmaddress": [
{
"mdmstate": "CA",
"mdmzipcode": "94032",
"mdmcountry": "US",
"mdmcity": "Mountain View",
"mdmaddress1": "650 Castro Street",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "1",
"mdmname": "Antônio dos Santos"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5ac37080c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"e7434fd905c67f408f2834304e676e3e"
]
},
"_score": 7.947938,
"mdmLastUpdated": "2018-04-04T14:23:40.833Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "3 Antônio dos Santos",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5ac37080c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "3"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ac45ae0c3ee11e792b20242ac110003"
}
]
}
For fields inside a NESTED structure, it is required to use the type MATCH_FILTER and specify the mdmPath. [block:callout] { "type": "info", "body": "Terms are a definition to not only values separated by spaces. Values that contain colons, dots, dashes and slashes are also considered as separate terms. So if you use the MATCH_FILTER in a formatted phone number, it will return any phone number that matches ANY of the blocks (such as area code)." } [/block]
MATCH_ANY_TERM_FILTER
This filter allows you to query data that matches any of the terms in the query. For example, It searches any name with terms "Carla Joao". I will return any name that contains Carla or Joao.
JSON Request
{
"mustList": [
{
"mdmFilterType": "TYPE_FILTER",
"mdmValue": "studentGolden"
},
{
"mdmFilterType": "MATCH_ANY_TERM_FILTER",
"mdmKey": "mdmGoldenFieldAndValues.mdmname",
"mdmValue": "Carla Joao"
}
]
}
JSON Response
{
"count": 2,
"totalHits": 2,
"took": 1,
"hits": [
{
"mdmCounterForEntity": 18,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0091-11-03T00:00:00Z",
"gender": "F",
"staudentid": "2",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "47998493432"
}
],
"mdmaddress": [
{
"mdmstate": "SC",
"mdmzipcode": "89233004",
"mdmcountry": "Brazil",
"mdmcity": "Joinville",
"mdmaddress1": "Rua Jasmim 543",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "0",
"mdmname": "Carla Paula"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5abeb590c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"57f39965487768e3defde4238dc2a082"
]
},
"_score": 2.9923232,
"mdmLastUpdated": "2018-04-04T13:43:19.294Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "2 Carla Paula",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5abeb590c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "2"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5abfc700c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 24,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0058-09-05T00:00:00Z",
"gender": "M",
"staudentid": "7",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "11976593432"
}
],
"mdmaddress": [
{
"mdmstate": "SP",
"numberaddress": "110",
"mdmzipcode": "89233004",
"mdmcountry": "Brasil",
"mdmaddress2": "",
"mdmcity": "Sao Paulo",
"mdmaddress1": "Av Blumenau",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "0",
"mdmname": "Joao Pereira"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5ad5e710c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"d01d5b92021bd878ba9f2d182ecad488"
]
},
"_score": 2.7081637,
"mdmLastUpdated": "2018-04-05T00:42:05.768Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "7 Joao Pereira",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5ad5e710c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "7"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ad6d170c3ee11e792b20242ac110003"
}
]
}
MATCH_ALL_TERMS_FILTER
This filter allows you to query data that matches all of the terms in the query. Example, that will filter records where "name" contains both "Paula" and "Carla", but not in any specific order.
JSON Request
{
"mustList": [
{
"mdmFilterType": "TYPE_FILTER",
"mdmValue": "studentGolden"
},
{
"mdmFilterType": "MATCH_ALL_TERMS_FILTER",
"mdmKey": "mdmGoldenFieldAndValues.mdmname",
"mdmValue": "Paula Carla"
}
]
}
JSON Response
{
"count": 1,
"totalHits": 1,
"took": 1,
"hits": [
{
"mdmCounterForEntity": 18,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0091-11-03T00:00:00Z",
"gender": "F",
"staudentid": "2",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "47998493432"
}
],
"mdmaddress": [
{
"mdmstate": "SC",
"mdmzipcode": "89233004",
"mdmcountry": "Brazil",
"mdmcity": "Joinville",
"mdmaddress1": "Rua Jasmim 543",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "0",
"mdmname": "Carla Paula"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5abeb590c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"57f39965487768e3defde4238dc2a082"
]
},
"_score": 11.128401,
"mdmLastUpdated": "2018-04-04T13:43:19.294Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "2 Carla Paula",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5abeb590c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "2"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5abfc700c3ee11e792b20242ac110003"
}
]
}
For fields inside a NESTED structure, it is required to use the type MATCH_ALL_TERMS_FILTER and specify the mdmPath. Example, that will filter records where "mdmadress.mdmcity" contains "Paulo" and "Sao" terms.
JSON Request
{
"mustList": [
{
"mdmFilterType": "TYPE_FILTER",
"mdmValue": "studentGolden"
},
{
"mdmFilterType": "MATCH_ALL_TERMS_FILTER",
"mdmKey": "mdmGoldenFieldAndValues.mdmaddress.mdmcity",
"mdmPath": "mdmGoldenFieldAndValues.mdmaddress",
"mdmValue": "Paulo Sao"
}
]
}
JSON Response
{
"count": 2,
"totalHits": 2,
"took": 1,
"hits": [
{
"mdmCounterForEntity": 24,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0058-09-05T00:00:00Z",
"gender": "M",
"staudentid": "7",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "11976593432"
}
],
"mdmaddress": [
{
"mdmstate": "SP",
"numberaddress": "110",
"mdmzipcode": "89233004",
"mdmcountry": "Brasil",
"mdmaddress2": "",
"mdmcity": "Sao Paulo",
"mdmaddress1": "Av Blumenau",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "0",
"mdmname": "Joao Pereira"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5ad5e710c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"d01d5b92021bd878ba9f2d182ecad488"
]
},
"_score": 9.844454,
"mdmLastUpdated": "2018-04-05T00:42:05.768Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "7 Joao Pereira",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5ad5e710c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "7"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ad6d170c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 25,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0097-04-06T00:00:00Z",
"gender": "F",
"staudentid": "6",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "11998344432"
}
],
"mdmaddress": [
{
"mdmstate": "SP",
"mdmzipcode": "89233004",
"mdmcountry": "Brasil",
"mdmcity": "Sao Paulo",
"mdmaddress1": "Girassol 343",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "0",
"mdmname": "Juliana da Rosa Silva"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5ad1ef70c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"90f6e072dc37fdf557ddfca2b378bf8a"
]
},
"_score": 9.844454,
"mdmLastUpdated": "2018-04-05T01:00:53.527Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "6 Juliana da Rosa Silva",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5ad1ef70c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "6"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ad300e0c3ee11e792b20242ac110003"
}
]
}
MATCH_PHRASE_PREFIX_FILTER
This filter allows us to query records that have the value prefix follow the rule specified. This filter works for cases where you want to filter students with a name starting with "Edu", getting "Eduardo", "Eduarda" and son on. It works for all words on the name, for example, "Sil" will return all names that contain words starting with "Sil," including "Eduardo Silva", "Joao Silveira" and others.
{
"mustList": [
{
"mdmFilterType": "TYPE_FILTER",
"mdmValue": "studentGolden"
},
{
"mdmFilterType": "MATCH_PHRASE_PREFIX_FILTER",
"mdmKey": "mdmGoldenFieldAndValues.mdmname",
"mdmValue": "Edu"
}
]
}
WILDCARD_FILTER & WILDCARD_CUSTOM_FILTER
This filter allows us to query data that match partially. For example, it allows filtering records that "name" contains any word with "uard", such as Eduardo. It's similar to "SELECT * FROM student WHERE mdmname LIKE %uard% " on SQL.
JSON Request
{
"mustList": [
{
"mdmFilterType": "TYPE_FILTER",
"mdmValue": "studentGolden"
},
{
"mdmFilterType": "WILDCARD_FILTER",
"mdmKey": "mdmGoldenFieldAndValues.mdmname",
"mdmValue": "uard"
}
]
}
JSON Request
{
"count": 1,
"totalHits": 1,
"took": 2,
"hits": [
{
"mdmCounterForEntity": 19,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "2011-09-11T00:00:00Z",
"gender": "M",
"staudentid": "5",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "47987654357"
}
],
"mdmaddress": [
{
"mdmstate": "SC",
"mdmzipcode": "89233004",
"mdmcountry": "Brasil",
"mdmcity": "Joinville",
"mdmaddress1": "Av Santos Dumont 935",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "3",
"mdmname": "Eduardo da Silva"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5acdf7d0c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"aa7da14444f8531fa4963c370ac84adf"
]
},
"_score": 1.7320508,
"mdmLastUpdated": "2018-04-04T13:48:29.987Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "5 Eduardo da Silva",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5acdf7d0c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "5"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5acf0940c3ee11e792b20242ac110003"
}
]
}
Using WILDCARD_FILTER the default behavior is to have the wildcard in both sides (prefix and suffix). You can control it by using the WILDCARD_CUSTOM_FILTER. In this case, the wildcard will be applied where exists "". For example, using in the suffix.
JSON Request
{
"mustList": [
{
"mdmFilterType": "TYPE_FILTER",
"mdmValue": "studentGolden"
},
{
"mdmFilterType": "WILDCARD_CUSTOM_FILTER",
"mdmKey": "mdmGoldenFieldAndValues.mdmname",
"mdmValue": "*uard"
}
]
}
JSON Response
{
"count": 0,
"totalHits": 0,
"took": 1,
"hits": []
}
Now if we add '*' in the sufix.
JSON Request
{
"mustList": [
{
"mdmFilterType": "TYPE_FILTER",
"mdmValue": "studentGolden"
},
{
"mdmFilterType": "WILDCARD_CUSTOM_FILTER",
"mdmKey": "mdmGoldenFieldAndValues.mdmname",
"mdmValue": "*uard*"
}
]
}
JSON Response
{
"count": 1,
"totalHits": 1,
"took": 1,
"hits": [
{
"mdmCounterForEntity": 19,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "2011-09-11T00:00:00Z",
"gender": "M",
"staudentid": "5",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "47987654357"
}
],
"mdmaddress": [
{
"mdmstate": "SC",
"mdmzipcode": "89233004",
"mdmcountry": "Brasil",
"mdmcity": "Joinville",
"mdmaddress1": "Av Santos Dumont 935",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "3",
"mdmname": "Eduardo da Silva"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5acdf7d0c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"aa7da14444f8531fa4963c370ac84adf"
]
},
"_score": 1.7320508,
"mdmLastUpdated": "2018-04-04T13:48:29.987Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "5 Eduardo da Silva",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5acdf7d0c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "5"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5acf0940c3ee11e792b20242ac110003"
}
]
}
For fields inside a NESTED structure, it is required to use the type WILDCARD_FILTER/WILDCARD_CUSTOM_FILTER and specify the mdmPath.
EXISTS_FILTER & MISSING_FILTER
This filter allows us to query data based on existence or absence of a specific field. Missing is different than having a field with empty content. EXISTS_FILTER check if the field exists in the Data Model and if this field is mapped by some staging.
Example, that will filter customers that have a "degree" filed. This field does not exist in the student Data Model.
JSON Request
{
"mustList": [
{
"mdmFilterType": "TYPE_FILTER",
"mdmValue": "studentGolden"
},
{
"mdmFilterType": "EXISTS_FILTER",
"mdmKey": "mdmGoldenFieldAndValues.degree"
}
]
}
JSON Response
{
"count": 0,
"totalHits": 0,
"took": 1,
"hits": []
}
MISSING_FILTER check if the field does not exist in the Data Model or if this field is not mapped by some staging. Example, that will filter customers that have the "degree". This field doesn't belong in the student Data Model.
JSON Request
{
"mustList": [
{
"mdmFilterType": "TYPE_FILTER",
"mdmValue": "studentGolden"
},
{
"mdmFilterType": "MISSING_FILTER",
"mdmKey": "mdmGoldenFieldAndValues.degree"
}
]
}
It's returned all records from student because "degree" doesn't belong student data model.
JSON Response
{
"count": 7,
"totalHits": 7,
"took": 3,
"hits": [
{
"mdmCounterForEntity": 20,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0083-10-14T00:00:00Z",
"gender": "M",
"staudentid": "3",
"phone": [
{
"mdmphonenumber": "91187226",
"mdmphonetype": "1"
},
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "4085075432"
}
],
"mdmaddress": [
{
"mdmstate": "CA",
"mdmzipcode": "94032",
"mdmcountry": "US",
"mdmcity": "Mountain View",
"mdmaddress1": "650 Castro Street",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "1",
"mdmname": "Antônio dos Santos"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5ac37080c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"e7434fd905c67f408f2834304e676e3e"
]
},
"_score": 1.7320508,
"mdmLastUpdated": "2018-04-04T14:23:40.833Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "3 Antônio dos Santos",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5ac37080c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "3"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ac45ae0c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 19,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "2011-09-11T00:00:00Z",
"gender": "M",
"staudentid": "5",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "47987654357"
}
],
"mdmaddress": [
{
"mdmstate": "SC",
"mdmzipcode": "89233004",
"mdmcountry": "Brasil",
"mdmcity": "Joinville",
"mdmaddress1": "Av Santos Dumont 935",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "3",
"mdmname": "Eduardo da Silva"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5acdf7d0c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"aa7da14444f8531fa4963c370ac84adf"
]
},
"_score": 1.7320508,
"mdmLastUpdated": "2018-04-04T13:48:29.987Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "5 Eduardo da Silva",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5acdf7d0c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "5"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5acf0940c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 27,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0058-09-05T00:00:00Z",
"gender": "",
"staudentid": "7",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "11976593432"
}
],
"mdmaddress": [
{
"mdmstate": "SP",
"numberaddress": "110",
"mdmzipcode": "89233004",
"mdmcountry": "Brasil",
"mdmaddress2": "",
"mdmcity": "Sao Paulo",
"mdmaddress1": "Av Blumenau",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "0",
"mdmname": "Joao Pereira"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5ad5e710c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"d01d5b92021bd878ba9f2d182ecad488"
]
},
"_score": 1.7320508,
"mdmLastUpdated": "2018-04-05T23:24:22.537Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "7 Joao Pereira",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5ad5e710c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "7"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ad6d170c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 30,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0088-01-03T00:00:00Z",
"gender": "F",
"staudentid": "1",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "47998493432"
}
],
"mdmaddress": [
{
"mdmstate": "SC",
"numberaddress": "100",
"mdmzipcode": "89233004",
"mdmcountry": "Brazil",
"mdmaddress2": "",
"mdmcity": "Joinville",
"mdmaddress1": "Rua Sao Paulo 123",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "2",
"mdmname": "Joana Silva da Cunha"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5aac8d20c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"82e8d5670d0d179255fb523bb85cc0e9"
]
},
"_score": 1.7320508,
"mdmLastUpdated": "2018-04-07T17:22:58.053Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "1 Joana Silva da Cunha",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:34Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5aac8d20c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "1"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ab4ca80c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 29,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0097-04-06T00:00:00Z",
"gender": "F",
"staudentid": "6",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "11998344432"
}
],
"mdmaddress": [
{
"mdmstate": "SP",
"mdmzipcode": "89233004",
"mdmcountry": "Brasil",
"mdmcity": "Sao Paulo",
"mdmaddress1": "Girassol 343",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "2",
"mdmname": "Juliana da Rosa Silva"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5ad1ef70c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"90f6e072dc37fdf557ddfca2b378bf8a"
]
},
"_score": 1.7320508,
"mdmLastUpdated": "2018-04-07T17:22:35.564Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "6 Juliana da Rosa Silva",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5ad1ef70c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "6"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ad300e0c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 28,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0091-11-03T00:00:00Z",
"gender": "F",
"staudentid": "2",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "47998493432"
}
],
"mdmaddress": [
{
"mdmstate": "SC",
"mdmzipcode": "89233004",
"mdmcountry": "Brazil",
"mdmcity": "Joinville",
"mdmaddress1": "Rua Jasmim 543",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "2",
"mdmname": "Carla Paula"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5abeb590c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"57f39965487768e3defde4238dc2a082"
]
},
"_score": 1.7320508,
"mdmLastUpdated": "2018-04-07T17:22:06.262Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "2 Carla Paula",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5abeb590c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "2"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5abfc700c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 31,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0083-02-23T00:00:00Z",
"gender": "F",
"staudentid": "4",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "4085075432"
}
],
"mdmaddress": [
{
"mdmstate": "CA",
"mdmzipcode": "94032",
"mdmcountry": "US",
"mdmcity": "San Jose",
"mdmaddress1": "3421 El Camino Real",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "3",
"mdmname": "Ana dos Santos"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5ac67dc0c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"51a2247e1a8ed06579c35754af9e13a9"
]
},
"_score": 1.7320508,
"mdmLastUpdated": "2018-04-07T17:23:27.385Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "4 Ana dos Santos",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5ac67dc0c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "4"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5acaea90c3ee11e792b20242ac110003"
}
]
}
For fields inside a NESTED structure, it is required to use the type EXISTS_QUERY/MISSING_QUERY and specify the mdmPath. [block:callout] { "type": "warning", "body": "Missing is different than having a field with empty content." } [/block]
GEODISTANCE_FILTER
This filter allows you to query data based on proximity/radius of a provided coordinate. For fields inside a NESTED structure, it is required to use the type GEODISTANCE_FILTER and specify the mdmPath.
Nested example, that will filter customers that are within a radius of 5km from TOTVS Labs Headquarters.
JSON Request
{
"mustList": [
{
"mdmFilterType": "TYPE_FILTER",
"mdmValue": "studentGolden"
},
{
"mdmFilterType": "GEODISTANCE_FILTER",
"mdmPath": "mdmGoldenFieldAndValues.mdmaddress",
"mdmKey": "mdmGoldenFieldAndValues.mdmaddress.mdmcoordinates",
"mdmRangeValues": [
"37.38787",
"-122.0832254",
"5km"
]
}
]
}
JSON Response
{
"count": 0,
"totalHits": 0,
"took": 133,
"hits": []
}
3. Aggregations
It is possible to get the query results (hits) and receive aggregations/buckets using the same query. It is very powerful to build applications that allow search that also contains faceting / filtering, or also that needs to summarize statistics. The aggregations should be provided in the aggregationList parameter. The aggregation will always return a maximum of 5000 aggregated elements. The number of buckets can be set using the paramSize
param.
The aggregation structure is the following:
- type: Type of aggregation to apply.
- name: Field to apply the filter.
- params: Parameters to aggregate.
- subAggregations: Nested aggregations, containing an array with the same structure of an aggregation.
Aggregation Types
The Aggregation Type is defined in the attribute 'type' from 'aggregationList'. The TERM value is used to aggregate fields that are not nested. The NESTED value is used to aggregate fields that are nested.
This aggregation provides a new dimension, enabling the use of NESTED fields in other aggregations. If there is a need to filter the records retrieved by the query, just use FILTER.
The platform optimized the way fields NESTED
are being stored. This improvement removed the support for the query operators that start with NESTED_
. Please, update your queries to use only the version without NESTED_
. For more details refer to the documentation related to the operator you are using.
Some sample of operators the platform is no more supporting:
NESTED_TERMS_FILTER, NESTED_RANGE_FILTER, NESTED_MATCH_FILTER, NESTED_MATCH_ALL_TERMS_FILTER, NESTED_WILDCARD_FILTER, NESTED_WILDCARD_CUSTOM_FILTER, NESTED_GEODISTANCE_FILTER.
One aggregation can have several levels of aggregation under it. For this purpose, we need to use the "subAggregations" attribute. This attribute is defined in the normal aggregation and subsequently.
TERM
It creates buckets related to the number of appearances of a TERM. This can be used to get the overall count of a facet for filtering.
Example of a TERM aggregation using the gender field from a student record. It's similar to "SELECT count(*), gender FROM student GROUP BY gender" on SQL.
JSON Request
{
"mustList": [
{
"mdmFilterType": "TYPE_FILTER",
"mdmValue": "studentGolden"
}
],
"aggregationList": [
{
"type": "NESTED",
"name": "goldenValues",
"params": [
"mdmGoldenFieldAndValues"
],
"subAggregations": [
{
"type": "TERM",
"name": "gender",
"params": [
"mdmGoldenFieldAndValues.gender"
]
}
]
}
]
}
JSON Response
{
"count": 7,
"totalHits": 7,
"took": 50,
"hits": [
{
"mdmCounterForEntity": 20,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0083-10-14T00:00:00Z",
"gender": "M",
"staudentid": "3",
"phone": [
{
"mdmphonenumber": "91187226",
"mdmphonetype": "1"
},
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "4085075432"
}
],
"mdmaddress": [
{
"mdmstate": "CA",
"mdmzipcode": "94032",
"mdmcountry": "US",
"mdmcity": "Mountain View",
"mdmaddress1": "650 Castro Street",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "1",
"mdmname": "Antônio dos Santos"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5ac37080c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"e7434fd905c67f408f2834304e676e3e"
]
},
"_score": 1.4142135,
"mdmLastUpdated": "2018-04-04T14:23:40.833Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "3 Antônio dos Santos",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5ac37080c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "3"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ac45ae0c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 19,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "2011-09-11T00:00:00Z",
"gender": "M",
"staudentid": "5",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "47987654357"
}
],
"mdmaddress": [
{
"mdmstate": "SC",
"mdmzipcode": "89233004",
"mdmcountry": "Brasil",
"mdmcity": "Joinville",
"mdmaddress1": "Av Santos Dumont 935",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "3",
"mdmname": "Eduardo da Silva"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5acdf7d0c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"aa7da14444f8531fa4963c370ac84adf"
]
},
"_score": 1.4142135,
"mdmLastUpdated": "2018-04-04T13:48:29.987Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "5 Eduardo da Silva",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5acdf7d0c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "5"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5acf0940c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 27,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0058-09-05T00:00:00Z",
"gender": "",
"staudentid": "7",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "11976593432"
}
],
"mdmaddress": [
{
"mdmstate": "SP",
"numberaddress": "110",
"mdmzipcode": "89233004",
"mdmcountry": "Brasil",
"mdmaddress2": "",
"mdmcity": "Sao Paulo",
"mdmaddress1": "Av Blumenau",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "0",
"mdmname": "Joao Pereira"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5ad5e710c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"d01d5b92021bd878ba9f2d182ecad488"
]
},
"_score": 1.4142135,
"mdmLastUpdated": "2018-04-05T23:24:22.537Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "7 Joao Pereira",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5ad5e710c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "7"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ad6d170c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 30,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0088-01-03T00:00:00Z",
"gender": "F",
"staudentid": "1",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "47998493432"
}
],
"mdmaddress": [
{
"mdmstate": "SC",
"numberaddress": "100",
"mdmzipcode": "89233004",
"mdmcountry": "Brazil",
"mdmaddress2": "",
"mdmcity": "Joinville",
"mdmaddress1": "Rua Sao Paulo 123",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "2",
"mdmname": "Joana Silva da Cunha"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5aac8d20c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"82e8d5670d0d179255fb523bb85cc0e9"
]
},
"_score": 1.4142135,
"mdmLastUpdated": "2018-04-07T17:22:58.053Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "1 Joana Silva da Cunha",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:34Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5aac8d20c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "1"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ab4ca80c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 29,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0097-04-06T00:00:00Z",
"gender": "F",
"staudentid": "6",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "11998344432"
}
],
"mdmaddress": [
{
"mdmstate": "SP",
"mdmzipcode": "89233004",
"mdmcountry": "Brasil",
"mdmcity": "Sao Paulo",
"mdmaddress1": "Girassol 343",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "2",
"mdmname": "Juliana da Rosa Silva"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5ad1ef70c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"90f6e072dc37fdf557ddfca2b378bf8a"
]
},
"_score": 1.4142135,
"mdmLastUpdated": "2018-04-07T17:22:35.564Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "6 Juliana da Rosa Silva",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5ad1ef70c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "6"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ad300e0c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 28,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0091-11-03T00:00:00Z",
"gender": "F",
"staudentid": "2",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "47998493432"
}
],
"mdmaddress": [
{
"mdmstate": "SC",
"mdmzipcode": "89233004",
"mdmcountry": "Brazil",
"mdmcity": "Joinville",
"mdmaddress1": "Rua Jasmim 543",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "2",
"mdmname": "Carla Paula"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5abeb590c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"57f39965487768e3defde4238dc2a082"
]
},
"_score": 1.4142135,
"mdmLastUpdated": "2018-04-07T17:22:06.262Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "2 Carla Paula",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5abeb590c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "2"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5abfc700c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 31,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0083-02-23T00:00:00Z",
"gender": "F",
"staudentid": "4",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "4085075432"
}
],
"mdmaddress": [
{
"mdmstate": "CA",
"mdmzipcode": "94032",
"mdmcountry": "US",
"mdmcity": "San Jose",
"mdmaddress1": "3421 El Camino Real",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "3",
"mdmname": "Ana dos Santos"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5ac67dc0c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"51a2247e1a8ed06579c35754af9e13a9"
]
},
"_score": 1.4142135,
"mdmLastUpdated": "2018-04-07T17:23:27.385Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "4 Ana dos Santos",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5ac67dc0c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "4"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5acaea90c3ee11e792b20242ac110003"
}
],
"aggs": {
"goldenValues": {
"buckets": {
"": {
"docCount": 7,
"key": "",
"aggregations": {
"gender": {
"buckets": {
"f": {
"docCount": 4,
"key": "f"
},
"m": {
"docCount": 2,
"key": "m"
},
"": {
"docCount": 1,
"key": ""
}
}
}
}
}
}
}
}
}
NESTED
Example of aggregation NESTED by address (field nested) city from student using subaggregation type TERM.
JSON Request
{
"mustList": [
{
"mdmFilterType": "TYPE_FILTER",
"mdmValue": "studentGolden"
}
],
"aggregationList": [
{
"type": "NESTED",
"name": "goldenValues",
"params": [
"mdmGoldenFieldAndValues.mdmaddress"
],
"subAggregations": [
{
"type": "TERM",
"name": "city",
"params": [
"mdmGoldenFieldAndValues.mdmaddress.mdmcity"
]
}
]
}
]
}
JSON Response
{
"count": 7,
"totalHits": 7,
"took": 16,
"hits": [
{
"mdmCounterForEntity": 20,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0083-10-14T00:00:00Z",
"gender": "M",
"staudentid": "3",
"phone": [
{
"mdmphonenumber": "91187226",
"mdmphonetype": "1"
},
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "4085075432"
}
],
"mdmaddress": [
{
"mdmstate": "CA",
"mdmzipcode": "94032",
"mdmcountry": "US",
"mdmcity": "Mountain View",
"mdmaddress1": "650 Castro Street",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "1",
"mdmname": "Antônio dos Santos"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5ac37080c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"e7434fd905c67f408f2834304e676e3e"
]
},
"_score": 1.4142135,
"mdmLastUpdated": "2018-04-04T14:23:40.833Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "3 Antônio dos Santos",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5ac37080c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "3"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ac45ae0c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 19,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "2011-09-11T00:00:00Z",
"gender": "M",
"staudentid": "5",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "47987654357"
}
],
"mdmaddress": [
{
"mdmstate": "SC",
"mdmzipcode": "89233004",
"mdmcountry": "Brasil",
"mdmcity": "Joinville",
"mdmaddress1": "Av Santos Dumont 935",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "3",
"mdmname": "Eduardo da Silva"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5acdf7d0c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"aa7da14444f8531fa4963c370ac84adf"
]
},
"_score": 1.4142135,
"mdmLastUpdated": "2018-04-04T13:48:29.987Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "5 Eduardo da Silva",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5acdf7d0c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "5"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5acf0940c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 27,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0058-09-05T00:00:00Z",
"gender": "",
"staudentid": "7",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "11976593432"
}
],
"mdmaddress": [
{
"mdmstate": "SP",
"numberaddress": "110",
"mdmzipcode": "89233004",
"mdmcountry": "Brasil",
"mdmaddress2": "",
"mdmcity": "Sao Paulo",
"mdmaddress1": "Av Blumenau",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "0",
"mdmname": "Joao Pereira"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5ad5e710c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"d01d5b92021bd878ba9f2d182ecad488"
]
},
"_score": 1.4142135,
"mdmLastUpdated": "2018-04-05T23:24:22.537Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "7 Joao Pereira",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5ad5e710c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "7"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ad6d170c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 30,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0088-01-03T00:00:00Z",
"gender": "F",
"staudentid": "1",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "47998493432"
}
],
"mdmaddress": [
{
"mdmstate": "SC",
"numberaddress": "100",
"mdmzipcode": "89233004",
"mdmcountry": "Brazil",
"mdmaddress2": "",
"mdmcity": "Joinville",
"mdmaddress1": "Rua Sao Paulo 123",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "2",
"mdmname": "Joana Silva da Cunha"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5aac8d20c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"82e8d5670d0d179255fb523bb85cc0e9"
]
},
"_score": 1.4142135,
"mdmLastUpdated": "2018-04-07T17:22:58.053Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "1 Joana Silva da Cunha",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:34Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5aac8d20c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "1"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ab4ca80c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 29,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0097-04-06T00:00:00Z",
"gender": "F",
"staudentid": "6",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "11998344432"
}
],
"mdmaddress": [
{
"mdmstate": "SP",
"mdmzipcode": "89233004",
"mdmcountry": "Brasil",
"mdmcity": "Sao Paulo",
"mdmaddress1": "Girassol 343",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "2",
"mdmname": "Juliana da Rosa Silva"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5ad1ef70c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"90f6e072dc37fdf557ddfca2b378bf8a"
]
},
"_score": 1.4142135,
"mdmLastUpdated": "2018-04-07T17:22:35.564Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "6 Juliana da Rosa Silva",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5ad1ef70c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "6"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ad300e0c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 28,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0091-11-03T00:00:00Z",
"gender": "F",
"staudentid": "2",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "47998493432"
}
],
"mdmaddress": [
{
"mdmstate": "SC",
"mdmzipcode": "89233004",
"mdmcountry": "Brazil",
"mdmcity": "Joinville",
"mdmaddress1": "Rua Jasmim 543",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "2",
"mdmname": "Carla Paula"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5abeb590c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"57f39965487768e3defde4238dc2a082"
]
},
"_score": 1.4142135,
"mdmLastUpdated": "2018-04-07T17:22:06.262Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "2 Carla Paula",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5abeb590c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "2"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5abfc700c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 31,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0083-02-23T00:00:00Z",
"gender": "F",
"staudentid": "4",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "4085075432"
}
],
"mdmaddress": [
{
"mdmstate": "CA",
"mdmzipcode": "94032",
"mdmcountry": "US",
"mdmcity": "San Jose",
"mdmaddress1": "3421 El Camino Real",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "3",
"mdmname": "Ana dos Santos"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5ac67dc0c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"51a2247e1a8ed06579c35754af9e13a9"
]
},
"_score": 1.4142135,
"mdmLastUpdated": "2018-04-07T17:23:27.385Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "4 Ana dos Santos",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5ac67dc0c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "4"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5acaea90c3ee11e792b20242ac110003"
}
],
"aggs": {
"goldenValues": {
"docCount": 7,
"aggregations": {
"city": {
"buckets": {
"joinville": {
"docCount": 3,
"key": "joinville"
},
"paulo": {
"docCount": 2,
"key": "paulo"
},
"sao": {
"docCount": 2,
"key": "sao"
},
"jose": {
"docCount": 1,
"key": "jose"
},
"mountain": {
"docCount": 1,
"key": "mountain"
},
"san": {
"docCount": 1,
"key": "san"
},
"view": {
"docCount": 1,
"key": "view"
}
}
}
}
}
}
}
If you want exact matches for the terms, .raw should be used. Otherwise, you will get the count for the tokenized terms (e.g. for records with 'Sao Paulo', it will return '1 Sao' and "1 Paulo" like the example above).
Example with "raw".
JSON Request
{
"mustList": [
{
"mdmFilterType": "TYPE_FILTER",
"mdmValue": "studentGolden"
}
],
"aggregationList": [
{
"type": "NESTED",
"name": "goldenValues",
"params": [
"mdmGoldenFieldAndValues.mdmaddress"
],
"subAggregations": [
{
"type": "TERM",
"name": "city",
"params": [
"mdmGoldenFieldAndValues.mdmaddress.mdmcity.raw"
]
}
]
}
]
}
JSON Response
{
"count": 7,
"totalHits": 7,
"took": 3,
"hits": [
{
"mdmCounterForEntity": 20,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0083-10-14T00:00:00Z",
"gender": "M",
"staudentid": "3",
"phone": [
{
"mdmphonenumber": "91187226",
"mdmphonetype": "1"
},
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "4085075432"
}
],
"mdmaddress": [
{
"mdmstate": "CA",
"mdmzipcode": "94032",
"mdmcountry": "US",
"mdmcity": "Mountain View",
"mdmaddress1": "650 Castro Street",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "1",
"mdmname": "Antônio dos Santos"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5ac37080c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"e7434fd905c67f408f2834304e676e3e"
]
},
"_score": 1.4142135,
"mdmLastUpdated": "2018-04-04T14:23:40.833Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "3 Antônio dos Santos",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5ac37080c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "3"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ac45ae0c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 19,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "2011-09-11T00:00:00Z",
"gender": "M",
"staudentid": "5",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "47987654357"
}
],
"mdmaddress": [
{
"mdmstate": "SC",
"mdmzipcode": "89233004",
"mdmcountry": "Brasil",
"mdmcity": "Joinville",
"mdmaddress1": "Av Santos Dumont 935",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "3",
"mdmname": "Eduardo da Silva"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5acdf7d0c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"aa7da14444f8531fa4963c370ac84adf"
]
},
"_score": 1.4142135,
"mdmLastUpdated": "2018-04-04T13:48:29.987Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "5 Eduardo da Silva",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5acdf7d0c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "5"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5acf0940c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 27,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0058-09-05T00:00:00Z",
"gender": "",
"staudentid": "7",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "11976593432"
}
],
"mdmaddress": [
{
"mdmstate": "SP",
"numberaddress": "110",
"mdmzipcode": "89233004",
"mdmcountry": "Brasil",
"mdmaddress2": "",
"mdmcity": "Sao Paulo",
"mdmaddress1": "Av Blumenau",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "0",
"mdmname": "Joao Pereira"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5ad5e710c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"d01d5b92021bd878ba9f2d182ecad488"
]
},
"_score": 1.4142135,
"mdmLastUpdated": "2018-04-05T23:24:22.537Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "7 Joao Pereira",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5ad5e710c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "7"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ad6d170c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 30,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0088-01-03T00:00:00Z",
"gender": "F",
"staudentid": "1",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "47998493432"
}
],
"mdmaddress": [
{
"mdmstate": "SC",
"numberaddress": "100",
"mdmzipcode": "89233004",
"mdmcountry": "Brazil",
"mdmaddress2": "",
"mdmcity": "Joinville",
"mdmaddress1": "Rua Sao Paulo 123",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "2",
"mdmname": "Joana Silva da Cunha"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5aac8d20c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"82e8d5670d0d179255fb523bb85cc0e9"
]
},
"_score": 1.4142135,
"mdmLastUpdated": "2018-04-07T17:22:58.053Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "1 Joana Silva da Cunha",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:34Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5aac8d20c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "1"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ab4ca80c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 29,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0097-04-06T00:00:00Z",
"gender": "F",
"staudentid": "6",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "11998344432"
}
],
"mdmaddress": [
{
"mdmstate": "SP",
"mdmzipcode": "89233004",
"mdmcountry": "Brasil",
"mdmcity": "Sao Paulo",
"mdmaddress1": "Girassol 343",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "2",
"mdmname": "Juliana da Rosa Silva"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5ad1ef70c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"90f6e072dc37fdf557ddfca2b378bf8a"
]
},
"_score": 1.4142135,
"mdmLastUpdated": "2018-04-07T17:22:35.564Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "6 Juliana da Rosa Silva",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5ad1ef70c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "6"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ad300e0c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 28,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0091-11-03T00:00:00Z",
"gender": "F",
"staudentid": "2",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "47998493432"
}
],
"mdmaddress": [
{
"mdmstate": "SC",
"mdmzipcode": "89233004",
"mdmcountry": "Brazil",
"mdmcity": "Joinville",
"mdmaddress1": "Rua Jasmim 543",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "2",
"mdmname": "Carla Paula"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5abeb590c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"57f39965487768e3defde4238dc2a082"
]
},
"_score": 1.4142135,
"mdmLastUpdated": "2018-04-07T17:22:06.262Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "2 Carla Paula",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5abeb590c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "2"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5abfc700c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 31,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0083-02-23T00:00:00Z",
"gender": "F",
"staudentid": "4",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "4085075432"
}
],
"mdmaddress": [
{
"mdmstate": "CA",
"mdmzipcode": "94032",
"mdmcountry": "US",
"mdmcity": "San Jose",
"mdmaddress1": "3421 El Camino Real",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "3",
"mdmname": "Ana dos Santos"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5ac67dc0c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"51a2247e1a8ed06579c35754af9e13a9"
]
},
"_score": 1.4142135,
"mdmLastUpdated": "2018-04-07T17:23:27.385Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "4 Ana dos Santos",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5ac67dc0c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "4"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5acaea90c3ee11e792b20242ac110003"
}
],
"aggs": {
"goldenValues": {
"docCount": 7,
"aggregations": {
"city": {
"buckets": {
"Joinville": {
"docCount": 3,
"key": "Joinville"
},
"Sao Paulo": {
"docCount": 2,
"key": "Sao Paulo"
},
"Mountain View": {
"docCount": 1,
"key": "Mountain View"
},
"San Jose": {
"docCount": 1,
"key": "San Jose"
}
}
}
}
}
}
}
COUNT
This aggregation provides the total number of items in the level.
Example, this will get the total number of students within the aggregation.
{
"mustList": [
{
"mdmFilterType": "TYPE_FILTER",
"mdmValue": "studentGolden"
}
],
"aggregationList": [
{
"type": "NESTED",
"name": "goldenValues",
"params": [
"mdmGoldenFieldAndValues"
],
"subAggregations": [
{
"type": "COUNT",
"name": "countstudent",
"params": [
"mdmGoldenFieldAndValues.student"
]
}
]
}
]
}
JSON response
{
"count": 0,
"totalHits": 68488,
"took": 2184,
"hits": [],
"aggs": {
"countstudent": {
"value": 68486,
"valueAsString": "68486.0"
}
}
}
CARDINALITY
This aggregation provides the total number of unique values in the aggregation.
Example, this will get the total number of unique students within the aggregation.
{
"mustList": [
{
"mdmFilterType": "TYPE_FILTER",
"mdmValue": "courseGolden"
}
],
"aggregationList": [
{
"type": "NESTED",
"name": "goldenValues",
"params": [
"mdmGoldenFieldAndValues"
],
"subAggregations": [
{
"type": "CARDINALITY",
"name": "uniques",
"params": [
"mdmGoldenFieldAndValues.student"
]
}
]
}
]
}
MINIMUM
This aggregation provides the minimum value for a numeric field. Example, this will get the lowest siblingsnumber value of the student. It's similar to "SELECT MIN(siblingsnumber) FROM student" on SQL.
JSON Request
{
"mustList": [
{
"mdmFilterType": "TYPE_FILTER",
"mdmValue": "studentGolden"
}
],
"aggregationList": [
{
"type": "NESTED",
"name": "goldenValues",
"params": [
"mdmGoldenFieldAndValues"
],
"subAggregations": [
{
"type": "MINIMUM",
"name": "minimunsiblingsnumber",
"params": [
"mdmGoldenFieldAndValues.siblingsnumber"
]
}
]
}
]
}
In this request we use pageSize=0. So it will return just aggregation information ("aggs").
JSON Response
{
"count": 0,
"totalHits": 7,
"took": 77,
"hits": [],
"aggs": {
"minimunsiblingsnumber": {
"value": 0,
"valueAsString": "0.0"
}
}
}
MAXIMUM
This aggregation provides the maximum value for a numeric field. Example, this will get the greatest siblingsnumber value of the student and will return this value in the "maximumsiblingsnumber" attribute. It's similar to "SELECT MAX(siblingsnumber) FROM student" on SQL.
JSON Request
{
"mustList": [
{
"mdmFilterType": "TYPE_FILTER",
"mdmValue": "studentGolden"
}
],
"aggregationList": [
{
"type": "NESTED",
"name": "goldenValues",
"params": [
"mdmGoldenFieldAndValues"
],
"subAggregations": [
{
"type": "MAXIMUM",
"name": "maximumsiblingsnumber",
"params": [
"mdmGoldenFieldAndValues.siblingsnumber"
]
}
]
}
]
}
In this request we use pageSize=0. So it will return just aggregation information ("aggs"). JSON Response
{
"count": 0,
"totalHits": 7,
"took": 1,
"hits": [],
"aggs": {
"maximumsiblingsnumber": {
"value": 3,
"valueAsString": "3.0"
}
}
}
STATS
This aggregation provides statistics (such as maximum, minimum, average) on numeric fields, in order to get simple statistics and boundaries from a field.
Example, this will get the statistics of the "siblingsnumber".
JSON Request
{
"mustList": [
{
"mdmFilterType": "TYPE_FILTER",
"mdmValue": "studentGolden"
}
],
"aggregationList": [
{
"type": "NESTED",
"name": "goldenValues",
"params": [
"mdmGoldenFieldAndValues"
],
"subAggregations": [
{
"type": "STATS",
"name": "statsiblingsnumber",
"params": [
"mdmGoldenFieldAndValues.siblingsnumber"
]
}
]
}
]
}
In this request we use pageSize=0. So it will return just aggregation information ("aggs").
JSON Response
{
"count": 0,
"totalHits": 7,
"took": 16,
"hits": [],
"aggs": {
"statsiblingsnumber": {
"count": 7,
"min": 0,
"max": 3,
"sum": 13,
"avg": 1.8571428571428572
}
}
}
EXTENDED_STATS
This aggregation provides extended statistics (such as maximum, minimum, average, variance, standard deviation) on numeric fields, in order to get complete statistics and variances from a field.
JSON Request
{
"mustList": [
{
"mdmFilterType": "TYPE_FILTER",
"mdmValue": "studentGolden"
}
],
"aggregationList": [
{
"type": "NESTED",
"name": "goldenValues",
"params": [
"mdmGoldenFieldAndValues"
],
"subAggregations": [
{
"type": "EXTENDED_STATS",
"name": "extendedsatsiblingsnumber",
"params": [
"mdmGoldenFieldAndValues.siblingsnumber"
]
}
]
}
]
}
In this request we use pageSize=0. So it will return just aggregation information ("aggs").
JSON Response
{
"count": 0,
"totalHits": 7,
"took": 5,
"hits": [],
"aggs": {
"extendedsatsiblingsnumber": {
"sumOfSquares": 31,
"variance": 0.979591836734694,
"stdDeviation": 0.989743318610787,
"count": 7,
"min": 0,
"max": 3,
"sum": 13,
"avg": 1.8571428571428572
}
}
}
For fields inside a NESTED structure, it is required to wrap the aggregation inside a NESTED aggregation.
DATE_HISTOGRAM
This aggregation provides grouping by time unit. For example, get statistics (minimum, maximum, average) of absence per week (1w). Available expressions for interval: year (1y), quarter (1q), month (1M), week (1w), day (1d), hour (1h), minute (1m), second (1s)
JSON Request
{
"mustList": [
{
"mdmFilterType": "TYPE_FILTER",
"mdmValue": "matriculaGolden"
}
],
"aggregationList": [
{
"type": "DATE_HISTOGRAM",
"name": "weekly",
"params": [
"mdmGoldenFieldAndValues.mdmstartdate",
"1w",
"yyyy-MM-dd"
],
"subAggregations": [
{
"type": "EXTENDED_STATS",
"name": "statsAbsence",
"params": [
"mdmGoldenFieldAndValues.absence"
]
}
]
}
]
}
In this request we use pageSize=0. So it will return just aggregation information ("aggs").
JSON Response
{
"count": 0,
"totalHits": 10,
"took": 9,
"hits": [],
"aggs": {
"weekly": {
"buckets": {
"1969-12-29": {
"docCount": 10,
"key": "1969-12-29",
"aggregations": {
"statsAbsence": {
"sumOfSquares": 39,
"variance": 0.7654320987654317,
"stdDeviation": 0.8748897637790899,
"count": 9,
"min": 1,
"max": 3,
"sum": 17,
"avg": 1.8888888888888888
}
}
}
}
}
}
}
HISTOGRAM
This aggregation provides the histogram considering a field/value. For example, the query below will return the histogram of siblingsnumber for each interval of 2 siblings number value (params = 2).
JSON Request
{
"mustList": [
{
"mdmFilterType": "TYPE_FILTER",
"mdmValue": "studentGolden"
}
],
"aggregationList": [
{
"type": "HISTOGRAM",
"name": "siblingsnumber",
"params": [
"mdmGoldenFieldAndValues.siblingsnumber",
"2"
]
}
]
}
In this request we use pageSize=0. So it will return just aggregation information ("aggs"). This return informs that there are 2 records (docCount) with siblingsnumber equals 0 or 1 (buckets "0"). The same way this response informs that there are 5 records (docCount) with siblingsnumber equals 2 or 3 (buckets "2").
JSON Response
{
"count": 0,
"totalHits": 7,
"took": 1,
"hits": [],
"aggs": {
"siblingsnumber": {
"buckets": {
"0": {
"docCount": 2,
"key": "0"
},
"2": {
"docCount": 5,
"key": "2"
}
}
}
}
}
JOIN
If it needs to get information from two entities in the same query, "mdmValuesQuery" attribute can be used to do a Join. For example, get all registers from "matricula" data model where its course id is "ADMM" and the student's gender is female.
JSON Request
{
"mustList": [
{
"mdmFilterType": "TYPE_FILTER",
"mdmValue": "matriculaGolden"
},
{
"mdmFilterType": "TERM_FILTER",
"mdmKey": "mdmGoldenFieldAndValues.courseid.raw",
"mdmValue": "ADMM"
},
{
"mdmFilterType": "TERMS_FILTER",
"mdmKey": "mdmGoldenFieldAndValues.staudentid.raw",
"mdmValuesField": "mdmGoldenFieldAndValues.staudentid",
"mdmValuesQuery": {
"mustList": [
{
"mdmFilterType": "TYPE_FILTER",
"mdmValue": "studentGolden"
},
{
"mdmFilterType": "TERM_FILTER",
"mdmKey": "mdmGoldenFieldAndValues.gender.raw",
"mdmValue": "F"
}
]
}
}
]
}
JSON Response
{
"count": 2,
"totalHits": 2,
"took": 2,
"hits": [
{
"mdmCounterForEntity": 17,
"mdmGoldenFieldAndValues": {
"mdmstartdate": "1970-01-01T00:16:52Z",
"staudentid": "1",
"mdmstatus": "1",
"absence": "1",
"mdmenddate": "1970-01-01T00:16:52Z",
"courseid": "ADMM"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "matriculaGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"d8ac66b0c47e11e7b5e60242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"95e597a394248be112ffa3c7a3d29f0e"
]
},
"_score": 4.115316,
"mdmLastUpdated": "2018-04-08T14:33:37.827Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "ADMM 1 1",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-08T12:17:53Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_studentcourse": [
"d8ac66b0c47e11e7b5e60242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"studentcourse": {
"code": "7"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "f3fd7d20c3e611e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "d8ad7820c47e11e7b5e60242ac110003"
},
{
"mdmCounterForEntity": 21,
"mdmGoldenFieldAndValues": {
"mdmstartdate": "1970-01-01T00:16:52Z",
"staudentid": "2",
"mdmstatus": "1",
"absence": "3",
"mdmenddate": "1970-01-01T00:16:52Z",
"courseid": "ADMM"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "matriculaGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"d8b34480c47e11e7b5e60242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"26d179859d58f75f9ef231b518a78063"
]
},
"_score": 4.0506115,
"mdmLastUpdated": "2018-04-08T14:34:27.390Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "ADMM 2 1",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-08T12:17:53Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_studentcourse": [
"d8b34480c47e11e7b5e60242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"studentcourse": {
"code": "8"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "f3fd7d20c3e611e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "d8b47d00c47e11e7b5e60242ac110003"
}
]
}
GeoHash Grid
This aggregation allows grouping close geo points to show in map regions with more records or occurrences.
The query is very simple, and to query using this operator you need to have an address field (that has behind the scenes a geopoint field), or you need to have a geopoint field.
The geopoint field stores the latitude and longitude information, the coordinates on the global map.
Let's see the query and how it works:
{
"aggregationList": [
{
"type": "GEOHASH_GRID",
"name": "grid",
"params": [
"mdmGoldenFieldAndValues.coordinates", 5
]
}
]
}
For this query, we expect the result to be similar to the following Json:
{
"count": 0,
"totalHits": 3087,
"took": 120,
"hits": [],
"aggs": {
"grid": {
"buckets": {
"6gm62": {
"docCount": 1356,
"key": "6gm62"
},
"dnrgj": {
"docCount": 184,
"key": "dnrgj"
},
"srq54": {
"docCount": 108,
"key": "srq54"
},
"dq25d": {
"docCount": 106,
"key": "dq25d"
},
"evfx4": {
"docCount": 29,
"key": "evfx4"
},
"djn0w": {
"docCount": 28,
"key": "djn0w"
}
}
}
}
}
To understand the Geohash field, please, ever to this link: http://geohash.gofreerange.com/
In a few words, the hashes returned refers to specific locations on the map, as the following image:
4. Other Examples
This aggregation provides data filtering to be used in conjunction of sub aggregations. Example, this will aggregate the sum of absence by student for 1970 year and 2018 year. In this case it is used FILTER aggregation type to filter register from 1970 and 2018 separately. The 1970 aggregation result will be returned in attribute "Seventy" even as the 2018 aggregation result will be returned in attribute "Eighteen".
This example use attribute "aggregationKeyResolver" in "subAggregations". This attribute "aggregationKeyResolver" is to get some field from other data model related to the current data model.
Example, get all customer golden records.
{
"mustList": [
{
"mdmFilterType": "TYPE_FILTER",
"mdmValue": "matriculaGolden"
}
],
"aggregationList": [
{
"type": "FILTER",
"name": "Seventy",
"queryParam": {
"mustList": [
{
"mdmFilterType": "RANGE_FILTER",
"mdmKey": "mdmGoldenFieldAndValues.mdmstartdate",
"mdmRangeValues": [
"1970-01-01",
"1970-12-31"
]
}
]
},
"subAggregations": [
{
"type": "TERM",
"name": "students",
"params": [
"mdmGoldenFieldAndValues.staudentid.raw"
],
"aggregationKeyResolver": {
"targetType": "studentGolden",
"targetField": "mdmGoldenFieldAndValues.staudentid.raw",
"targetFieldsToResolve": [
"mdmGoldenFieldAndValues.staudentid","mdmGoldenFieldAndValues.mdmname"
]
},
"subAggregations": [
{
"type": "SUM",
"name": "absenceSum",
"params": [
"mdmGoldenFieldAndValues.absence"
]
}
]
}
]
},
{
"type": "FILTER",
"name": "Eighteen",
"queryParam": {
"mustList": [
{
"mdmFilterType": "RANGE_FILTER",
"mdmKey": "mdmGoldenFieldAndValues.mdmstartdate",
"mdmRangeValues": [
"2018-01-01",
"2018-12-31"
]
}
]
},
"subAggregations": [
{
"type": "TERM",
"name": "students",
"params": [
"mdmGoldenFieldAndValues.staudentid.raw"
],
"aggregationKeyResolver": {
"targetType": "studentGolden",
"targetField": "mdmGoldenFieldAndValues.staudentid.raw",
"targetFieldsToResolve": [
"mdmGoldenFieldAndValues.staudentid","mdmGoldenFieldAndValues.mdmname"
]
},
"subAggregations": [
{
"type": "SUM",
"name": "absenceSum",
"params": [
"mdmGoldenFieldAndValues.absence"
]
}
]
}
]
}
]
}
JSON Response
{
"count": 0,
"totalHits": 10,
"took": 1,
"hits": [],
"aggs": {
"Eighteen": {
"docCount": 0,
"aggregations": {
"students": {
"buckets": {}
}
}
},
"Seventy": {
"docCount": 10,
"aggregations": {
"students": {
"buckets": {
"1": {
"docCount": 1,
"key": "1",
"aggregations": {
"absenceSum": {
"value": 1,
"valueAsString": "1.0"
}
},
"resolved": [
{
"mdmGoldenFieldAndValues.staudentid": "1",
"mdmGoldenFieldAndValues.mdmname": "Joana Silva da Cunha"
}
]
},
"2": {
"docCount": 2,
"key": "2",
"aggregations": {
"absenceSum": {
"value": 5,
"valueAsString": "5.0"
}
},
"resolved": [
{
"mdmGoldenFieldAndValues.staudentid": "2",
"mdmGoldenFieldAndValues.mdmname": "Carla Paula"
}
]
},
"3": {
"docCount": 3,
"key": "3",
"aggregations": {
"absenceSum": {
"value": 4,
"valueAsString": "4.0"
}
},
"resolved": [
{
"mdmGoldenFieldAndValues.staudentid": "3",
"mdmGoldenFieldAndValues.mdmname": "Antônio dos Santos"
}
]
},
"4": {
"docCount": 2,
"key": "4",
"aggregations": {
"absenceSum": {
"value": 5,
"valueAsString": "5.0"
}
},
"resolved": [
{
"mdmGoldenFieldAndValues.staudentid": "4",
"mdmGoldenFieldAndValues.mdmname": "Ana dos Santos"
}
]
},
"5": {
"docCount": 1,
"key": "5",
"aggregations": {
"absenceSum": {
"value": 1,
"valueAsString": "1.0"
}
},
"resolved": [
{
"mdmGoldenFieldAndValues.staudentid": "5",
"mdmGoldenFieldAndValues.mdmname": "Eduardo da Silva"
}
]
},
"6": {
"docCount": 1,
"key": "6",
"aggregations": {
"absenceSum": {
"value": 1,
"valueAsString": "1.0"
}
},
"resolved": [
{
"mdmGoldenFieldAndValues.staudentid": "6",
"mdmGoldenFieldAndValues.mdmname": "Juliana da Rosa Silva"
}
]
}
}
}
}
}
}
}
5. Named Queries
In order to reuse queries, we strongly encourage users to use Named Queries. The idea of it is to create queries and save the template in the server, and just make usage of the queries, having it centralized. You can use the same query in different places without having to duplicate code, and also you have the flexibility to change the query on the server without distributing it again.
The endpoints to be used to manage named queries are under.
/api/v2/named_queries",
"language": "text"
Payload (JSON)
- mdmQueryName: The name of the query, this is used to execute queries.
- mdmType: The data type (table) that the query runs.
- mdmFilterQuery: The query itself, explained above in this document.
- mdmReturnFields: Specifies the fields that will be returned by this named query. When executing the Named Query, the request can override this attribute defining different fields.
The format of a named query is as follows:
{
"mdmType": "studentGolden",
"mdmQueryName": "listStudents",
"mdmQueryDescription": "",
"mdmQueryFields": {},
"mdmFilterQuery": {
"mustList": [
{
"mdmFilterType": "TYPE_FILTER",
"mdmValue": "studentGolden"
},
{
"mdmFilterType": "TERM_FILTER",
"mdmKey": "mdmGoldenFieldAndValues.mdmname.raw",
"mdmValue": "{{name}}"
}
],
"minimumShouldMatch": 1,
"resolveRelationships": false,
"excludeMergePending": false,
"mdmReturnFields": ["mdmGoldenFieldAndValues"]
}
}
JSON Response
{
"mdmType": "studentGolden",
"mdmQueryName": "listStudents",
"mdmQueryDescription": "",
"mdmQueryFields": {},
"mdmFilterQuery": {
"mustList": [
{
"mdmFilterType": "TYPE_FILTER",
"mdmValue": "studentGolden"
},
{
"mdmFilterType": "TERM_FILTER",
"mdmKey": "mdmGoldenFieldAndValues.mdmname.raw",
"mdmValue": "{{nome}}"
}
],
"minimumShouldMatch": 1,
"resolveRelationships": false,
"excludeMergePending": false
},
"mdmCacheTimeInSeconds": 30,
"mdmCacheRevalidationTimeInSeconds": 15,
"mdmReturnFields": ["mdmGoldenFieldAndValues"],
"mdmTimeoutInSeconds": 55,
"mdmTags": [],
"mdmId": "a4ae68b044ab11e88e1f0242bafa62d0",
"mdmEntityType": "mdmNamedQuery",
"mdmCreated": "2018-04-20T15:01:02Z",
"mdmLastUpdated": "2018-04-20T15:01:02Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003"
}
[block:callout] { "type": "info", "title": "", "body": "Strings marked as {{name}} are replaced by parameters when the named queries are executed. If you want to specify a mandatory parameter, you need to flag as {{*name}}. Not mandatory queries that were not specified will be ignored at runtime." } [/block]
To execute a named query, the endpoint is POST /api/v2/queries/named/{queryName}:
The parameters are described below:
Pagination (Query Parameters)
- query_name: Query name (mdmQueryName).
- offset: The record position to start to get results from.
- pageSize: Number of records to get (limited to 1000).
- sortBy: Field to sort the information (Ex: mdmGoldenFieldAndValues.name , sortBy name).
- sortOrder: In case sortBy is used, the order to consider (Values : ASC or DESC).
- indexType: Index to query data from (STAGING/MASTER).
- fields: Fields returned in the response.
- tags: Filter by tag from Data Mode
- body: Json Request
In the example below, it executes the "listStudents" named query without parameters. In that case all students records will be retrieved.
query_name = listStudents
JSON Request
{}
JSON Response
{
"count": 7,
"totalHits": 7,
"took": 2,
"hits": [
{
"mdmCounterForEntity": 20,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0083-10-14T00:00:00Z",
"gender": "M",
"staudentid": "3",
"phone": [
{
"mdmphonenumber": "91187226",
"mdmphonetype": "1"
},
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "4085075432"
}
],
"mdmaddress": [
{
"mdmstate": "CA",
"mdmzipcode": "94032",
"mdmcountry": "US",
"mdmcity": "Mountain View",
"mdmaddress1": "650 Castro Street",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "1",
"mdmname": "Antônio dos Santos"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5ac37080c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"e7434fd905c67f408f2834304e676e3e"
]
},
"_score": 1.7320508,
"mdmLastUpdated": "2018-04-04T14:23:40.833Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "3 Antônio dos Santos",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5ac37080c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "3"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ac45ae0c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 19,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "2011-09-11T00:00:00Z",
"gender": "M",
"staudentid": "5",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "47987654357"
}
],
"mdmaddress": [
{
"mdmstate": "SC",
"mdmzipcode": "89233004",
"mdmcountry": "Brasil",
"mdmcity": "Joinville",
"mdmaddress1": "Av Santos Dumont 935",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "3",
"mdmname": "Eduardo da Silva"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5acdf7d0c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"aa7da14444f8531fa4963c370ac84adf"
]
},
"_score": 1.7320508,
"mdmLastUpdated": "2018-04-04T13:48:29.987Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "5 Eduardo da Silva",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5acdf7d0c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "5"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5acf0940c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 27,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0058-09-05T00:00:00Z",
"gender": "",
"staudentid": "7",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "11976593432"
}
],
"mdmaddress": [
{
"mdmstate": "SP",
"numberaddress": "110",
"mdmzipcode": "89233004",
"mdmcountry": "Brasil",
"mdmaddress2": "",
"mdmcity": "Sao Paulo",
"mdmaddress1": "Av Blumenau",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "0",
"mdmname": "Joao Pereira"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5ad5e710c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"d01d5b92021bd878ba9f2d182ecad488"
]
},
"_score": 1.7320508,
"mdmLastUpdated": "2018-04-05T23:24:22.537Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "7 Joao Pereira",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5ad5e710c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "7"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ad6d170c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 30,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0088-01-03T00:00:00Z",
"gender": "F",
"staudentid": "1",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "47998493432"
}
],
"mdmaddress": [
{
"mdmstate": "SC",
"numberaddress": "100",
"mdmzipcode": "89233004",
"mdmcountry": "Brazil",
"mdmaddress2": "",
"mdmcity": "Joinville",
"mdmaddress1": "Rua Sao Paulo 123",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "2",
"mdmname": "Joana Silva da Cunha"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5aac8d20c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"82e8d5670d0d179255fb523bb85cc0e9"
]
},
"_score": 1.7320508,
"mdmLastUpdated": "2018-04-07T17:22:58.053Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "1 Joana Silva da Cunha",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:34Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5aac8d20c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "1"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ab4ca80c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 29,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0097-04-06T00:00:00Z",
"gender": "F",
"staudentid": "6",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "11998344432"
}
],
"mdmaddress": [
{
"mdmstate": "SP",
"mdmzipcode": "89233004",
"mdmcountry": "Brasil",
"mdmcity": "Sao Paulo",
"mdmaddress1": "Girassol 343",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "2",
"mdmname": "Juliana da Rosa Silva"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5ad1ef70c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"90f6e072dc37fdf557ddfca2b378bf8a"
]
},
"_score": 1.7320508,
"mdmLastUpdated": "2018-04-07T17:22:35.564Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "6 Juliana da Rosa Silva",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5ad1ef70c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "6"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ad300e0c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 28,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0091-11-03T00:00:00Z",
"gender": "F",
"staudentid": "2",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "47998493432"
}
],
"mdmaddress": [
{
"mdmstate": "SC",
"mdmzipcode": "89233004",
"mdmcountry": "Brazil",
"mdmcity": "Joinville",
"mdmaddress1": "Rua Jasmim 543",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "2",
"mdmname": "Carla Paula"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5abeb590c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"57f39965487768e3defde4238dc2a082"
]
},
"_score": 1.7320508,
"mdmLastUpdated": "2018-04-07T17:22:06.262Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "2 Carla Paula",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5abeb590c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "2"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5abfc700c3ee11e792b20242ac110003"
},
{
"mdmCounterForEntity": 31,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0083-02-23T00:00:00Z",
"gender": "F",
"staudentid": "4",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "4085075432"
}
],
"mdmaddress": [
{
"mdmstate": "CA",
"mdmzipcode": "94032",
"mdmcountry": "US",
"mdmcity": "San Jose",
"mdmaddress1": "3421 El Camino Real",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "3",
"mdmname": "Ana dos Santos"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5ac67dc0c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"51a2247e1a8ed06579c35754af9e13a9"
]
},
"_score": 1.7320508,
"mdmLastUpdated": "2018-04-07T17:23:27.385Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "4 Ana dos Santos",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5ac67dc0c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "4"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5acaea90c3ee11e792b20242ac110003"
}
],
"aggs": {}
}
The next example, "listStudents" will receive "Joao Pereira" as a parameter. In this case, it will return just the student record related with "Joao Pereira".
query_name = listStudents
JSON Request
{"name":"Joao Pereira"}
JSON Response
{
"count": 1,
"totalHits": 1,
"took": 1,
"hits": [
{
"mdmCounterForEntity": 27,
"mdmGoldenFieldAndValues": {
"mdmbirthday": "0058-09-05T00:00:00Z",
"gender": "",
"staudentid": "7",
"phone": [
{
"mdmphonenumber": "Residencial",
"mdmphonetype": "11976593432"
}
],
"mdmaddress": [
{
"mdmstate": "SP",
"numberaddress": "110",
"mdmzipcode": "89233004",
"mdmcountry": "Brasil",
"mdmaddress2": "",
"mdmcity": "Sao Paulo",
"mdmaddress1": "Av Blumenau",
"mdmaddresstype": "Residencial"
}
],
"siblingsnumber": "0",
"mdmname": "Joao Pereira"
},
"mdmPotentialMergePending": false,
"mdmEntityType": "studentGolden",
"mdmApplicationIdMasterRecordId": {
"bab945f0c3e911e792b20242ac110003": [
"5ad5e710c3ee11e792b20242ac110003"
],
"0a0829172fc2433c9aa26460c31b78f0": [
"d01d5b92021bd878ba9f2d182ecad488"
]
},
"_score": 8.354703,
"mdmLastUpdated": "2018-04-05T23:24:22.537Z",
"mdmTenantId": "b9184120c3de11e7afee0242ac110003",
"mdmMasterCount": 2,
"mdmProfileTitle": "7 Joao Pereira",
"mdmFlaggedFieldIds": [],
"mdmApplicationIdMasterRecord": {},
"mdmCreated": "2017-11-07T19:03:35Z",
"mdmApplicationIdStagingTypeMasterRecordId": {
"bab945f0c3e911e792b20242ac110003_student": [
"5ad5e710c3ee11e792b20242ac110003"
]
},
"mdmCrosswalk": [
{
"mdmApplicationId": "bab945f0c3e911e792b20242ac110003",
"mdmConnectorId": "",
"mdmCrossreference": {
"student": {
"code": "7"
}
}
}
],
"mdmErrors": [],
"mdmEntityTemplateId": "57e61090c3e211e792b20242ac110003",
"mdmPreviousIds": [],
"mdmId": "5ad6d170c3ee11e792b20242ac110003"
}
],
"aggs": {}
}