Hello everyone,
We're using elasticsearch as our search backend. On search result pages, I'd like to show a snippet of text for each result with the search term highlighted, so users can see the context their search term was found in. Is there a configuration option in wagtail to do this? If not, how difficult of a project would it be for us to implement this?
Thanks very much for any help or advice you can provide.
John
{% if search_results %}
<script type="text/javascript">
$('div.search-results').highlight('{{ request.GET.q }}'.split(" "));
</script>
<style type="text/css">
.highlight {
background-color: #FAFF7E;
}
</style>
{% endif %}