ePages 7.48.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::EPagesJ::API::Object::RestClient
Example
# Regular usage:
my $Client = $SearchIndex->remoteIndex();
$Client->deleteItems($aItems, IncrementAndGetReplicationToken());

Functions

createCategory
deleteItems
dropIndex
getTask
indexItems
indexShop
indexShops
initializeNoSolr

createCategory

A resource that inserts a newly created category

Syntax
$EndpointRequest->createCategory($Category);
Input
$Category (object)
Category Object
Return
$Response (object)
epagesj endpoint url

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 the given time limit. 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

indexItems

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->indexItems( $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

indexShop

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->indexShop( $ReplicationTokenID );
Input
$ReplicationTokenID (int)
database token used for master-slave synchronization
Return
$Task (DE_EPAGES::RemoteSearch::API::DTO::Task)
remote task

indexShops

Updates or inserts multiple shops into remote serach index via HTTP POST. Throws error 'REQUEST FAILED' if remote service is not reachable or did not anwser in the given time limit. See DE_EPAGES::RemoteSearch::API::Object::HTTPClient

Syntax
$Client->indexShops( $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

initializeNoSolr

updates a document in the shop collection only. It does not touch the index.

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->initializeNoSolr( $Shop );
Input
$Shop (DE_EPAGES::Shop::API::Object::Shop)
shop to update
Return
$Task (DE_EPAGES::RemoteSearch::API::DTO::Task)
remote task