Closed (fixed)
Project:
Search API Best Bets
Version:
3.0.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
22 May 2025 at 14:47 UTC
Updated:
2 May 2026 at 21:30 UTC
Jump to comment: Most recent
Comments
Comment #2
smustgrave commentedTo my knowledge there is not but can see it being a useful feature!
Comment #3
jwilson3Maybe there is heuristic approach, whereby the boost on the matched term field is so ridiculously high, you can safely group the bosted results as different from normal results from a numerical calculation. I wanted to see if there was an easy/known approach here. I haven't yet dug into the internals of how best bet works yet, but I presume architecturally it is similar to how other standard boosts work (maybe not though too).
Comment #4
bedlamI was looking at this this morning. The module page mentions that it applies a class to results when using Search API Pages, and shows how to get the 'elevated' status form inside the set of results (i.e. for each item).
I needed a class on the view row, and handled it like this (in a .theme file):
The
mytheme_views_pre_render()implementation tags the row as elevated. After that, pretty much anything is possible. For our purposes, we only needed to render a class on that basis, but it should be possible to do other things like render the elevated item using a different view mode etc.Comment #5
smustgrave commentedSorry to disappear but I see we have the hook that does
Is that what you were looking for @jwilson3?
Comment #6
smustgrave commentedMaybe we can do something for views
Comment #9
smustgrave commentedTook inspiration from #4 with small tweaks. Pushed to both 4.0.x and 3.0.x