Package DE_EPAGES::RemoteSearch::API::RemoteSearchImpl
High level API used by scripts from the RemoteSearch cartridge
Base |
Exporter |
@EXPORT_OK |
Functions
- DropAllSearchIndexes
- GetOrCreateSearchIndex
- GetUserAgent
- IsRemoteSearchActive
- RunIfRemoteSearchInitialized
DropAllSearchIndexes
Resets search info on shop and tries to delete the index from the remote search, if needed.
Syntax |
DropAllSearchIndexes( $Shop ); |
Input |
|
GetOrCreateSearchIndex
Creates (if necessary) and returns SearchIndex object. Does not set the remote call to index the shop. Use DE_EPAGES::RemoteSearch::API::Object::IndexManager for that.
Syntax |
my $SearchIndex = GetOrCreateSearchIndex( $Shop ); |
Input |
|
Return |
|
GetUserAgent
Configure and return an LWP::UserAgent instance. Reads epages.conf sections to configure this object. Used configuration: [DE_EPAGES::RemoteSearch] HTTPTimeOut = 10; default timeout is 10 sec
Syntax |
my $UserAgent = GetUserAgent(); |
Return |
|
IsRemoteSearchActive
Check if remote search can be used for the shop
Syntax |
my $IsUseable = IsRemoteSearchActive( $Shop ); |
Input |
|
Return |
|
RunIfRemoteSearchInitialized
Runs code if remote search is active and RemoteSearchIndex object has been created. Passes RemoteProductSearchIndex object into the sub. Non-fatal Errors get turned into Warnings.
Syntax |
RunIfRemoteSearchInitialized( $Shop, $cSub ); |
Example |
RunIfRemoteSearchActive($Shop, sub { my ($Search) = @_; $Search->updateItems([ $Product ]); }); |
Input |
|