# Highlight one field twice with different fragments in one search

**URL:** https://discuss.elastic.co/t/highlight-one-field-twice-with-different-fragments-in-one-search/3743
**Category:** Elasticsearch
**Created:** [January 5, 2011, 2:13am UTC](https://discuss.elastic.co/t/highlight-one-field-twice-with-different-fragments-in-one-search/3743 "2011-01-05T02:13:34Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![locojay](https://avatars.discourse-cdn.com/v4/letter/l/838e76/32.png) [@locojay](https://discuss.elastic.co/u/locojay)
#### Post date: [January 5, 2011, 2:13am UTC](https://discuss.elastic.co/t/highlight-one-field-twice-with-different-fragments-in-one-search/3743/1 "2011-01-05T02:13:34Z")

</div>

Hi ,

I would like to highlight a field twice :

```
	1 - number of fragments to 0 ==> get all highlighted
            2- number of fragments to x ==> get some fragments highlighted

```

in one search.

from a json perspective this will not work

curl -XGET '[http://localhost:9200/testindex\_index/\_search](http://localhost:9200/testindex_index/_search)' -d '{"highlight": {"fields": {"fulltext": {"number\_of\_fragments": 0},"fulltext": {"number\_of\_fragments": 5}},"post\_tags": [""],"pre\_tags": ["_"]},"query": {"query\_string": {"query": "test"}},"size": 1}'_

since its a dict.

The only thing i can think of is adding another field "fulltextcopy" to my model and reindex all .

Unfortunately the fulltext field is really large and i have about 100m docs. If i am not mistaken even by setting store to false will increase the size of my data folder.

Something nice would be the ability to add for example fieldname\_\_copy and then es would strip of \_\_copy and call lucene highlighter on that filed.

Thanks for any suggestions

---

<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: [January 5, 2011, 12:28pm UTC](https://discuss.elastic.co/t/highlight-one-field-twice-with-different-fragments-in-one-search/3743/2 "2011-01-05T12:28:31Z")

</div>

Open a feature request for it. Should be simple to implement.

On Wed, Jan 5, 2011 at 4:13 AM, Jassin MEKNASSI \<  
[jassin.meknassi@googlemail.com](mailto:jassin.meknassi@googlemail.com)\> wrote:

> Hi ,
> 
> I would like to highlight a field twice :
> 
> ```
> 1 - number of fragments to 0 ==> get all highlighted
> 2- number of fragments to x ==> get some fragments
> 
> ```
> 
> highlighted
> 
> in one search.
> 
> from a json perspective this will not work
> 
> curl -XGET '[http://localhost:9200/testindex\_index/\_search](http://localhost:9200/testindex_index/_search)' -d  
> '{"highlight": {"fields": {"fulltext": {"number\_of\_fragments":  
> 0},"fulltext": {"number\_of\_fragments": 5}},"post\_tags":  
> [""],"pre\_tags": ["_"]},"query": {"query\_string": {"query":  
> "test"}},"size": 1}'_
> 
>  
> 
> _since its a dict._
> 
>  
> 
> _The only thing i can think of is adding another field "fulltextcopy" to my  
> model and reindex all ._
> 
>  
> 
> _Unfortunately the fulltext field is really large and i have about 100m  
> docs. If i am not mistaken even by setting store to false will increase the  
> size of my data folder._
> 
>  
> 
> _Something nice would be the ability to add for example fieldname\_\_copy and  
> then es would strip of \_\_copy and call lucene highlighter on that filed._
> 
>  
> 
> _Thanks for any suggestions_

---

<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, 4:14am UTC](https://discuss.elastic.co/t/highlight-one-field-twice-with-different-fragments-in-one-search/3743/3 "2017-07-06T04:14:19Z")

</div>


