ePages 6.14.0 - DE_EPAGES/RemoteSearch/API/Object/RemoteIndexClient.pm

Package DE_EPAGES::RemoteSearch::API::Object::RemoteIndexClient

Webservice client for remote search index management operations. Operations are usually appended by a replication token, used as a latch for the remote server, to wait until the synchronization token appears in the database. That way we can make sure all changes have been written to database, even if the remote server is using a replicated slave database.

Base
DE_EPAGES::RemoteSearch::API::Object::WebserviceClient
Example
# Regular usage:
my $Client = $SearchIndex->remoteIndex();
$Client->deleteItems($aItems, IncrementAndGetReplicationToken());

Functions

createOrReplaceIndex
deleteItems
dropIndex
getTask
insertOrUpdateItems

createOrReplaceIndex

Creates a remote search index via HTTP POST. If it already exists, the previous index will be replaced with the new one.

Throws error 'REQUEST FAILED' if remote service is not reachable or did not anwser in given the given timelimit. See DE_EPAGES::RemoteSearch::API::Object::HTTPClient

Syntax
$Client->createOrReplaceIndex( $ReplicationTokenID );
Input
$ReplicationTokenID (int)
database token used for master-slave synchronization
Return
$Task (DE_EPAGES::RemoteSearch::API::DTO::Task)
remote task

deleteItems

Removes items from remote search index via HTTP POST

Throws error 'REQUEST FAILED' if remote service is not reachable or did not anwser in given the given timelimit. See DE_EPAGES::RemoteSearch::API::Object::HTTPClient

Syntax
$Client->deleteItems( $aItems, $ReplicationTokenID );
Input
$aItems (ref.array.int)
list of item IDs
$ReplicationTokenID (int)
database token used for master-slave synchronization
Return
$Task (DE_EPAGES::RemoteSearch::API::DTO::Task)
remote task

dropIndex

Removes a remote search index using HTTP DELETE.

Throws error 'REQUEST_FAILED' if remote service is not reachable or did not anwser in given the given timelimit. See DE_EPAGES::RemoteSearch::API::Object::HTTPClient

Syntax
$Client->dropIndex( $ReplicationTokenID );
Input
$ReplicationTokenID (int)
database token used for master-slave synchronization
Return
$Task (DE_EPAGES::RemoteSearch::API::DTO::Task)
remote task

getTask

Retrieves a remote task via HTTP GET

Throws error 'REQUEST_FAILED' if remote service is not reachable or did not anwser in given the given timelimit. See DE_EPAGES::RemoteSearch::API::Object::HTTPClient

Syntax
my $Task = $Client->getTask( $TaskURL );
Input
$TaskURL (string)
task url
Return
$Task (DE_EPAGES::RemoteSearch::API::DTO::Task)
task object

insertOrUpdateItems

Updates or inserts items to the remote search index via HTTP POST

Throws error 'REQUEST FAILED' if remote service is not reachable or did not anwser in given the given timelimit. See DE_EPAGES::RemoteSearch::API::Object::HTTPClient

Syntax
$Client->insertOrUpdateItems( $aItems, $ReplicationTokenID );
Input
$aItems (ref.array.int)
list of item IDs
$ReplicationTokenID (int)
database token used for master-slave synchronization
Return
$Task (DE_EPAGES::RemoteSearch::API::DTO::Task)
remote task