# Strange highlighting issue with custom\_score

**URL:** <https://discuss.elastic.co/t/strange-highlighting-issue-with-custom-score/7456>\
**Category:** Elasticsearch\
**Created:** [April 24, 2012, 5:45pm UTC](https://discuss.elastic.co/t/strange-highlighting-issue-with-custom-score/7456 "2012-04-24T17:45:54Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![vineeth\_mohan](https://avatars.discourse-cdn.com/v4/letter/v/bc79bd/32.png) [@vineeth\_mohan](https://discuss.elastic.co/u/vineeth_mohan)\
**Post date:** [April 24, 2012, 5:45pm UTC](https://discuss.elastic.co/t/strange-highlighting-issue-with-custom-score/7456/1 "2012-04-24T17:45:54Z")

</div>

Hi ,

When i DONT give the index name and type in the URL , highlighting is  
coming in result.  
And when i give the index name and type in URL , highlighting is NOT  
working.

GIST of the query used - [https://gist.github.com/2481925](https://gist.github.com/2481925)

Thanks ,  
Vineeth

---

<div class="post-metadata">

**Author:** ![vineeth\_mohan](https://avatars.discourse-cdn.com/v4/letter/v/bc79bd/32.png) [@vineeth\_mohan](https://discuss.elastic.co/u/vineeth_mohan)\
**Post date:** [April 24, 2012, 5:47pm UTC](https://discuss.elastic.co/t/strange-highlighting-issue-with-custom-score/7456/2 "2012-04-24T17:47:17Z")

</div>

Slight correction , the contradictory behavior comes only when type is  
mentioned and not mentioned.

Thanks  
Vineeth  
On Tue, Apr 24, 2012 at 11:15 PM, Vineeth Mohan  
[vineethmohan@algotree.com](mailto:vineethmohan@algotree.com)wrote:

> Hi ,
> 
> When i DONT give the index name and type in the URL , highlighting is  
> coming in result.  
> And when i give the index name and type in URL , highlighting is NOT  
> working.
> 
> GIST of the query used - [gist:2481925 · GitHub](https://gist.github.com/2481925)
> 
> Thanks ,  
> Vineeth

---

<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:** [April 27, 2012, 8:52am UTC](https://discuss.elastic.co/t/strange-highlighting-issue-with-custom-score/7456/3 "2012-04-27T08:52:55Z")

</div>

Can you gist a full recreation (index sample data, and show the behavior)?  
Also, which version are you using?

On Tue, Apr 24, 2012 at 8:47 PM, Vineeth Mohan [vineethmohan@algotree.com](mailto:vineethmohan@algotree.com)wrote:

> Slight correction , the contradictory behavior comes only when type is  
> mentioned and not mentioned.
> 
> Thanks  
> Vineeth
> 
> On Tue, Apr 24, 2012 at 11:15 PM, Vineeth Mohan \<[vineethmohan@algotree.com](mailto:vineethmohan@algotree.com)
> 
> > wrote:
> 
> > Hi ,
> > 
> > When i DONT give the index name and type in the URL , highlighting is  
> > coming in result.  
> > And when i give the index name and type in URL , highlighting is NOT  
> > working.
> > 
> > GIST of the query used - [gist:2481925 · GitHub](https://gist.github.com/2481925)
> > 
> > Thanks ,  
> > Vineeth

---

<div class="post-metadata">

**Author:** ![vineeth\_mohan](https://avatars.discourse-cdn.com/v4/letter/v/bc79bd/32.png) [@vineeth\_mohan](https://discuss.elastic.co/u/vineeth_mohan)\
**Post date:** [April 28, 2012, 5:47am UTC](https://discuss.elastic.co/t/strange-highlighting-issue-with-custom-score/7456/4 "2012-04-28T05:47:06Z")

</div>

Here you go - [gist:2516361 · GitHub](https://gist.github.com/2516361)

Thanks  
Vineeth

On Fri, Apr 27, 2012 at 2:22 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> Can you gist a full recreation (index sample data, and show the behavior)?  
> Also, which version are you using?
> 
> On Tue, Apr 24, 2012 at 8:47 PM, Vineeth Mohan [vineethmohan@algotree.com](mailto:vineethmohan@algotree.com)wrote:
> 
> > Slight correction , the contradictory behavior comes only when type is  
> > mentioned and not mentioned.
> > 
> > Thanks  
> > Vineeth
> > 
> > On Tue, Apr 24, 2012 at 11:15 PM, Vineeth Mohan \<  
> > [vineethmohan@algotree.com](mailto:vineethmohan@algotree.com)\> wrote:
> > 
> > > Hi ,
> > > 
> > > When i DONT give the index name and type in the URL , highlighting is  
> > > coming in result.  
> > > And when i give the index name and type in URL , highlighting is NOT  
> > > working.
> > > 
> > > GIST of the query used - [gist:2481925 · GitHub](https://gist.github.com/2481925)
> > > 
> > > Thanks ,  
> > > Vineeth

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [April 28, 2012, 4:17pm UTC](https://discuss.elastic.co/t/strange-highlighting-issue-with-custom-score/7456/5 "2012-04-28T16:17:57Z")

</div>

The script that Vineeth provided works fine in 0.18.5 and lower but breaks  
in 0.18.6 and higher.

On Saturday, April 28, 2012 1:47:06 AM UTC-4, Vineeth Mohan wrote:

> Here you go - [gist:2516361 · GitHub](https://gist.github.com/2516361)
> 
> Thanks  
> Vineeth
> 
> On Fri, Apr 27, 2012 at 2:22 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> 
> > Can you gist a full recreation (index sample data, and show the  
> > behavior)? Also, which version are you using?
> > 
> > On Tue, Apr 24, 2012 at 8:47 PM, Vineeth Mohan \<[vineethmohan@algotree.com](mailto:vineethmohan@algotree.com)
> > 
> > > wrote:
> > 
> > > Slight correction , the contradictory behavior comes only when type is  
> > > mentioned and not mentioned.
> > > 
> > > Thanks  
> > > Vineeth
> > > 
> > > On Tue, Apr 24, 2012 at 11:15 PM, Vineeth Mohan \<  
> > > [vineethmohan@algotree.com](mailto:vineethmohan@algotree.com)\> wrote:
> > > 
> > > > Hi ,
> > > > 
> > > > When i DONT give the index name and type in the URL , highlighting is  
> > > > coming in result.  
> > > > And when i give the index name and type in URL , highlighting is NOT  
> > > > working.
> > > > 
> > > > GIST of the query used - [gist:2481925 · GitHub](https://gist.github.com/2481925)
> > > > 
> > > > Thanks ,  
> > > > Vineeth

---

<div class="post-metadata">

**Author:** ![vineeth\_mohan](https://avatars.discourse-cdn.com/v4/letter/v/bc79bd/32.png) [@vineeth\_mohan](https://discuss.elastic.co/u/vineeth_mohan)\
**Post date:** [April 29, 2012, 1:42am UTC](https://discuss.elastic.co/t/strange-highlighting-issue-with-custom-score/7456/6 "2012-04-29T01:42:34Z")

</div>

The version i am using is .19.2

Thanks  
Vineeth

On Sat, Apr 28, 2012 at 9:47 PM, Igor Motov [imotov@gmail.com](mailto:imotov@gmail.com) wrote:

> The script that Vineeth provided works fine in 0.18.5 and lower but breaks  
> in 0.18.6 and higher.
> 
> On Saturday, April 28, 2012 1:47:06 AM UTC-4, Vineeth Mohan wrote:
> 
> > Here you go - [https://gist.github.com/\*\*2516361](https://gist.github.com/**2516361)[https://gist.github.com/2516361](https://gist.github.com/2516361)
> > 
> > Thanks  
> > Vineeth
> > 
> > On Fri, Apr 27, 2012 at 2:22 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> > 
> > > Can you gist a full recreation (index sample data, and show the  
> > > behavior)? Also, which version are you using?
> > > 
> > > On Tue, Apr 24, 2012 at 8:47 PM, Vineeth Mohan \<  
> > > [vineethmohan@algotree.com](mailto:vineethmohan@algotree.com)\> wrote:
> > > 
> > > > Slight correction , the contradictory behavior comes only when type is  
> > > > mentioned and not mentioned.
> > > > 
> > > > Thanks  
> > > > Vineeth
> > > > 
> > > > On Tue, Apr 24, 2012 at 11:15 PM, Vineeth Mohan \<  
> > > > [vineethmohan@algotree.com](mailto:vineethmohan@algotree.com)\> wrote:
> > > > 
> > > > > Hi ,
> > > > > 
> > > > > When i DONT give the index name and type in the URL , highlighting is  
> > > > > coming in result.  
> > > > > And when i give the index name and type in URL , highlighting is NOT  
> > > > > working.
> > > > > 
> > > > > GIST of the query used - [https://gist.github.com/\*\*2481925](https://gist.github.com/**2481925)[https://gist.github.com/2481925](https://gist.github.com/2481925)
> > > > > 
> > > > > Thanks ,  
> > > > > Vineeth

---

<div class="post-metadata">

**Author:** ![vineeth\_mohan](https://avatars.discourse-cdn.com/v4/letter/v/bc79bd/32.png) [@vineeth\_mohan](https://discuss.elastic.co/u/vineeth_mohan)\
**Post date:** [April 29, 2012, 3:07pm UTC](https://discuss.elastic.co/t/strange-highlighting-issue-with-custom-score/7456/7 "2012-04-29T15:07:13Z")

</div>

@Shay , @Igor - Should i open a issue for this ?

Thanks  
Vineeth

On Sun, Apr 29, 2012 at 7:12 AM, Vineeth Mohan [vineethmohan@algotree.com](mailto:vineethmohan@algotree.com)wrote:

> The version i am using is .19.2
> 
> Thanks  
> Vineeth
> 
> On Sat, Apr 28, 2012 at 9:47 PM, Igor Motov [imotov@gmail.com](mailto:imotov@gmail.com) wrote:
> 
> > The script that Vineeth provided works fine in 0.18.5 and lower but  
> > breaks in 0.18.6 and higher.
> > 
> > On Saturday, April 28, 2012 1:47:06 AM UTC-4, Vineeth Mohan wrote:
> > 
> > > Here you go - [https://gist.github.com/\*\*2516361](https://gist.github.com/**2516361)[https://gist.github.com/2516361](https://gist.github.com/2516361)
> > > 
> > > Thanks  
> > > Vineeth
> > > 
> > > On Fri, Apr 27, 2012 at 2:22 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> > > 
> > > > Can you gist a full recreation (index sample data, and show the  
> > > > behavior)? Also, which version are you using?
> > > > 
> > > > On Tue, Apr 24, 2012 at 8:47 PM, Vineeth Mohan \<  
> > > > [vineethmohan@algotree.com](mailto:vineethmohan@algotree.com)\> wrote:
> > > > 
> > > > > Slight correction , the contradictory behavior comes only when type is  
> > > > > mentioned and not mentioned.
> > > > > 
> > > > > Thanks  
> > > > > Vineeth
> > > > > 
> > > > > On Tue, Apr 24, 2012 at 11:15 PM, Vineeth Mohan \<  
> > > > > [vineethmohan@algotree.com](mailto:vineethmohan@algotree.com)\> wrote:
> > > > > 
> > > > > > Hi ,
> > > > > > 
> > > > > > When i DONT give the index name and type in the URL , highlighting is  
> > > > > > coming in result.  
> > > > > > And when i give the index name and type in URL , highlighting is NOT  
> > > > > > working.
> > > > > > 
> > > > > > GIST of the query used - [https://gist.github.com/\*\*2481925](https://gist.github.com/**2481925)[https://gist.github.com/2481925](https://gist.github.com/2481925)
> > > > > > 
> > > > > > Thanks ,  
> > > > > > Vineeth

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [April 29, 2012, 3:16pm UTC](https://discuss.elastic.co/t/strange-highlighting-issue-with-custom-score/7456/8 "2012-04-29T15:16:17Z")

</div>

Vineeth,

It looks like a bug to me. So, I think it might be a good idea to track it  
as an issue.

Igor

On Sunday, April 29, 2012 11:07:13 AM UTC-4, Vineeth Mohan wrote:

> @Shay , @Igor - Should i open a issue for this ?
> 
> Thanks  
> Vineeth
> 
> On Sun, Apr 29, 2012 at 7:12 AM, Vineeth Mohan [vineethmohan@algotree.com](mailto:vineethmohan@algotree.com)wrote:
> 
> > The version i am using is .19.2
> > 
> > Thanks  
> > Vineeth
> > 
> > On Sat, Apr 28, 2012 at 9:47 PM, Igor Motov [imotov@gmail.com](mailto:imotov@gmail.com) wrote:
> > 
> > > The script that Vineeth provided works fine in 0.18.5 and lower but  
> > > breaks in 0.18.6 and higher.
> > > 
> > > On Saturday, April 28, 2012 1:47:06 AM UTC-4, Vineeth Mohan wrote:
> > > 
> > > > Here you go - [https://gist.github.com/\*\*2516361](https://gist.github.com/**2516361)[https://gist.github.com/2516361](https://gist.github.com/2516361)
> > > > 
> > > > Thanks  
> > > > Vineeth
> > > > 
> > > > On Fri, Apr 27, 2012 at 2:22 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> > > > 
> > > > > Can you gist a full recreation (index sample data, and show the  
> > > > > behavior)? Also, which version are you using?
> > > > > 
> > > > > On Tue, Apr 24, 2012 at 8:47 PM, Vineeth Mohan \<  
> > > > > [vineethmohan@algotree.com](mailto:vineethmohan@algotree.com)\> wrote:
> > > > > 
> > > > > > Slight correction , the contradictory behavior comes only when type  
> > > > > > is mentioned and not mentioned.
> > > > > > 
> > > > > > Thanks  
> > > > > > Vineeth
> > > > > > 
> > > > > > On Tue, Apr 24, 2012 at 11:15 PM, Vineeth Mohan \<  
> > > > > > [vineethmohan@algotree.com](mailto:vineethmohan@algotree.com)\> wrote:
> > > > > > 
> > > > > > > Hi ,
> > > > > > > 
> > > > > > > When i DONT give the index name and type in the URL , highlighting  
> > > > > > > is coming in result.  
> > > > > > > And when i give the index name and type in URL , highlighting is NOT  
> > > > > > > working.
> > > > > > > 
> > > > > > > GIST of the query used - [https://gist.github.com/\*\*2481925](https://gist.github.com/**2481925)[https://gist.github.com/2481925](https://gist.github.com/2481925)
> > > > > > > 
> > > > > > > Thanks ,  
> > > > > > > Vineeth

---

<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:** [April 29, 2012, 3:21pm UTC](https://discuss.elastic.co/t/strange-highlighting-issue-with-custom-score/7456/9 "2012-04-29T15:21:15Z")

</div>

I opened an issue:  
[Highlighting: Using "plain" (non term vector) highlighting with custom score within a filtered query fails to highlight · Issue #1894 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/1894), explained it a  
bit there as well.

On Sun, Apr 29, 2012 at 6:16 PM, Igor Motov [imotov@gmail.com](mailto:imotov@gmail.com) wrote:

> Vineeth,
> 
> It looks like a bug to me. So, I think it might be a good idea to track it  
> as an issue.
> 
> Igor
> 
> On Sunday, April 29, 2012 11:07:13 AM UTC-4, Vineeth Mohan wrote:
> 
> > @Shay , @Igor - Should i open a issue for this ?
> > 
> > Thanks  
> > Vineeth
> > 
> > On Sun, Apr 29, 2012 at 7:12 AM, Vineeth Mohan \<[vineethmohan@algotree.com](mailto:vineethmohan@algotree.com)
> > 
> > > wrote:
> > 
> > > The version i am using is .19.2
> > > 
> > > Thanks  
> > > Vineeth
> > > 
> > > On Sat, Apr 28, 2012 at 9:47 PM, Igor Motov [imotov@gmail.com](mailto:imotov@gmail.com) wrote:
> > > 
> > > > The script that Vineeth provided works fine in 0.18.5 and lower but  
> > > > breaks in 0.18.6 and higher.
> > > > 
> > > > On Saturday, April 28, 2012 1:47:06 AM UTC-4, Vineeth Mohan wrote:
> > > > 
> > > > > Here you go - [https://gist.github.com/\*\*251636\*\*1](https://gist.github.com/ **251636** 1)[https://gist.github.com/2516361](https://gist.github.com/2516361)
> > > > > 
> > > > > Thanks  
> > > > > Vineeth
> > > > > 
> > > > > On Fri, Apr 27, 2012 at 2:22 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> > > > > 
> > > > > > Can you gist a full recreation (index sample data, and show the  
> > > > > > behavior)? Also, which version are you using?
> > > > > > 
> > > > > > On Tue, Apr 24, 2012 at 8:47 PM, Vineeth Mohan \<  
> > > > > > [vineethmohan@algotree.com](mailto:vineethmohan@algotree.com)\> wrote:
> > > > > > 
> > > > > > > Slight correction , the contradictory behavior comes only when type  
> > > > > > > is mentioned and not mentioned.
> > > > > > > 
> > > > > > > Thanks  
> > > > > > > Vineeth
> > > > > > > 
> > > > > > > On Tue, Apr 24, 2012 at 11:15 PM, Vineeth Mohan \<  
> > > > > > > [vineethmohan@algotree.com](mailto:vineethmohan@algotree.com)\> wrote:
> > > > > > > 
> > > > > > > > Hi ,
> > > > > > > > 
> > > > > > > > When i DONT give the index name and type in the URL , highlighting  
> > > > > > > > is coming in result.  
> > > > > > > > And when i give the index name and type in URL , highlighting is  
> > > > > > > > NOT working.
> > > > > > > > 
> > > > > > > > GIST of the query used - [https://gist.github.com/\*\*248192\*\*5](https://gist.github.com/ **248192** 5)[https://gist.github.com/2481925](https://gist.github.com/2481925)
> > > > > > > > 
> > > > > > > > Thanks ,  
> > > > > > > > Vineeth

---

<div class="post-metadata">

**Author:** ![vineeth\_mohan](https://avatars.discourse-cdn.com/v4/letter/v/bc79bd/32.png) [@vineeth\_mohan](https://discuss.elastic.co/u/vineeth_mohan)\
**Post date:** [April 29, 2012, 3:22pm UTC](https://discuss.elastic.co/t/strange-highlighting-issue-with-custom-score/7456/10 "2012-04-29T15:22:08Z")

</div>

Here you go - [Strange highlighting issue with custom\_score · Issue #1895 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/1895)

Thanks  
Vineeth

On Sun, Apr 29, 2012 at 8:46 PM, Igor Motov [imotov@gmail.com](mailto:imotov@gmail.com) wrote:

> Vineeth,
> 
> It looks like a bug to me. So, I think it might be a good idea to track it  
> as an issue.
> 
> Igor
> 
> On Sunday, April 29, 2012 11:07:13 AM UTC-4, Vineeth Mohan wrote:
> 
> > @Shay , @Igor - Should i open a issue for this ?
> > 
> > Thanks  
> > Vineeth
> > 
> > On Sun, Apr 29, 2012 at 7:12 AM, Vineeth Mohan \<[vineethmohan@algotree.com](mailto:vineethmohan@algotree.com)
> > 
> > > wrote:
> > 
> > > The version i am using is .19.2
> > > 
> > > Thanks  
> > > Vineeth
> > > 
> > > On Sat, Apr 28, 2012 at 9:47 PM, Igor Motov [imotov@gmail.com](mailto:imotov@gmail.com) wrote:
> > > 
> > > > The script that Vineeth provided works fine in 0.18.5 and lower but  
> > > > breaks in 0.18.6 and higher.
> > > > 
> > > > On Saturday, April 28, 2012 1:47:06 AM UTC-4, Vineeth Mohan wrote:
> > > > 
> > > > > Here you go - [https://gist.github.com/\*\*251636\*\*1](https://gist.github.com/ **251636** 1)[https://gist.github.com/2516361](https://gist.github.com/2516361)
> > > > > 
> > > > > Thanks  
> > > > > Vineeth
> > > > > 
> > > > > On Fri, Apr 27, 2012 at 2:22 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> > > > > 
> > > > > > Can you gist a full recreation (index sample data, and show the  
> > > > > > behavior)? Also, which version are you using?
> > > > > > 
> > > > > > On Tue, Apr 24, 2012 at 8:47 PM, Vineeth Mohan \<  
> > > > > > [vineethmohan@algotree.com](mailto:vineethmohan@algotree.com)\> wrote:
> > > > > > 
> > > > > > > Slight correction , the contradictory behavior comes only when type  
> > > > > > > is mentioned and not mentioned.
> > > > > > > 
> > > > > > > Thanks  
> > > > > > > Vineeth
> > > > > > > 
> > > > > > > On Tue, Apr 24, 2012 at 11:15 PM, Vineeth Mohan \<  
> > > > > > > [vineethmohan@algotree.com](mailto:vineethmohan@algotree.com)\> wrote:
> > > > > > > 
> > > > > > > > Hi ,
> > > > > > > > 
> > > > > > > > When i DONT give the index name and type in the URL , highlighting  
> > > > > > > > is coming in result.  
> > > > > > > > And when i give the index name and type in URL , highlighting is  
> > > > > > > > NOT working.
> > > > > > > > 
> > > > > > > > GIST of the query used - [https://gist.github.com/\*\*248192\*\*5](https://gist.github.com/ **248192** 5)[https://gist.github.com/2481925](https://gist.github.com/2481925)
> > > > > > > > 
> > > > > > > > Thanks ,  
> > > > > > > > Vineeth

---

<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, 3:30am UTC](https://discuss.elastic.co/t/strange-highlighting-issue-with-custom-score/7456/11 "2017-07-06T03:30:43Z")

</div>


