# Search duplicated docs of a given entry

**URL:** <https://discuss.elastic.co/t/search-duplicated-docs-of-a-given-entry/61748>\
**Category:** Elasticsearch\
**Created:** [September 28, 2016, 10:02pm UTC](https://discuss.elastic.co/t/search-duplicated-docs-of-a-given-entry/61748 "2016-09-28T22:02:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AidHamza](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aidhamza/32/12209_2.png) [@AidHamza](https://discuss.elastic.co/u/AidHamza)\
**Post date:** [September 28, 2016, 10:02pm UTC](https://discuss.elastic.co/t/search-duplicated-docs-of-a-given-entry/61748/1 "2016-09-28T22:02:26Z")

</div>

Hey guys,  
I'm trying to create a microservice for our website in order to prevent duplicated entries from our users, if the user add a property; then the moderator can check if it matches a duplicated / very similar one from Elastic

The query will contain "title", "body" to check if any property has similar fields about \>70% similarity, and I pass also user\_id and phone number to filter only the user previous properties

Given my limited knowledge with full-text search engine, this is the query wrote after digging in the web, if it suitable for my need ?

```auto
{
  "query": {
      "filtered": {
          "query": {
              "bool": {
                  "must": [
                      {
    			        "dis_max": {
				           "queries": [
				               {
				                "more_like_this" : {
				                    "fields" : ["subject"],
				                    "like_text" : "Apartment located in Casablanca, 59m",
				                    "min_term_freq" : 1,
				                    "max_query_terms" : 1,
				                    "boost": 20                                    
    			                }
				               },
				               {
				                "more_like_this" : {
				                    "fields" : ["body"],
				                    "like_text" : "I want to sell an apartment etc ..... ",
				                    "min_term_freq" : 1,
				                    "max_query_terms" : 1,
				                    "boost": 20
                            }
				               }
				            ]
				        }
                      },
                        {
                           "match": {
                              "phone": "0652808029"
                           }
                        }
                  ]
              }
          }
      }
  }
  
}

```

Thanks

---

<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, 10:16pm UTC](https://discuss.elastic.co/t/search-duplicated-docs-of-a-given-entry/61748/2 "2017-07-05T22:16:28Z")

</div>


