Mappers

Mappers are classes which define how Search Service data is mapped from the application database tables to the staging database tables. Each Search Service has its own Mapper - the Mapper to use is specified in the SearchService database table. For more details see mapperName.

This Mapper functionality is used in two processes:

  1. When the Database Extractor is run, each Search Service Field is iterated over for a particular Search Service. For each Field, the corresponding Entity Attribute data is retrieved from the application database and populated into the SearchServiceRow staging database table
  2. When a create, update or remove operation is called for an entity that is used in a Search Service, the relevant SearchServiceRow rows are updated with the related entity modifications

In both of these processes, the relevant Mapper for each Search Service is invoked to map data from the application database tables to the staging database tables.

On initialization of the Generic Search Server, the staging database information is read and used to construct the Indices from the Search Service metadata. The Search Server will periodically check the staging database for updates and keep the service data up to date.

The following Mapper API methods require implementation by search developers on a per-Search Service Basis:

SearchServiceRowDtlsList mapToStagingDb(
  final SearchServiceKey id) throws AppException, 
    InformationalException;
    
List getObjectList(final SearchServiceKey serviceId, 
  final Object obj) throws AppException, InformationalException;
  
String getExtKey(final SearchServiceKey serviceId, List objList);

void remove(final SearchServiceKey serviceId, final Object objKey) 
    throws AppException, InformationalException;    
    
Object getFieldValue(final SearchServiceKey serviceId, 
    final List objList, final SearchServiceFieldDtls field);

For more details see Implement Mapper Operations