# Custom highlighter

**URL:** <https://discuss.elastic.co/t/custom-highlighter/9814>\
**Category:** Elasticsearch\
**Created:** [November 24, 2012, 8:23pm UTC](https://discuss.elastic.co/t/custom-highlighter/9814 "2012-11-24T20:23:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pavel\_Goncharik](https://avatars.discourse-cdn.com/v4/letter/p/e274bd/32.png) [@Pavel\_Goncharik](https://discuss.elastic.co/u/Pavel_Goncharik)\
**Post date:** [November 24, 2012, 8:23pm UTC](https://discuss.elastic.co/t/custom-highlighter/9814/1 "2012-11-24T20:23:04Z")

</div>

Hi,

for our project we develop a solution which is able to identify which  
sub-query of user's query contributed to the hit. For that we have custom  
facet and query parser plugins in ES, which work like a charm. The final  
step is to highlight contribution of sub-queries in the returned fields  
(using custom highlighter), but this is where we are stuck: looks like ES  
doesn't provide any access for plugins into "highlighting" functionality.  
It seems that ES internally has a very flexible notion of "search phases"

- and highlighting is a sub-phase of the "FetchPhase" - but phases are  
also locked (I was thinking about adding a custom "phase").

Is custom REST endpoint (enriching response before it's sent back to the  
user) or modifying/compiling ES code are the only ways to implement custom  
highlighting?  
Are there any plans to open up highlighting for extensions?

WBR, Pavel

--

---

<div class="post-metadata">

**Author:** ![vineeth\_mohan](https://avatars.discourse-cdn.com/v4/letter/v/bc79bd/32.png) [@vineeth\_mohan](https://discuss.elastic.co/u/vineeth_mohan)\
**Post date:** [November 26, 2012, 5:06am UTC](https://discuss.elastic.co/t/custom-highlighter/9814/2 "2012-11-26T05:06:25Z")

</div>

I had also asked for such a plugin point.

@Shay , kindly consider this feature.  
There are numerous instance of usage for such a plugin point.

Thanks  
Vineeth

On Sun, Nov 25, 2012 at 1:53 AM, Pavel Goncharik  
[pavel.goncharik@gmail.com](mailto:pavel.goncharik@gmail.com)wrote:

> Hi,
> 
> for our project we develop a solution which is able to identify which  
> sub-query of user's query contributed to the hit. For that we have custom  
> facet and query parser plugins in ES, which work like a charm. The final  
> step is to highlight contribution of sub-queries in the returned fields  
> (using custom highlighter), but this is where we are stuck: looks like ES  
> doesn't provide any access for plugins into "highlighting" functionality.  
> It seems that ES internally has a very flexible notion of "search phases"
> 
> - and highlighting is a sub-phase of the "FetchPhase" - but phases are  
> also locked (I was thinking about adding a custom "phase").
> 
> Is custom REST endpoint (enriching response before it's sent back to the  
> user) or modifying/compiling ES code are the only ways to implement custom  
> highlighting?  
> Are there any plans to open up highlighting for extensions?
> 
> WBR, Pavel
> 
> --

--

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:02am UTC](https://discuss.elastic.co/t/custom-highlighter/9814/3 "2017-07-06T03:02:59Z")

</div>


