ScopeJS.SearchMetadata
Metadata passed with search requests. Two forms of construction are allowed depending on the number and types of the parameters:
- with locale and form factor or
- with cardinality, locale, and form factor.
- Methods
Array of String aggregated_keywords
(
)
Get the list of scope keywords used to initiate this search request.
Returns: <Array of String>
The list of scope keywords used to initiate this search request.
Intcardinality
(
)
Get cardinality.
Returns: <Int> Boolean
contains_hint
( key
)
Check if this SearchMetadata has a hint.
Parameters:-
key
<String>The hint name.
Returns: <Boolean>
True if the hint is set.
form_factor
(
)
Get the form factor string.
Returns:
The form factor string
Stringget
( key
)
Get the value of an attribute
Parameters:-
key
<String>
Returns: <String>
, {Number} or {Object}
Booleanhas_location
(
)
Does the SearchMetadata have a location.
Returns: <Boolean>
True if there is a location property.
Dictionaryhints
(
)
Get all hints.
Returns: <Dictionary> ConnectivityStatus
internet_connectivity
(
)
Get internet connectivity status.
Returns: <ConnectivityStatus>
The internet connectivity status.
Booleanis_aggregated
(
)
Check if this search request originated from an aggregator scope.
Returns: <Boolean>
True if this search request originated from an aggregator scope.
locale
(
)
Get the locale string.
Returns:
The locale string
Locationlocation
(
)
Get location.
Returns: <Location>
data representing the current location, including attributes such as city and country.
remove_location
(
)
Remove location data entirely. This method does nothing if no location data is present.
set
( key, value
)
Set the value of an attribute
Parameters:-
key
<String> -
value
<String>, {Number} or {Object}
set_aggregated_keywords
( aggregated_keywords
)
Set the list of scope keywords used to initiate this search request.
Parameters:-
aggregated_keywords
<Array of String>The list of scope keywords used to initiate this search request.
set_cardinality
( cardinality
)
Set cardinality.
Parameters:-
cardinality
<Int>
set_hint
( key, value
)
Sets a hint.
Parameters:-
key
<String>The name of the hint.
-
value
<Object>Hint value
set_internet_connectivity
( The
)
Set internet connectivity status.
Parameters:-
The
<ConnectivityStatus>internet connectivity status.
set_location
( location
)
Set location.
Parameters:-
location
<Location>data