# Highlight in Percolator result

**URL:** <https://discuss.elastic.co/t/highlight-in-percolator-result/6844>\
**Category:** Elasticsearch\
**Created:** [March 1, 2012, 5:08am UTC](https://discuss.elastic.co/t/highlight-in-percolator-result/6844 "2012-03-01T05:08:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brett\_Anderson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brett_anderson/32/2555_2.png) [@Brett\_Anderson](https://discuss.elastic.co/u/Brett_Anderson)\
**Post date:** [March 1, 2012, 5:08am UTC](https://discuss.elastic.co/t/highlight-in-percolator-result/6844/1 "2012-03-01T05:08:56Z")

</div>

On a percolate request, can the doc be returned with the matched words  
highlighted? I tried doing this by specifying highlight settings when I  
registered the percolator (using NEST in C#)

private bool RegisterPercolator(string name, string query)  
{  
var c = this.ConnectedClient;  
var r = c.RegisterPercolator(  
FilterName,  
name,  
String.Format(  
@"{{  
""query"" : {{  
""query\_string"" : {{  
""query"" : ""{0}""  
}}  
}},  
""highlight"" : {{  
""fields"" : {{  
""some\_field"" : {{}}  
}}  
}}  
}}", query)  
);  
return (r.IsValid && r.OK);  
}

I then percolate a document which correctly returns the match, but no  
additional highlight information:

{  
"ok" : true,  
"\_index" : "\_percolator",  
"\_type" : "index\_name",  
"\_id" : "xxxx",  
"\_version" : 1  
}

Is there anyway to use the highlight feature with the percolator?

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [March 1, 2012, 12:33pm UTC](https://discuss.elastic.co/t/highlight-in-percolator-result/6844/2 "2012-03-01T12:33:40Z")

</div>

No, its only a match/no match thing.

On Thursday, March 1, 2012 at 7:08 AM, Brett Anderson wrote:

> On a percolate request, can the doc be returned with the matched words highlighted? I tried doing this by specifying highlight settings when I registered the percolator (using NEST in C#)
> 
> private bool RegisterPercolator(string name, string query)  
> {  
> var c = this.ConnectedClient;  
> var r = c.RegisterPercolator(  
> FilterName,  
> name,  
> String.Format(  
> @"{{  
> ""query"" : {{  
> ""query\_string"" : {{  
> ""query"" : ""{0}""  
> }}  
> }},  
> ""highlight"" : {{  
> ""fields"" : {{  
> ""some\_field"" : {{}}  
> }}  
> }}  
> }}", query)  
> );  
> return (r.IsValid && r.OK);  
> }
> 
> I then percolate a document which correctly returns the match, but no additional highlight information:
> 
> {  
> "ok" : true,  
> "\_index" : "\_percolator",  
> "\_type" : "index\_name",  
> "\_id" : "xxxx",  
> "\_version" : 1  
> }
> 
> Is there anyway to use the highlight feature with the percolator?

---

<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:37am UTC](https://discuss.elastic.co/t/highlight-in-percolator-result/6844/3 "2017-07-06T03:37:45Z")

</div>


