# Recursive/Related Searching

**URL:** <https://discuss.elastic.co/t/recursive-related-searching/45999>\
**Category:** Elasticsearch\
**Created:** [March 31, 2016, 9:59pm UTC](https://discuss.elastic.co/t/recursive-related-searching/45999 "2016-03-31T21:59:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jtryon](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@jtryon](https://discuss.elastic.co/u/jtryon)\
**Post date:** [March 31, 2016, 9:59pm UTC](https://discuss.elastic.co/t/recursive-related-searching/45999/1 "2016-03-31T21:59:25Z")

</div>

One of the functions of my Elasticsearch server is searching mail log files. I'm curious if it's possible to build a query which returns related queue IDs which don't necessarily include the original query term.

IE... Searching for "[person@place.com](mailto:person@place.com)" returns:

> 8DEB013F764: to=[person@place.com](mailto:person@place.com), relay=blah, delay=0.47, delays=0.13/0/0.23/0.1, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as F2DBE12D4F8\_6FD99CDF)

I'd like a query able to search for "[person@place.com](mailto:person@place.com)" and then return all results with their queuid term matching "8DEB013F764":

> 8DEB013F764: removed  
> 8DEB013F764: to=[person@place.com](mailto:person@place.com), relay=somewhere:25, delay=0.47, delays=0.13/0/0.23/0.1, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as F2DBE12D4F8\_6FD99CDF)  
> 8DEB013F764: client=someplace  
> 8DEB013F764: message-id=  
> 8DEB013F764: from=, size=66409, nrcpt=1 (queue active)

All of the individual fields are already grok't into their own terms. Any advice on making the query work is much appreciated. : )

---

<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:03pm UTC](https://discuss.elastic.co/t/recursive-related-searching/45999/2 "2017-07-05T23:03:28Z")

</div>


