# How to find Similar documents

**URL:** https://discuss.elastic.co/t/how-to-find-similar-documents/45539
**Category:** Elasticsearch
**Created:** [March 27, 2016, 12:23pm UTC](https://discuss.elastic.co/t/how-to-find-similar-documents/45539 "2016-03-27T12:23:02Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![basharz](https://avatars.discourse-cdn.com/v4/letter/b/e99b99/32.png) [@basharz](https://discuss.elastic.co/u/basharz)
#### Post date: [March 27, 2016, 12:23pm UTC](https://discuss.elastic.co/t/how-to-find-similar-documents/45539/1 "2016-03-27T12:23:03Z")

</div>

Guys,  
let us say i have ElasticSearch index and it contains about 10,000 documents, i did random manual check on the field "building name" for few documents and found there are a lot of documents matching each others based on this field "building name" is there any way i can find all documents that are similar to each others using Elasticsearch capabilities

---

<div class="post-metadata">

### Author: ![Glen\_Smith](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/glen_smith/32/111656_2.png) [@Glen\_Smith](https://discuss.elastic.co/u/Glen_Smith)
#### Post date: [March 27, 2016, 3:06pm UTC](https://discuss.elastic.co/t/how-to-find-similar-documents/45539/2 "2016-03-27T15:06:37Z")

</div>

[https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-mlt-query.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-mlt-query.html)

---

<div class="post-metadata">

### Author: ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)
#### Post date: [March 27, 2016, 5:02pm UTC](https://discuss.elastic.co/t/how-to-find-similar-documents/45539/3 "2016-03-27T17:02:11Z")

</div>

Look at "more like this".

---

<div class="post-metadata">

### Author: ![basharz](https://avatars.discourse-cdn.com/v4/letter/b/e99b99/32.png) [@basharz](https://discuss.elastic.co/u/basharz)
#### Post date: [March 28, 2016, 2:13pm UTC](https://discuss.elastic.co/t/how-to-find-similar-documents/45539/4 "2016-03-28T14:13:14Z")

</div>

thanks guys for your feedback, actually our challenge is that we do not have a specific text that we want to compare it ith all documents, each set of documents could be matching each others based on specific text, if we will use the sample below queries we need to identify the text for the search which is not the case.  
or if there is no solution we will do a development API work to go through all documents and apply the below queries and then group the documents as per the scoring results.  
this is the sample MLT query  
{  
"query": {  
"more\_like\_this": {  
"fields": [  
"building"  
],  
"like\_text": "my text will be here",  
"min\_term\_freq": 1,  
"max\_query\_terms": 25  
}  
}  
}

This is sample phonetic-matching query

{  
"query": {  
"match": {  
"building.phonetic": {  
"query": "my text will be here",  
"operator": "or"  
}  
}  
}

---

<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 5, 2017, 11:04pm UTC](https://discuss.elastic.co/t/how-to-find-similar-documents/45539/5 "2017-07-05T23:04:41Z")

</div>


