# How to highlight pre-defined terms in ElasticSearch?

**URL:** <https://discuss.elastic.co/t/how-to-highlight-pre-defined-terms-in-elasticsearch/14708>\
**Category:** Elasticsearch\
**Created:** [December 4, 2013, 4:05pm UTC](https://discuss.elastic.co/t/how-to-highlight-pre-defined-terms-in-elasticsearch/14708 "2013-12-04T16:05:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lingandcs](https://avatars.discourse-cdn.com/v4/letter/l/e495f1/32.png) [@lingandcs](https://discuss.elastic.co/u/lingandcs)\
**Post date:** [December 4, 2013, 4:05pm UTC](https://discuss.elastic.co/t/how-to-highlight-pre-defined-terms-in-elasticsearch/14708/1 "2013-12-04T16:05:39Z")

</div>

I'm not sure if ElasticSearch can handle this, but it sounds a search engine related application. The requirement is:

Giving a company name (100k) list and millions of documents, highlight all hits in each document.

It's not like a typical search engine application, e.g. user inputs a keyword and search engine returns all hits and highlight it. I'm looking into ElasticSearch APIs and trying to figure out how to do it. Anybody has any suggestion? Thanks!

---

<div class="post-metadata">

**Author:** ![lingandcs](https://avatars.discourse-cdn.com/v4/letter/l/e495f1/32.png) [@lingandcs](https://discuss.elastic.co/u/lingandcs)\
**Post date:** [December 5, 2013, 3:37pm UTC](https://discuss.elastic.co/t/how-to-highlight-pre-defined-terms-in-elasticsearch/14708/2 "2013-12-05T15:37:21Z")

</div>

Sounds like highlight APIs can do something, my though is: merge all company names into a single search query and do the search. But this will give too much work load to search engine...

---

<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, 2:03am UTC](https://discuss.elastic.co/t/how-to-highlight-pre-defined-terms-in-elasticsearch/14708/3 "2017-07-06T02:03:03Z")

</div>

Closed on July 6, 2017, 2:03am UTC


