# Unique data by referencing 2 fields

**URL:** <https://discuss.elastic.co/t/unique-data-by-referencing-2-fields/18987>\
**Category:** Elasticsearch\
**Created:** [July 30, 2014, 8:00pm UTC](https://discuss.elastic.co/t/unique-data-by-referencing-2-fields/18987 "2014-07-30T20:00:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cameron\_Barker](https://avatars.discourse-cdn.com/v4/letter/c/5f9b8f/32.png) [@Cameron\_Barker](https://discuss.elastic.co/u/Cameron_Barker)\
**Post date:** [July 30, 2014, 8:00pm UTC](https://discuss.elastic.co/t/unique-data-by-referencing-2-fields/18987/1 "2014-07-30T20:00:05Z")

</div>

Hi all,

Would it be possible to get unique items from an elastic search database  
that reference 2 fields for uniqueness, all while using only elastic search  
or a plug in?

_I.E._  
_Initial Data:_  
{  
provider: "tumblr"  
text: "I need to get this."  
}  
{  
provider: "twitter"  
text: "I need to get this."  
}  
{  
provider: "tumblr"  
text: "I need to get this."  
}

_Return:_  
{  
provider: "twitter"  
text: "I need to get this."  
}  
{  
provider: "tumblr"  
text: "I need to get this."  
}

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/e67f33df-643e-4840-a056-271b5db217ee%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e67f33df-643e-4840-a056-271b5db217ee%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:12am UTC](https://discuss.elastic.co/t/unique-data-by-referencing-2-fields/18987/2 "2017-07-06T01:12:08Z")

</div>


