pressbooks / ideas

Ideas for Pressbooks.
GNU General Public License v3.0
12 stars 4 forks source link

Provide a preview of a sentence containing a search term in search results #136

Open NMSalmon opened 6 years ago

NMSalmon commented 6 years ago

Feature Description

The Pressbooks search results for words or phrases in a text currently display a chapter title and the first sentence in that text. It could be even more helpful for searchers if, instead of seeing a snippet from the first sentence of the chapter, the search result snippet featured an instance or even multiple instances of the phrase in question.

Google Books search results operate in this way:

book search results in google

Feature Use Case

Textbook authors and readers often use the search bar to find sections they remember as relevant to their work or study:

Other Notes

This was a feature first requested by a developmental editor we are working with who is part of the Division of Continuing Studies at UW-Madison.

greatislander commented 6 years ago

@NMSalmon This is a great idea. We currently use WordPress' built-in search functionality and the excerpt display is fairly limited. Here's one approach that might be worth investigating: https://yoast.com/wordpress-search/

NMSalmon commented 6 years ago

This is very cool! Thank you!

greatislander commented 6 years ago

(For what it's worth any solution would require changes to both pressbooks/pressbooks and pressbooks/pressbooks-book.)