Package DE_EPAGES::RemoteSearch::API::Object::SuggestClient
Client for suggestions
Base |
DE_EPAGES::RemoteSearch::API::Object::WebserviceClient |
Functions
suggest
Calls suggestion service via HTTP GET and returns HTTP::Response.
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 $Response = $Client->suggest( $query, $lang ); |
Example |
my $Index = $Shop->get('RemoteProductSearchIndex'); my $Suggest = $Index->remoteSuggest(); my $Response; eval { $Response = $Suggest->suggest('tent', 'en'); }; LogWarnings ('HTTP Request failed: ' . GetError() ) if ErrorExists(); if ($Response){ # handle response } |
Input |
|
Return |
|
suggestAsHash
Wrapper for $Client->suggest, returns http content decoded as hash
Syntax |
my $hSuggestions = $Client->suggestAsHash( $query, $lang ); |
Input |
|
Return |
|
suggestUrl
Builds the url used by suggestion webservice
Syntax |
my $URL = $Client->suggestUrl( $query, $lang ); |
Input |
|
Return |
|