# Highlight from inside more\_like\_this query

**URL:** <https://discuss.elastic.co/t/highlight-from-inside-more-like-this-query/10105>\
**Category:** Elasticsearch\
**Created:** [December 18, 2012, 8:51am UTC](https://discuss.elastic.co/t/highlight-from-inside-more-like-this-query/10105 "2012-12-18T08:51:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gil\_Fuchs](https://avatars.discourse-cdn.com/v4/letter/g/eb8c5e/32.png) [@Gil\_Fuchs](https://discuss.elastic.co/u/Gil_Fuchs)\
**Post date:** [December 18, 2012, 8:51am UTC](https://discuss.elastic.co/t/highlight-from-inside-more-like-this-query/10105/1 "2012-12-18T08:51:39Z")

</div>

I got highlight to work with query\_string type of query,  
but I don't seem to be able to do so with a more\_like\_this query  
is it possible to get highlights in an MLT search?

here is my JSON

{  
"query": {  
"more\_like\_this": {  
"like\_text": "Clinton nanotech",  
"min\_term\_freq": 1,  
"min\_doc\_freq": 1,  
"percent\_terms\_to\_match": 0.001  
}  
},  
"size": 20,  
"highlight": {  
"fields": {  
"nlp\_cf.content.NN": {},  
"nlp\_cf.content.NNP": {},  
"nlp\_cf.content.nps": {},  
"nlp\_cf.content.PER": {},  
"nlp\_cf.content.ORG": {},  
"nlp\_cf.content.MISC": {},  
"nlp\_cf.content.ORGANIZATION": {},  
"nlp\_cf.content.PERSON": {}  
}  
}  
}

thanks muchly  
-gil

--

---

<div class="post-metadata">

**Author:** ![Adrian2](https://avatars.discourse-cdn.com/v4/letter/a/ed655f/32.png) [@Adrian2](https://discuss.elastic.co/u/Adrian2)\
**Post date:** [September 9, 2013, 1:51pm UTC](https://discuss.elastic.co/t/highlight-from-inside-more-like-this-query/10105/2 "2013-09-09T13:51:15Z")

</div>

Hi, Have you solved this problem? Can you explain how you did it?

El martes, 18 de diciembre de 2012 05:51:39 UTC-3, Gil Fuchs escribió:

> I got highlight to work with query\_string type of query,  
> but I don't seem to be able to do so with a more\_like\_this query  
> is it possible to get highlights in an MLT search?
> 
> here is my JSON
> 
> {  
> "query": {  
> "more\_like\_this": {  
> "like\_text": "Clinton nanotech",  
> "min\_term\_freq": 1,  
> "min\_doc\_freq": 1,  
> "percent\_terms\_to\_match": 0.001  
> }  
> },  
> "size": 20,  
> "highlight": {  
> "fields": {  
> "nlp\_cf.content.NN": {},  
> "nlp\_cf.content.NNP": {},  
> "nlp\_cf.content.nps": {},  
> "nlp\_cf.content.PER": {},  
> "nlp\_cf.content.ORG": {},  
> "nlp\_cf.content.MISC": {},  
> "nlp\_cf.content.ORGANIZATION": {},  
> "nlp\_cf.content.PERSON": {}  
> }  
> }  
> }
> 
> thanks muchly  
> -gil

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Gil\_Fuchs](https://avatars.discourse-cdn.com/v4/letter/g/eb8c5e/32.png) [@Gil\_Fuchs](https://discuss.elastic.co/u/Gil_Fuchs)\
**Post date:** [September 10, 2013, 12:58pm UTC](https://discuss.elastic.co/t/highlight-from-inside-more-like-this-query/10105/3 "2013-09-10T12:58:05Z")

</div>

hi Adrian,  
sorry I never did get this to work... :{  
i had learnt to live without it...

-gil

* * *

From: Adrián Van Langenhove [adrianvanlan@gmail.com](mailto:adrianvanlan@gmail.com)  
To: [elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com)  
Sent: Monday, September 9, 2013 4:51 PM  
Subject: Re: highlight from inside more\_like\_this query

Hi, Have you solved this problem? Can you explain how you did it?

El martes, 18 de diciembre de 2012 05:51:39 UTC-3, Gil Fuchs escribió:  
I got highlight to work with query\_string type of query,

> but I don't seem to be able to do so with a more\_like\_this query  
> is it possible to get highlights in an MLT search?
> 
> here is my JSON
> 
> {  
> "query": {  
> "more\_like\_this": {  
> "like\_text": "Clinton nanotech",  
> "min\_term\_freq": 1,  
> "min\_doc\_freq": 1,  
> "percent\_terms\_to\_match": 0.001  
> }  
> },  
> "size": 20,  
> "highlight": {  
> "fields": {  
> "nlp\_cf.content.NN": {},  
> "nlp\_cf.content.NNP": {},  
> "nlp\_cf.content.nps": {},  
> "nlp\_cf.content.PER": {},  
> "nlp\_cf.content.ORG": {},  
> "nlp\_cf.content.MISC": {},  
> "nlp\_cf.content.ORGANIZATION": {},  
> "nlp\_cf.content.PERSON": {}  
> }  
> }
> 
> }
> 
> thanks muchly  
> -gil

--  
You received this message because you are subscribed to a topic in the Google Groups "elasticsearch" group.  
To unsubscribe from this topic, visit [https://groups.google.com/d/topic/elasticsearch/GSMFekOPz9Q/unsubscribe](https://groups.google.com/d/topic/elasticsearch/GSMFekOPz9Q/unsubscribe).  
To unsubscribe from this group and all its topics, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:17am UTC](https://discuss.elastic.co/t/highlight-from-inside-more-like-this-query/10105/4 "2017-07-06T02:17:19Z")

</div>


