DeduplicationListener
in package
Solr merged record handling listener.
Tags
Table of Contents
- $backend : Backend
- Backend.
- $dataSourceConfig : string
- Data source configuration file identifier.
- $enabled : bool
- Whether deduplication is enabled.
- $searchConfig : string
- Search configuration file identifier.
- $serviceLocator : ContainerInterface
- Service container.
- __construct() : void
- Constructor.
- attach() : void
- Attach listener to shared event manager.
- hasChildFilter() : bool
- Check search parameters for child records filter
- onSearchPost() : EventInterface
- Fetch appropriate dedup child
- onSearchPre() : EventInterface
- Set up filter for excluding merge children.
- appendDedupRecordFields() : array<string|int, mixed>
- Append fields from dedup record to the selected local record. Note: the last two parameters are unused in this default method, but they may be useful for custom behavior in subclasses.
- determineBuildingPriority() : array<string|int, mixed>
- Function that determines the priority for buildings
- determineSourcePriority() : array<string|int, mixed>
- Function that determines the priority for sources
- fetchLocalRecords() : void
- Fetch local records for all the found dedup records
- getActiveRecordSources() : array<string|int, mixed>
- Get currently active record sources.
Properties
$backend
Backend.
protected
Backend
$backend
$dataSourceConfig
Data source configuration file identifier.
protected
string
$dataSourceConfig
$enabled
Whether deduplication is enabled.
protected
bool
$enabled
$searchConfig
Search configuration file identifier.
protected
string
$searchConfig
$serviceLocator
Service container.
protected
ContainerInterface
$serviceLocator
Methods
__construct()
Constructor.
public
__construct(Backend $backend, ContainerInterface $serviceLocator, string $searchConfig[, string $dataSourceConfig = 'datasources' ][, bool $enabled = true ]) : void
Parameters
- $backend : Backend
-
Search backend
- $serviceLocator : ContainerInterface
-
Service locator
- $searchConfig : string
-
Search config file id
- $dataSourceConfig : string = 'datasources'
-
Data source file id
- $enabled : bool = true
-
Whether deduplication is enabled
Return values
void —attach()
Attach listener to shared event manager.
public
attach(SharedEventManagerInterface $manager) : void
Parameters
- $manager : SharedEventManagerInterface
-
Shared event manager
Return values
void —hasChildFilter()
Check search parameters for child records filter
public
hasChildFilter(ParamBag $params) : bool
Parameters
- $params : ParamBag
-
Search parameters
Return values
bool —onSearchPost()
Fetch appropriate dedup child
public
onSearchPost(EventInterface $event) : EventInterface
Parameters
- $event : EventInterface
-
Event
Return values
EventInterface —onSearchPre()
Set up filter for excluding merge children.
public
onSearchPre(EventInterface $event) : EventInterface
Parameters
- $event : EventInterface
-
Event
Return values
EventInterface —appendDedupRecordFields()
Append fields from dedup record to the selected local record. Note: the last two parameters are unused in this default method, but they may be useful for custom behavior in subclasses.
protected
appendDedupRecordFields(array<string|int, mixed> $localRecordData, array<string|int, mixed> $dedupRecordData, array<string|int, mixed> $recordSources, array<string|int, mixed> $sourcePriority) : array<string|int, mixed>
Parameters
- $localRecordData : array<string|int, mixed>
-
Local record data
- $dedupRecordData : array<string|int, mixed>
-
Dedup record data
- $recordSources : array<string|int, mixed>
-
List of active record sources, empty if all
- $sourcePriority : array<string|int, mixed>
-
Array of source priorities keyed by source id
Tags
Return values
array<string|int, mixed> —Local record data
determineBuildingPriority()
Function that determines the priority for buildings
protected
determineBuildingPriority(ParamBag $params) : array<string|int, mixed>
Parameters
- $params : ParamBag
-
Query parameters
Return values
array<string|int, mixed> —Array keyed by building with priority as the value
determineSourcePriority()
Function that determines the priority for sources
protected
determineSourcePriority(array<string|int, mixed> $recordSources) : array<string|int, mixed>
Parameters
- $recordSources : array<string|int, mixed>
-
Record sources defined in searches.ini
Return values
array<string|int, mixed> —Array keyed by source with priority as the value
fetchLocalRecords()
Fetch local records for all the found dedup records
protected
fetchLocalRecords(EventInterface $event) : void
Parameters
- $event : EventInterface
-
Event
Return values
void —getActiveRecordSources()
Get currently active record sources.
protected
getActiveRecordSources(EventInterface $event) : array<string|int, mixed>
Parameters
- $event : EventInterface
-
Event