$item->setExtraData('highlighted_fields', $item_fields);

$item_fields has to be an array keyed by the Search API field id / machine name and and array of highlighted HTML as value.

CommentFileSizeAuthor
#4 2912667.patch18.7 KBmkalkbrenner

Comments

mkalkbrenner created an issue. See original summary.

mkalkbrenner’s picture

mkalkbrenner’s picture

Due to these changes it's now possible to leverage the Search API HighlightingProcessor.
I think it would be the best solution to always use it as it now accepts pre-highlighted snippets form the backed :-)

Since this processor takes care about creating an excerpt as well we should remove the hackish excerpt code form the Solr backend whch solves some bugs as well.

mkalkbrenner’s picture

Status: Active » Needs review
StatusFileSize
new18.7 KB

  • mkalkbrenner committed 51977d6 on 8.x-2.x
    Issue #2912667 by mkalkbrenner: Adopt to proposed changes in Search API...
mkalkbrenner’s picture

Status: Needs review » Reviewed & tested by the community

The patch works but #2945560: Backend highlighted fields get overwritten or are ignored. needs to be solved to see the highlighted results.

mkalkbrenner’s picture

Status: Reviewed & tested by the community » Fixed
mkalkbrenner’s picture

Version: 8.x-1.x-dev » 8.x-2.x-dev

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.