# Finding one document of every similar documents group

**URL:** <https://discuss.elastic.co/t/finding-one-document-of-every-similar-documents-group/11721>\
**Category:** Elasticsearch\
**Created:** [April 28, 2013, 12:43pm UTC](https://discuss.elastic.co/t/finding-one-document-of-every-similar-documents-group/11721 "2013-04-28T12:43:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Muhammad\_Adel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/muhammad_adel/32/1866_2.png) [@Muhammad\_Adel](https://discuss.elastic.co/u/Muhammad_Adel)\
**Post date:** [April 28, 2013, 12:43pm UTC](https://discuss.elastic.co/t/finding-one-document-of-every-similar-documents-group/11721/1 "2013-04-28T12:43:58Z")

</div>

I have an elasticsearch index with many documents. Every group of these  
documents contain similar content but not exactly the same.

What is the query that would return only one document of every similar  
documents group?

--  
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:** ![Itamar\_Syn\_Hershko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itamar_syn_hershko/32/725_2.png) [@Itamar\_Syn\_Hershko](https://discuss.elastic.co/u/Itamar_Syn_Hershko)\
**Post date:** [April 28, 2013, 12:57pm UTC](https://discuss.elastic.co/t/finding-one-document-of-every-similar-documents-group/11721/2 "2013-04-28T12:57:36Z")

</div>

How do you define similar? this could be done either by splitting those  
groups to different types, or by using MoreLikeThis

On Sun, Apr 28, 2013 at 3:43 PM, Muhammad Adel [devadel@gmail.com](mailto:devadel@gmail.com) wrote:

> I have an elasticsearch index with many documents. Every group of these  
> documents contain similar content but not exactly the same.
> 
> What is the query that would return only one document of every similar  
> documents group?
> 
> --  
> 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).

--  
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:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 28, 2013, 1:00pm UTC](https://discuss.elastic.co/t/finding-one-document-of-every-similar-documents-group/11721/3 "2013-04-28T13:00:34Z")

</div>

IMHO, I won't index similar documents or I will filter them on the Client side.

To filter on client side, you will have probably to first add to doc a "hashcode" that is set to same value on each similar docs before indexing.

My 2 cents

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 28 avr. 2013 à 14:43, Muhammad Adel [devadel@gmail.com](mailto:devadel@gmail.com) a écrit :

> I have an elasticsearch index with many documents. Every group of these documents contain similar content but not exactly the same.
> 
> ## What is the query that would return only one document of every similar documents group?
> 
> 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).

--  
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/finding-one-document-of-every-similar-documents-group/11721/4 "2017-07-06T02:39:20Z")

</div>


