# MoreLikeThis and array field

**URL:** <https://discuss.elastic.co/t/morelikethis-and-array-field/11705>\
**Category:** Elasticsearch\
**Created:** [April 26, 2013, 3:23pm UTC](https://discuss.elastic.co/t/morelikethis-and-array-field/11705 "2013-04-26T15:23:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ghoumard](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ghoumard/32/44886_2.png) [@ghoumard](https://discuss.elastic.co/u/ghoumard)\
**Post date:** [April 26, 2013, 3:23pm UTC](https://discuss.elastic.co/t/morelikethis-and-array-field/11705/1 "2013-04-26T15:23:55Z")

</div>

Hi,

We have a document like this in ES:  
{ "ID":"1111", "Text":"This my text",  
"Concept":["concept1","concept2","concept3"] }

We are trying to detect duplicate based on the field "concept", with a  
pattern like: if at least 85% of concept are the same, then it's a  
duplicate.

But when using the following query, results are not good;

$ curl -XGET '  
[http://localhost:9200/twitter/tweet/1/\_mlt?mlt\_fields=concept&min\_doc\_freq=1](http://localhost:9200/twitter/tweet/1/_mlt?mlt_fields=concept&min_doc_freq=1)'  
We had to change the json format for the MLT to work like expected. (string  
instead of array)  
{ "ID":"1111", "Text":"This my text", "Concept":"concept1 concept2  
concept3" }

Are we missing something ? Is this a bug or a design limitation ?

Thanks,

Gildas

--  
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:** ![ghoumard](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ghoumard/32/44886_2.png) [@ghoumard](https://discuss.elastic.co/u/ghoumard)\
**Post date:** [April 29, 2013, 12:57pm UTC](https://discuss.elastic.co/t/morelikethis-and-array-field/11705/2 "2013-04-29T12:57:54Z")

</div>

Up,

We really like the fact of storing array and not string.  
Any idea someone ?

Gildas

On Friday, April 26, 2013 11:23:55 AM UTC-4, Gildas Houmard wrote:

> Hi,
> 
> We have a document like this in ES:  
> { "ID":"1111", "Text":"This my text",  
> "Concept":["concept1","concept2","concept3"] }
> 
> We are trying to detect duplicate based on the field "concept", with a  
> pattern like: if at least 85% of concept are the same, then it's a  
> duplicate.
> 
> But when using the following query, results are not good;
> 
> $ curl -XGET '  
> [http://localhost:9200/twitter/tweet/1/\_mlt?mlt\_fields=concept&min\_doc\_freq=1](http://localhost:9200/twitter/tweet/1/_mlt?mlt_fields=concept&min_doc_freq=1)'  
> We had to change the json format for the MLT to work like expected.  
> (string instead of array)  
> { "ID":"1111", "Text":"This my text", "Concept":"concept1 concept2  
> concept3" }
> 
> Are we missing something ? Is this a bug or a design limitation ?
> 
> Thanks,
> 
> Gildas

--  
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:** ![James\_Harrison](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/james_harrison/32/2368_2.png) [@James\_Harrison](https://discuss.elastic.co/u/James_Harrison)\
**Post date:** [April 29, 2013, 1:07pm UTC](https://discuss.elastic.co/t/morelikethis-and-array-field/11705/3 "2013-04-29T13:07:36Z")

</div>

On 29/04/13 13:57, Gildas Houmard wrote:

> Up,
> 
> We really like the fact of storing array and not string.  
> Any idea someone ?

What's your mapping look like? I've seen this happen when the field type  
is inferred. I had to manually set the mapping of that type to be an  
array type, and then all was well.

--  
Cheers,  
James Harrison

--  
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:39am UTC](https://discuss.elastic.co/t/morelikethis-and-array-field/11705/4 "2017-07-06T02:39:14Z")

</div>

Closed on July 6, 2017, 2:39am UTC


