How to highlight search results with elasticui?

638 Views Asked by At

I made a simple interface to display application logs using elasticui, I'd like to highlight the results to show what was matching

I tried to add this in my controller:

$scope.$watch('ejs', function(ejs) {
    if (ejs !== undefined) {
        ejs.Highlight(['msg']);
    };
});

but it does not work (the request payload don't include the highlight part)

how should I proceed?

2

There are 2 best solutions below

0
On BEST ANSWER

ElasticUI now supports highlighting

2
On

Highlighting has not been added to ElasticUI yet, but it should be fairly trivial to add. If you look at IndexController you see it sets the agg, filter, query, and sort properties of ejs.Request. What you want is also add support for the highlight property in a similar way to how ElasticUI handles the other ones.

I've also opened an issue for this. It would be great if you could try and contribute it - otherwise I expect to look at it later on.