SearchApiResult Apex Class

Coveo for Salesforce 3.38 (August 2019)

Represents a Coveo Search Result.

The following fields constitute a Coveo SearchAPI result:

key param

The key to look for in the raw field result.

Object myProperty = mySearchApiResponse.results[0].getRawProperty('bar');

If you want to have a typed field value, use the below 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.