10up / ElasticPress

A fast and flexible search and query engine for WordPress.
https://elasticpress.io
GNU General Public License v2.0
1.24k stars 312 forks source link

Feature: Autosuggest styles #2088

Open tott opened 3 years ago

tott commented 3 years ago

With the ElasticPress autosuggest feature turned on, ElasticPress allows for search suggestion on most of the default WordPress search fields out of the box, however the look and feel of these results is only adjustable through filters and code alterations and cannot be easily altered through the interface.

Ideally we should be providing a UI that would allow for:

kyleruscigno commented 3 years ago

Would you be able to point me in the direction of what filters I'll need to hook into to modify the look of the autosuggest results. I'm looking to do something similar and having trouble identifying what I need to do.

heresdaniel commented 3 years ago

Same here, looking to add thumbnails in autosuggest.

shmaltz commented 3 years ago

Looks like the only way to currently do this is by directly modifying the autosuggest.js file, and adding in the meta fields you want to display.

Also, to get images to display in the auto suggest results, we would need to add the post's featured image url to a meta field, as currently only the image ID is saved to the post. This meta field can be created/updated using the save post hook.

Would be awesome if this was something natively integrated! Add to Milestone 3.6.0?

shmaltz commented 2 years ago

Can we get featured images in autosuggest for 4.0?

felipeelia commented 1 year ago

FWIW, this page of our docs outlines the process of changing that via code: https://10up.github.io/ElasticPress/tutorial-theme-integration.html