# Keeping referance of a doc in another doc

**URL:** <https://discuss.elastic.co/t/keeping-referance-of-a-doc-in-another-doc/139665>\
**Category:** Elasticsearch\
**Created:** [July 12, 2018, 4:20am UTC](https://discuss.elastic.co/t/keeping-referance-of-a-doc-in-another-doc/139665 "2018-07-12T04:20:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vadiraj\_bidarahalli](https://avatars.discourse-cdn.com/v4/letter/v/7ea924/32.png) [@vadiraj\_bidarahalli](https://discuss.elastic.co/u/vadiraj_bidarahalli)\
**Post date:** [July 12, 2018, 4:20am UTC](https://discuss.elastic.co/t/keeping-referance-of-a-doc-in-another-doc/139665/1 "2018-07-12T04:20:57Z")

</div>

I have a list of candidates which belong to a _listId_ which are present in _emailListItems_ document type.  
we can add any of these candidates for reference check processing from the ui. when he is added I am creating another document in a type called _referenceCheck_ with _listId_, and \__id_ of _emailListItems_ doc and other basic info like _firstname_, _lastName_, _emailAddress_ duplicated in target document.

Now, when user goes to **ReferenceCheck** view , all documents from _referenceCheck_ doc type are displayed. I want to bring along the associated _emailListItems_ docs also, so that user can see any additional information of the candidate. How can i bring along docs of both document types in a single query?

Is this a good design from elasticsearch point of view? i mean keeping info belonging to same candidates in two different doc types... For some reasons, I cannot keep the _referenceCheck_ info in _emailListItems_

How pagination can be achieved if there are thousands of candidates. Using _size_, _from_ ?

---

<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:** [August 9, 2018, 4:20am UTC](https://discuss.elastic.co/t/keeping-referance-of-a-doc-in-another-doc/139665/2 "2018-08-09T04:20:58Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
