# Highlight snippets that do not cross new lines

**URL:** <https://discuss.elastic.co/t/highlight-snippets-that-do-not-cross-new-lines/55681>\
**Category:** Elasticsearch\
**Created:** [July 17, 2016, 3:45am UTC](https://discuss.elastic.co/t/highlight-snippets-that-do-not-cross-new-lines/55681 "2016-07-17T03:45:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hherman1](https://avatars.discourse-cdn.com/v4/letter/h/74df32/32.png) [@hherman1](https://discuss.elastic.co/u/hherman1)\
**Post date:** [July 17, 2016, 3:45am UTC](https://discuss.elastic.co/t/highlight-snippets-that-do-not-cross-new-lines/55681/1 "2016-07-17T03:45:41Z")

</div>

I would like to be able to receive highlights from elasticsearch that do not cross newlines. Suppose I have the following document:  
"""  
Foo  
Bar  
Baz  
"""  
I would like a search for "Foo Bar Baz" to return [Foo,Bar,Baz] as seaparate highlights, due to the new lines. Rather, however, it retursn ["Foo Bar Baz"] as a single highlight.

Could anyone help me here? I don't see anyhthing about this on the documentation for highlighting.

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [July 17, 2016, 2:58pm UTC](https://discuss.elastic.co/t/highlight-snippets-that-do-not-cross-new-lines/55681/2 "2016-07-17T14:58:42Z")

</div>

I don't think that is a thing that the highlighters support right now. If  
you split by new line and put the text in a json array before putting into  
elasticsearch it'd do what you wanted though.

---

<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 5, 2017, 10:34pm UTC](https://discuss.elastic.co/t/highlight-snippets-that-do-not-cross-new-lines/55681/3 "2017-07-05T22:34:56Z")

</div>


