Understanding the Master Index Match Engine

Step 1: Create the Custom Comparator Java Class

The first step to creating custom comparators is defining the matching logic in custom comparator Java classes that are stored in the real-time module of the Master Index Match Engine. Follow these guidelines when creating the class:

Once you create the Java classes, continue to Step 2: Register the Comparator in the Comparators List.

initialize

Description

The initialize method initializes the values for the parameters, data sources, and dependency class used for each custom comparator. It provides the necessary information to access the comparator's configuration in the match configuration file and the comparators list file.

Syntax

void initialize(Map<String, Map> params, Map<String, Map> dataSources, Map<String, Map> dependClassList)

Parameters

Parameter 

Type 

Description 

params 

Map 

A mapping of all the parameters associated with a match field in matchConfigFile.cfg.

dataSources 

Map 

A mapping of all the data sources associated with a match field in matchConfigFile.cfg.

dependClassList 

Map 

A mapping of all the dependency classes associated with a match field in matchConfigFile.cfg.

Return Value

None.

Throws

None.

compareFields

Description

The compareFields method contains all the comparison logic needed to compare two field values and calculate a matching weight that shows how similar the values are.

Syntax

double compareFields(String recordA, String recordB, Map context)

Parameters

Parameter 

Type 

Description 

recordA 

String 

A field value from the record against which the reference record is being compared. 

recordB 

String 

A field value from the reference record. 

context 

Map 

A set of arguments passed to the comparator. 

Return Value

A number between zero and one that indicates how closely two field values match.

Throws

MatchComparatorException

setRTParameters

Description

The setRTParameters method sets the runtime parameters for the comparator, providing the ability to customize every call to the parameter.

Syntax

void setRTParameters(String key, String value)

Parameters

Parameter 

Type 

Description 

key 

string 

The key to map the parameter value. 

value 

string 

The value of the parameter. 

Return Value

None.

Throws

None.

stop

Description

The stop method closes any related connections to the data sources used by the comparator.

Syntax

void stop()

Parameters

None.

Return Value

None.

Throws

None.