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

Add highlighting to search results #31

Conversation

philipnewcomer
Copy link
Contributor

This PR adds highlighting to the post title and excerpt in search results when using Algolia via the backend.

Highlighting is enabled by default, but can be disabled using the algolia_search_highlighting_enabled filter. The bundled styles for the highlights themselves are enabled by default, but can also be disabled using the algolia_search_highlighting_enable_bundled_styles filter if the developer wants to provide their own styles.

The bundled styles' appearance matches that currently provided by Instantsearch.js (light yellow background color):
Screen Shot 2019-11-22 at 7 30 37 AM

There are currently no options page settings for disabling highlighting or the bundled styles, as I expect the defaults will be useful for most users, and advanced users can use the filters provided by the plugin to change the highlight settings and/or tags.

@richaber richaber added the enhancement New feature or request label Nov 29, 2019
@richaber richaber requested a review from gregrickaby November 29, 2019 14:49
Copy link
Contributor

@gregrickaby gregrickaby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, @philipnewcomer! Thank you!

@richaber richaber self-requested a review December 6, 2019 22:05
@richaber richaber self-assigned this Dec 6, 2019
Copy link
Contributor

@richaber richaber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.

@richaber richaber merged commit 312c8a2 into WebDevStudios:master Dec 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants