ePages 6.17.12 - DE_EPAGES/RemoteSearch/API/Object/IndexManager.pm

Package DE_EPAGES::RemoteSearch::API::Object::IndexManager

Package used to control shop index creation and remote search settings. Catches errors and saves them as warnings. Use DE_EPAGES::Core::API::Warning::BlockWarnings to handle warnings.

Example
my $ManagerParams = DE_EPAGES::RemoteSearch::API::Object::IndexManagerParams->new(
  create => 1
);
my $Manager = DE_EPAGES::RemoteSearch::API::Object::IndexManager->new(params => $ManagerParams);
my $aWarnings = BlockWarnings(sub {
  $Manager->manageShopsByAlias(['DemoShop']);
});

Functions

manageCompleteDB
manageShopsByAlias
manageShopsByGUID
manageShopsByIndexStatus
manageSystem
new

manageCompleteDB

Works on all shops within the /Shops folder

Syntax
$Manager->manageCompleteDB();

manageShopsByAlias

Manages a list of given shops by their alias. In order to manage all shops at once, please refer to manageCompleteDB.

Syntax
$Manager->manageShopsByAlias( $aAliases );
Example
$Manager->manageShopsByAlias([ 'Shop1', 'Shop2' ] );
Input
$aAliases (ref.array.string)
Alias list

manageShopsByGUID

works on shops by guid

Syntax
$Manager->manageShopsByGUID( $aGUIDs );
Example
$Manager->manageShopsByGUID( [ 'GUID1', 'GUID2' ] );
Input
$aGUIDs (ref.array.string)
GUID list

manageShopsByIndexStatus

Works on shops based on the current index status See DE_EPAGES::RemoteSearch::API::IndexStatus

Syntax
$manager->manageShopsByIndexStatus( INDEXSTATUS_ERROR );
Input
$IndexStatus (string)
Index status

manageSystem

Sets system parameters.

Syntax
$Manager->manageSystem();

new

Execute various index management tasks. Tasks modify remote search related attributes on Shop/RootObject and/or communicate with remote search service host.

Syntax
my $IndexManager = DE_EPAGES::RemoteSearch::API::Object::IndexManager->new(params => $Params);
Input
%params (hash)
Initial values. Used keys:
  • params - index manager params - DE_EPAGES::RemoteSearch::API::Object::IndexManagerParams
Return
$IndexManager (DE_EPAGES::RemoteSearch::API::Object::IndexManager
tasksToCheck and indexesToFlush are queues for DE_EPAGES::RemoteSearch::API::DTO::Task objects
"traits" says this attribute is a *list* and "isa" declares list elements as references of generic Items
With "handles" custom aliases for standard list operations are defined e.g.
handles => {
countItemsInList => 'count',
addItemToList => 'push',
getItemWithIndex => 'get',
}
This is syntactic sugar to improve clearity of the code.
See http://search.cpan.org/dist/Moose/lib/Moose/Meta/Attribute/Native/Trait/Array.pm)
new instance