Highlight hits on search result


#1

Enonic version: 6.7.3
OS: Ubuntu 14.04.5 LTS

Is it possible to highlight hits on search result?
Elasticsearch has this functionality: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-highlighting.html


#2

Its not implemented on our side yet.

We dont return the data directly from ES, just the id’s which again is fetched from the storage, so even if ES has this feature its not necessarily super-quick to implement support for this at our side, but its certainly doable.

Ill move this to “Features” since it is really a feature request.


#3

Any word on how long this might take? I have a customer that really wants this, would be nice if I can tell them something about how long time this could take.

(I understand this might take long time, so if anything I’m wondering how long it takes in general from a feature is requested until it’s implemented, if you have statistics on it.)


#4

Features are available in anything from 3 weeks to years (or even never if we don’t want to make it).
All depends on:

  • How hard is it to fix
  • Can it be solved outside of xp
  • Are many customers in need of it
    etc.

In this case, it is possible to handle basic highlighting by processing the response in the apps themselves, like we do for the Enonic market autocomplete search? Have you considered this approach?


#5

Yeah, I have a working solution using mark.js, and it seems to be quite performant. But I find such cases to be handled better by server-side solutions by default, so wanted to push this a little :slight_smile:


#6

I was thinking you do this on the server server in the controllers… Not sure how mark.js works, but we are essentially talking about regex processing…


#7

Our conclusion so far is that hit highlighting should be done in the controller for now.


#8