Problem/Motivation

When using an excerpt as a field, that excerpt is not generated in the live results

Proposed resolution

I have tried to debug this, but can't figure it out. it looks like the component is not visible in that place.

Remaining tasks

Comments

borisson_ created an issue. See original summary.

rogeriocc’s picture

I tried to make it work in all the ways I could and I couldn't, either.

You are not retrieving data from the "Search result excerpt" field.

- Enable the "Search result excerpt" field in the "Search result highlighting input" display for my content type.
- I configured the "CONFIGURE SUGGESTER DISPLAY LIVE RESULTS" for the view mode "Search result highlighting input"

Searching does not return the result in Auto complete.

Would anyone have an idea of where to start to try to solve this bug?

Sorry for my English.

Hugs

drunken monkey’s picture

Component: General code » Plugins
Status: Active » Needs review
Related issues: +#3164255: Make the new excerpt field also work for the Views “Rendered item” field
StatusFileSize
new812 bytes

Thanks for reporting this problem!
The issue is that, unfortunately, the way the excerpt field is currently implemented requires each caller of $datasource->viewItem() to manually set $build['#search_api_excerpt'] on the returned array in order for this to work.
Also see #3164255: Make the new excerpt field also work for the Views “Rendered item” field (discovered through this issue).

The attached patch should fix this, please test/review!

borisson_’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for helping out here @drunken monkey, it would've taken a very long time for me to figure this out. This works on the project I need this for.

This does not have test coverage, but I'm not sure how strict we are with test coverage in this project, will put on RTBC on the assumption that we don't need tests.

  • drunken monkey committed faec790 on 8.x-1.x
    Issue #3132027 by drunken monkey, borisson_: Fixed excerpt field not...
drunken monkey’s picture

Status: Reviewed & tested by the community » Fixed

No worries,
Thanks for reviewing! I think this is a bit too specific to cover with tests, and you’re right, I’m a bit laxer with those in this project.
So: committed.

Status: Fixed » Closed (fixed)

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