Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search: add $results array to the EVENT_AFTER_SEARCH event object #7237

Closed
Anubarak opened this issue Dec 8, 2020 · 3 comments
Closed

Search: add $results array to the EVENT_AFTER_SEARCH event object #7237

Anubarak opened this issue Dec 8, 2020 · 3 comments
Labels
enhancement improvements to existing features extensibility 🔌 features related to plugin/module dev

Comments

@Anubarak
Copy link
Contributor

Anubarak commented Dec 8, 2020

Description

I would like to access/know what field matched via Craft search attribute in order to display that content of that field and highlight the term. Currently my only "known" method to do so without having to rewrite much is to extend your search, copy all private functions and return the $result parameter or extend the Event by myself.

All I actually need is to gain access to the $results array would you please include that?
I could create a pull request but I guess it's less effort for you to just include the line two times and add the property to the event.

brandonkelly added a commit that referenced this issue Dec 9, 2020
@brandonkelly brandonkelly added enhancement improvements to existing features extensibility 🔌 features related to plugin/module dev and removed enhancement labels Dec 9, 2020
@brandonkelly
Copy link
Member

Easy enough – just added SearchEvent::$results for Craft 3.6.

@brandonkelly
Copy link
Member

Craft 3.6 RC2 is out now with that new event property.

@brandonkelly
Copy link
Member

Craft 3.6 has now been officially released ✨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement improvements to existing features extensibility 🔌 features related to plugin/module dev
Projects
None yet
Development

No branches or pull requests

2 participants