# Highlighting without indexing document

**URL:** <https://discuss.elastic.co/t/highlighting-without-indexing-document/25710>\
**Category:** Elasticsearch\
**Created:** [July 16, 2015, 9:50am UTC](https://discuss.elastic.co/t/highlighting-without-indexing-document/25710 "2015-07-16T09:50:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Settler](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/settler/32/3743_2.png) [@Settler](https://discuss.elastic.co/u/Settler)\
**Post date:** [July 16, 2015, 9:50am UTC](https://discuss.elastic.co/t/highlighting-without-indexing-document/25710/1 "2015-07-16T09:50:14Z")

</div>

Hi.

Is there any analogue of sphinx ["call snippets"](http://sphinxsearch.com/docs/current/sphinxql-call-snippets.html) api, that can highlight any text without indexing it?  
In our cases, we need to send to elasticsearch:

- Text (without indexing it before)
- Query

And in response receive highlight data. Can it be done with current elasticsearch api? Or there could be some workaround to achieve this behavior?

---

<div class="post-metadata">

**Author:** ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)\
**Post date:** [July 16, 2015, 10:03am UTC](https://discuss.elastic.co/t/highlighting-without-indexing-document/25710/2 "2015-07-16T10:03:58Z")

</div>

This is not supported today. I guess the closest feature would be the [highlight](https://github.com/elastic/elasticsearch/issues/3574) option of the percolator which allows you to highlight a document against a set of registered queries.

---

<div class="post-metadata">

**Author:** ![Settler](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/settler/32/3743_2.png) [@Settler](https://discuss.elastic.co/u/Settler)\
**Post date:** [July 16, 2015, 11:08am UTC](https://discuss.elastic.co/t/highlighting-without-indexing-document/25710/3 "2015-07-16T11:08:34Z")

</div>

Thanks for fast answer. So, my workaround should be something like this:

- Add query to elasticsearch as percolator
- Send text to that percolator
- Delete percolator

Is that right?  
Can I post feature request somewhere to implement this feature in future?

---

<div class="post-metadata">

**Author:** ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)\
**Post date:** [July 16, 2015, 12:14pm UTC](https://discuss.elastic.co/t/highlighting-without-indexing-document/25710/4 "2015-07-16T12:14:33Z")

</div>

Right that would work. You can open an issue at [https://github.com/elastic/elasticsearch/issues/](https://github.com/elastic/elasticsearch/issues/) with your feature request. One challenge I can think of is that highlighters typically depend on mappings so we would need to have mappings for your documents somehow.

---

<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, 12:01am UTC](https://discuss.elastic.co/t/highlighting-without-indexing-document/25710/5 "2017-07-06T00:01:00Z")

</div>


