# Highlight using \_source in Elasticsearch0.14.0 version

**URL:** <https://discuss.elastic.co/t/highlight-using--source-in-elasticsearch0-14-0-version/3705>\
**Category:** Elasticsearch\
**Created:** [December 29, 2010, 5:16am UTC](https://discuss.elastic.co/t/highlight-using--source-in-elasticsearch0-14-0-version/3705 "2010-12-29T05:16:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![senthil\_prabhu](https://avatars.discourse-cdn.com/v4/letter/s/9e8a1a/32.png) [@senthil\_prabhu](https://discuss.elastic.co/u/senthil_prabhu)\
**Post date:** [December 29, 2010, 5:16am UTC](https://discuss.elastic.co/t/highlight-using--source-in-elasticsearch0-14-0-version/3705/1 "2010-12-29T05:16:01Z")

</div>

Hi,  
I want to know how to highlight in elastic search version  
0.14.0. Here I am indexing a file with below mapping query.

Mapping query:{"metadata" : {"dynamic" :"true","\_source" :  
{"enabled" :true },"properties" : { } } }

and i am search here using the below query

Search query:{"query" : { "query\_string" : { "default\_field" : "",  
"query" : "title:tiff0003","default\_operator" : "OR","analyzer" :  
"standard","allow\_leading\_wildcard" :  
true,"lowercase\_expanded\_terms" : true,"enable\_position\_increments" :  
true,"fuzzy\_prefix\_length" : 0,"fuzzy\_min\_sim" : 0.5,"phrase\_slop" :  
0,"boost" : 1.0 } }, "from" : 0, "size" : 20, "highlight" :  
{ "tags\_schema" : "styled" ,"pre\_tags" : ["_"] ,"post\_tags" :  
["_"] ,"fields" : { "title" : {"fragment\_size" :  
1500,"number\_of\_fragments" : 10 } } }, "explain" : false,"fields" :  
["title"] }.

search output gets one document without highlighting.Is any thing  
wrong in my queries. can anyone explain how to get highlight using  
\_source field.

---

<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:** [December 29, 2010, 8:53am UTC](https://discuss.elastic.co/t/highlight-using--source-in-elasticsearch0-14-0-version/3705/2 "2010-12-29T08:53:31Z")

</div>

You still need to have the term\_vector mapping set on the title field to  
"with\_positions\_offsets".

On Wed, Dec 29, 2010 at 7:16 AM, senthil prabhu [senthilsebi@gmail.com](mailto:senthilsebi@gmail.com)wrote:

> Hi,  
> I want to know how to highlight in Elasticsearch version  
> 0.14.0. Here I am indexing a file with below mapping query.
> 
> Mapping query:{"metadata" : {"dynamic" :"true","\_source" :  
> {"enabled" :true },"properties" : { } } }
> 
> and i am search here using the below query
> 
> Search query:{"query" : { "query\_string" : { "default\_field" : "",  
> "query" : "title:tiff0003","default\_operator" : "OR","analyzer" :  
> "standard","allow\_leading\_wildcard" :  
> true,"lowercase\_expanded\_terms" : true,"enable\_position\_increments" :  
> true,"fuzzy\_prefix\_length" : 0,"fuzzy\_min\_sim" : 0.5,"phrase\_slop" :  
> 0,"boost" : 1.0 } }, "from" : 0, "size" : 20, "highlight" :  
> { "tags\_schema" : "styled" ,"pre\_tags" : ["_"] ,"post\_tags" :  
> ["_"] ,"fields" : { "title" : {"fragment\_size" :  
> 1500,"number\_of\_fragments" : 10 } } }, "explain" : false,"fields" :  
> ["title"] }.
> 
> search output gets one document without highlighting.Is any thing  
> wrong in my queries. can anyone explain how to get highlight using  
> \_source field.

---

<div class="post-metadata">

**Author:** ![senthil\_prabhu](https://avatars.discourse-cdn.com/v4/letter/s/9e8a1a/32.png) [@senthil\_prabhu](https://discuss.elastic.co/u/senthil_prabhu)\
**Post date:** [December 29, 2010, 9:31am UTC](https://discuss.elastic.co/t/highlight-using--source-in-elasticsearch0-14-0-version/3705/3 "2010-12-29T09:31:58Z")

</div>

So you said each and every field should be mapped am i right?

Another doubt here is do i need to create an index with analyzed and  
stored? Why i am asking here is Elastic search 0.14.0 release notes  
shows that by using \_source itself we can highlight...

On Dec 29, 1:53 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:

> You still need to have the term\_vector mapping set on the title field to  
> "with\_positions\_offsets".
> 
> On Wed, Dec 29, 2010 at 7:16 AM, senthil prabhu [senthils...@gmail.com](mailto:senthils...@gmail.com)wrote:
> 
> > Hi,  
> > I want to know how to highlight in Elasticsearch version  
> > 0.14.0. Here I am indexing a file with below mapping query.
> 
> > Mapping query:{"metadata" : {"dynamic" :"true","\_source" :  
> > {"enabled" :true },"properties" : { } } }
> 
> > and i am search here using the below query
> 
> > Search query:{"query" : { "query\_string" : { "default\_field" : "",  
> > "query" : "title:tiff0003","default\_operator" : "OR","analyzer" :  
> > "standard","allow\_leading\_wildcard" :  
> > true,"lowercase\_expanded\_terms" : true,"enable\_position\_increments" :  
> > true,"fuzzy\_prefix\_length" : 0,"fuzzy\_min\_sim" : 0.5,"phrase\_slop" :  
> > 0,"boost" : 1.0 } }, "from" : 0, "size" : 20, "highlight" :  
> > { "tags\_schema" : "styled" ,"pre\_tags" : ["_"] ,"post\_tags" :  
> > ["_"] ,"fields" : { "title" : {"fragment\_size" :  
> > 1500,"number\_of\_fragments" : 10 } } }, "explain" : false,"fields" :  
> > ["title"] }.
> 
> > search output gets one document without highlighting.Is any thing  
> > wrong in my queries. can anyone explain how to get highlight using  
> > \_source field.

---

<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:** [December 29, 2010, 10:16am UTC](https://discuss.elastic.co/t/highlight-using--source-in-elasticsearch0-14-0-version/3705/4 "2010-12-29T10:16:02Z")

</div>

You don't need to have the field stored, but it needs to have the  
term\_vector set.  
[http://www.elasticsearch.com/docs/elasticsearch/rest\_api/search/highlighting/](http://www.elasticsearch.com/docs/elasticsearch/rest_api/search/highlighting/)  
.

On Wed, Dec 29, 2010 at 11:31 AM, senthil prabhu [senthilsebi@gmail.com](mailto:senthilsebi@gmail.com)wrote:

> So you said each and every field should be mapped am i right?
> 
> Another doubt here is do i need to create an index with analyzed and  
> stored? Why i am asking here is Elastic search 0.14.0 release notes  
> shows that by using \_source itself we can highlight...
> 
> On Dec 29, 1:53 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> 
> > You still need to have the term\_vector mapping set on the title field to  
> > "with\_positions\_offsets".
> > 
> > On Wed, Dec 29, 2010 at 7:16 AM, senthil prabhu \<[senthils...@gmail.com](mailto:senthils...@gmail.com)  
> > wrote:
> > 
> > > Hi,  
> > > I want to know how to highlight in Elasticsearch version  
> > > 0.14.0. Here I am indexing a file with below mapping query.
> > 
> > > Mapping query:{"metadata" : {"dynamic" :"true","\_source" :  
> > > {"enabled" :true },"properties" : { } } }
> > 
> > > and i am search here using the below query
> > 
> > > Search query:{"query" : { "query\_string" : { "default\_field" : "",  
> > > "query" : "title:tiff0003","default\_operator" : "OR","analyzer" :  
> > > "standard","allow\_leading\_wildcard" :  
> > > true,"lowercase\_expanded\_terms" : true,"enable\_position\_increments" :  
> > > true,"fuzzy\_prefix\_length" : 0,"fuzzy\_min\_sim" : 0.5,"phrase\_slop" :  
> > > 0,"boost" : 1.0 } }, "from" : 0, "size" : 20, "highlight" :  
> > > { "tags\_schema" : "styled" ,"pre\_tags" : ["_"] ,"post\_tags" :  
> > > ["_"] ,"fields" : { "title" : {"fragment\_size" :  
> > > 1500,"number\_of\_fragments" : 10 } } }, "explain" : false,"fields" :  
> > > ["title"] }.
> > 
> > > search output gets one document without highlighting.Is any thing  
> > > wrong in my queries. can anyone explain how to get highlight using  
> > > \_source field.

---

<div class="post-metadata">

**Author:** ![senthil\_prabhu](https://avatars.discourse-cdn.com/v4/letter/s/9e8a1a/32.png) [@senthil\_prabhu](https://discuss.elastic.co/u/senthil_prabhu)\
**Post date:** [December 29, 2010, 11:22am UTC](https://discuss.elastic.co/t/highlight-using--source-in-elasticsearch0-14-0-version/3705/5 "2010-12-29T11:22:05Z")

</div>

Thank you shay banon

On Dec 29, 3:16 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:

> You don't need to have the field stored, but it needs to have the  
> term\_vector set.[http://www.elasticsearch.com/docs/elasticsearch/rest\_api/search/highl](http://www.elasticsearch.com/docs/elasticsearch/rest_api/search/highl)...  
> .
> 
> On Wed, Dec 29, 2010 at 11:31 AM, senthil prabhu [senthils...@gmail.com](mailto:senthils...@gmail.com)wrote:
> 
> > So you said each and every field should be mapped am i right?
> 
> > Another doubt here is do i need to create an index with analyzed and  
> > stored? Why i am asking here is Elastic search 0.14.0 release notes  
> > shows that by using \_source itself we can highlight...
> 
> > On Dec 29, 1:53 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> > 
> > > You still need to have the term\_vector mapping set on the title field to  
> > > "with\_positions\_offsets".
> 
> > > On Wed, Dec 29, 2010 at 7:16 AM, senthil prabhu \<[senthils...@gmail.com](mailto:senthils...@gmail.com)  
> > > wrote:
> 
> > > > Hi,  
> > > > I want to know how to highlight in Elasticsearch version  
> > > > 0.14.0. Here I am indexing a file with below mapping query.
> 
> > > > Mapping query:{"metadata" : {"dynamic" :"true","\_source" :  
> > > > {"enabled" :true },"properties" : { } } }
> 
> > > > and i am search here using the below query
> 
> > > > Search query:{"query" : { "query\_string" : { "default\_field" : "",  
> > > > "query" : "title:tiff0003","default\_operator" : "OR","analyzer" :  
> > > > "standard","allow\_leading\_wildcard" :  
> > > > true,"lowercase\_expanded\_terms" : true,"enable\_position\_increments" :  
> > > > true,"fuzzy\_prefix\_length" : 0,"fuzzy\_min\_sim" : 0.5,"phrase\_slop" :  
> > > > 0,"boost" : 1.0 } }, "from" : 0, "size" : 20, "highlight" :  
> > > > { "tags\_schema" : "styled" ,"pre\_tags" : ["_"] ,"post\_tags" :  
> > > > ["_"] ,"fields" : { "title" : {"fragment\_size" :  
> > > > 1500,"number\_of\_fragments" : 10 } } }, "explain" : false,"fields" :  
> > > > ["title"] }.
> 
> > > > search output gets one document without highlighting.Is any thing  
> > > > wrong in my queries. can anyone explain how to get highlight using  
> > > > \_source field.

---

<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-using--source-in-elasticsearch0-14-0-version/3705/6 "2017-07-06T04:14:42Z")

</div>


