Package DE_EPAGES::RemoteSearch::API::RemoteSearchImpl
High level API used by scripts from the RemoteSearch cartridge
Base |
Exporter |
@EXPORT_OK |
Functions
- DropAllSearchIndexes
- GUIDforObjectID
- GetOrCreateSearchIndex
- GetUserAgent
- IsRemoteSearchActive
- MarkShopDirty
- RunIfRemoteSearchInitialized
- SearchProducts
- SearchProductsFallback
- UpdateSearchStatistics
DropAllSearchIndexes
Resets search info on shop and tries to delete the index from the remote search, if needed.
Syntax |
DropAllSearchIndexes( $Shop ); DropAllSearchIndexes( $Shop, $DropRemote ); |
Input |
|
GUIDforObjectID
Get corrosponding GUIDs for list of objectIDs
Syntax |
my $aGUIDs = GUIDforObjectID( $aIDList ); |
Input |
|
Return |
|
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 |
|
MarkShopDirty
Mark (existing) search index of $Shop as dirty.
Syntax |
MarkShopDirty( $Shop ); |
Input |
|
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 |
|
SearchProducts
Execute product search in $Shop. See DE_EPAGES::RemoteSearch::API::Object::SearchParamBuilder for configuration options.
Syntax |
SearchProducts( $Shop, $ParamBuilder ); |
Input |
|
Return |
|
SearchProductsFallback
This method is deprecated and may be removed in near future!
Construct an PagerSearchMulti, which can execute a product search with SQL.
Use of this method should limited to fallback solution if SearchProducts
is failing. Keep in mind the SQL fallback execute strict *PATTERN* search, which
will lead to heavy load on database and may take long time to yield a result.
Syntax |
$Pager = SearchProductsFallback( $Shop, $ParamBuilder ); |
Input |
|
Return |
|
UpdateSearchStatistics
Registers the user's search query at our search statistics.
Search services automatically provides a fallback if a multi-term query
yields to no results, by throwing out the last term of the query and
repeating the search.
If the fallback kicks in, $Result contains the fallback query used.
Syntax |
UpdateSearchStatistics( $Servlet, $Response ); |
Input |
|