# Find all documents where the value of fieldA is the same as the value of fieldB

**URL:** <https://discuss.elastic.co/t/find-all-documents-where-the-value-of-fielda-is-the-same-as-the-value-of-fieldb/20294>\
**Category:** Elasticsearch\
**Created:** [October 16, 2014, 6:02pm UTC](https://discuss.elastic.co/t/find-all-documents-where-the-value-of-fielda-is-the-same-as-the-value-of-fieldb/20294 "2014-10-16T18:02:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bobby\_Pilot](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bobby_pilot/32/1186_2.png) [@Bobby\_Pilot](https://discuss.elastic.co/u/Bobby_Pilot)\
**Post date:** [October 16, 2014, 6:02pm UTC](https://discuss.elastic.co/t/find-all-documents-where-the-value-of-fielda-is-the-same-as-the-value-of-fieldb/20294/1 "2014-10-16T18:02:11Z")

</div>

The document looks something like the following:

{  
"username": "bobtest",  
"displayName": "Bob Test",  
"fullName": "Bob Test"  
}

My example use case is find out how many customers use their full name as  
their display name. In other words, how do I do an inner join I guess? I  
want to find all documents where displayName == fullName. I don't see an  
filters or aggs that accomplish this.

Possible?

Thanks!

--  
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/0fcbbdec-fb4b-4ce5-8ee7-293d487c0306%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0fcbbdec-fb4b-4ce5-8ee7-293d487c0306%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, 12:55am UTC](https://discuss.elastic.co/t/find-all-documents-where-the-value-of-fielda-is-the-same-as-the-value-of-fieldb/20294/2 "2017-07-06T00:55:41Z")

</div>

Closed on July 6, 2017, 12:55am UTC


