The entity mapper step takes a value from a source entity and maps a synonym value into a target entity. This step is useful if you want to normalise numerous values into a singe common value/term for users, which in turn can simplify filters.
To use this step make sure you create the target entity and choose the right data type (keyword if you want to use it as a filter).
To configure this step, edit the config/endpoints/entity_mapper.json file:
In the example below:
test – this is the entity group.
keywords – this is the entity.
target – this is the name of the entity to write synonym values to (needs to be in the same group – in this case test).
path – this points to the mappings for the entity (in this case a file in the data subfolder).
You can have more than one configuration – just copy the ‘test’ object and edit it.
An example mapping file would be:
Here we are mapping ‘very light rail’ and ‘vlr’ to ‘Very Light Rail / VLR’
Note that the mappings are case sensitive.
A typical configuration (use) would be to use the Trie entity extractor to pull out your entities (the Trie incidentally lower cases values), then use this to normalise the values into a single set of master/common terms. You would then use this in your filter configuration and not the original entity – thus giving your users a simple set of filters without duplicates (i.e. ‘very light rail’ and ‘vlr’ are the same thing).
The endpoint for this enrichment step is ‘entity_mapper’