# Highlight results with PHP Client

**URL:** <https://discuss.elastic.co/t/highlight-results-with-php-client/119336>\
**Category:** Elasticsearch\
**Created:** [February 10, 2018, 11:48am UTC](https://discuss.elastic.co/t/highlight-results-with-php-client/119336 "2018-02-10T11:48:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![syiannop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/syiannop/32/26920_2.png) [@syiannop](https://discuss.elastic.co/u/syiannop)\
**Post date:** [February 10, 2018, 11:48am UTC](https://discuss.elastic.co/t/highlight-results-with-php-client/119336/1 "2018-02-10T11:48:29Z")

</div>

I created a search bar in a PHP file, that searches my ES index (using the ES PHP client) and shows the results back on it. I want to highlight the searched term in the results like this random image I found online:  
[![](http://perials.com/wp-content/uploads/2015/07/highlighted-search-results.jpg) ](http://perials.com/wp-content/uploads/2015/07/highlighted-search-results.jpg)

Here is a part of the [code](https://gist.github.com/sy92/d2bb092dfd404fec3cd3f5f1d0af2352). I can't figure out how to achieve the above functionality.

---

<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:** [March 10, 2018, 11:48am UTC](https://discuss.elastic.co/t/highlight-results-with-php-client/119336/2 "2018-03-10T11:48:37Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
