Closed (fixed)
Project:
Search API Autocomplete
Version:
8.x-1.x-dev
Component:
Plugins
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Apr 2020 at 09:02 UTC
Updated:
12 Sep 2020 at 18:59 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
rogeriocc commentedI 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
Comment #3
drunken monkeyThanks 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!
Comment #4
borisson_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.
Comment #6
drunken monkeyNo 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.