I've tried searching but can't find anything to answer my question. We've got a customised version of PKB2 on a force.com site and I'm trying to update it so we can take advantage of keyword highlighting for searches. I've enabled
Highlight relevant article text within search results
in the knowledge settings and it's working as expected in the knowledge app.
I've tested the query my code is producing in the query browser on the dev console and it's working as I would expect, but don't know how to get access to/display the results using apex/visual force.
Example SOSL query of:
FIND {some search words} IN ALL FIELDS RETURNING Faq__kav(KnowledgeArticleId, Title, Summary, UrlName WHERE PublishStatus ='online' AND Language = 'en_US' LIMIT 5) WITH SNIPPET(target_length=300)
apex piece:
List<List<SObject>> searchList = Search.query(searchQuery);
system.debug(searchList);
Searchlist has a size of 1. This shows me the arrary of FAQ_kav records and thier data but no reference to snippet.text or snippet.whole.title like I get in the query Editor.
Any ideas?