ePages 7.28.0 - DE_EPAGES/RemoteSearch/API/Object/ProductBatchProcessHandler.pm

Package DE_EPAGES::RemoteSearch::API::Object::ProductBatchProcessHandler

Handles batch-updates of products to pass them to the remote search. Implements Interface DE_EPAGES::Trigger::API::Object::BatchProcessHandler
Uses DE_EPAGES::RemoteSearch::API::Object::SearchIndex

Base
DE_EPAGES::Trigger::API::Object::BatchProcessHandler

Functions

addItem
new
processItemList
productBatchSize
reindexThreshold

addItem

Wrapper for DE_EPAGES::Trigger::API::Object::BatchProcessHandler::addItem Item (Product) is only added if $Item->id is not found in $Handler->items

Syntax
$Handler->addItem( $NewItem );
Input
$NewProduct (DE_EPAGES::RemoteSearch::API::DTO::UpdateItem)
Request for processing a product.

new

Pass optional parameter 'BatchSize' to define the number of items queued before processItemList() is called automatically. Call processItemList() manualy before discarding the Handler to ensure that all items are processed.

see DE_EPAGES::Trigger::API::Object::BatchProcessHandler for inherited methods

Syntax
my $Handler = DE_EPAGES::RemoteSearch::API::Object::ProductBatchProcessHandler->new( {BatchSize => 50} );
my $Handler = DE_EPAGES::RemoteSearch::API::Object::ProductBatchProcessHandler->new();
Input
$hOptions (ref.hash)
  • BatchSize - this limit trigger automated processing while adding Products(optional) - integer > 1
  • SearchIndex - Custom SearchIndex object for testing/debugging - DE_EPAGES::RemoteSearch::API::Object::SearchIndex
Return
$Object (DE_EPAGES::RemoteSearch::API::Object::ProductBatchProcessHandler)
new batch process handler

processItemList

Stored products are passed to SearchIndex object and flushed. On first call of this method the search initialized with parameters from first Object in item list.

see DE_EPAGES::RemoteSearch::API::Object::SearchIndex.

Syntax
$Handler->processItemList();

productBatchSize

The amount of items in one chunk

Syntax
$ProductBatchSize = $Handler->productBatchSize();
Return
$ProductBatchSize (integer)
number of items in one chunk

reindexThreshold

Returns the treshold when the reindex should be used. Instead of single product update.

Syntax
$ReindexThreshold = $Handler->ReindexThreshold();
Return
$ReindexThreshold (integer)
treshold of reindex