Include highlights/excerpt data in results

Created on 24 August 2020, over 4 years ago
Updated 14 December 2023, about 1 year ago

Hello,

I was trying to make the search highlight (enabled in the Processors tab) work with JSON API. I did many searches in the Drupal community, also in this module page to find a patch/solution for this, but I didn't found.

So, I started to debug the module code to try to find a solution for this, and I found in the code the cause of this.

In line 108 of the indexResource.php it retrieves all the Result Items, that comes with the extra_data and data excerpt (if enabled in the Highlight Processor). But in the next line, it uses an array_map to get the original object from the retrieved Result Items. In this step, the extra_data and the excerpts are excluded, because they don't are part of the original entity. So, when the response is rendered, it comes without extra_data and data_excerpts.

✨ Feature request
Status

Needs work

Version

1.0

Component

Code

Created by

πŸ‡§πŸ‡·Brazil fkatsukawa SΓ£o Paulo, πŸ‡§πŸ‡·

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024