Show more results in JS search results
@@ -55,13 +55,19 @@ function attach_elastic_search_query(data) {
// Show highlighted texts
if (highlight.content) {
- var content_text = xss(highlight.content[0]);
+ for (index in highlight.content) {
+ if (index > 2) {
+ continue
+ }
+ var content = highlight.content[index];
+ var content_text = xss(content);
var contents = $('<div class="context">');
contents.html(content_text);
contents.find('em').addClass('highlighted');
list_item.append(contents);
}
+ }
Search.output.append(list_item);
list_item.slideDown(5);
