5

Is it possible to get the highlight field from a SOSL search within apex?

For example:

List<List<Contact>> results = [
  FIND {text} IN ALL FIELDS RETURNING Contact(Id, Name) WITH HIGHLIGHT
];

Is there a way to get the highlight field containing the <mark>text</mark> tags? For example:

contact.get('highlight.Name');

Or is this only available when executing SOSL using the API?

1 Answer 1

2

Unfortunately, it is available only in SOAP api and REST api as mentioned in the official documentation here in Supported APIs section:

The WITH HIGHLIGHT clause in SOSL is supported in SOAP API and REST API.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .