How do I get extracts in search results? Say someone searches for "John Smith". Using the search results template on the Craft website, my search results are then a list of titles for entries that include the term "John Smith". For example:


Dave Taylor wins award
New building built


The user experience is quite poor as there is no indication that these articles are in any way related to "John Smith". What I'm trying to do is output the following:


Dave Taylor wins award


...with the help of his brother John Smith,...


New building built


...architect John Smith was instrumental...

i.e. something similar to Google search. Any ideas how I could go about this?
I think creating your own Twig filter is your best bet. 
So, create a filter that takes a string, searches that for another string and returns an extract. It could do this by using some regular expression hocus pocus, I guess.

{{ entry.bodyText | extract('your search term', 3, 3) }}


would be how you'd use it (assuming, for example, that your filter accepts the three arguments searchTerm, wordsBefore and wordsAfter).