SearchApiResult Apex class
SearchApiResult Apex class
Represents a Coveo Search API result.
|
Note
You should also consult the: |
The following fields constitute a Coveo SearchAPI
result:
-
title
(string): The item title. -
uri
(string): The item URI. -
printableUri
(string): The human-readable item URI. -
clickUri
(string): The hyperlinkable item URI. -
uniqueId
(string): The unique item identifier. -
excerpt
(string): The contextual excerpt generated for the item. -
hasHtmlVersion
(Boolean): Whether the index contains an HTML version of the item. -
score
(integer): The total ranking score computed for the item. -
isTopResult
(Boolean: Whether the item was included in the results because it’s a top result in the index configuration. -
isRecommendation
(Boolean): Whether the item score was boosted as a Coveo ML recommendation. -
rankingModifier
(string): If applicable, represents the type of ranking modification that was applied to this result. -
map<String, Object> raw
: The raw response.
key param
The key to look for in the raw field result.
Object myProperty = mySearchApiResponse.results[0].getRawProperty('bar');
|
Note
To have a typed field value, use the following methods to get your property in the expected type. |
getRawProperty (String fieldName)
Attempts to return an untyped property from the result’s raw field.
Returns null
if the key doesn’t exist.
getRawPropertyAsDateTime
Attempts to return a DateTime
property from a result’s raw field.
Returns null
if the key doesn’t exist.
getRawPropertyAsString
Attempts to return a String
property from the result’s raw field.
Returns an empty string if the key doesn’t exist.
getRawPropertyAsBoolean
Attempts to return a Boolean
property from the result’s raw field.
Returns false
if the key doesn’t exist.
getRawPropertyAsInteger
Attempts to return an Integer
property from the result’s raw field.
Returns 0
if the key doesn’t exist.
getRawPropertyAsDouble
Attempts to return a Double
property from the result’s raw field.
Returns 0.0
if the key doesn’t exist.