# How to index/search data in very-large subset of documents?

**URL:** <https://discuss.elastic.co/t/how-to-index-search-data-in-very-large-subset-of-documents/2546>\
**Category:** Elasticsearch\
**Created:** [June 12, 2015, 8:16am UTC](https://discuss.elastic.co/t/how-to-index-search-data-in-very-large-subset-of-documents/2546 "2015-06-12T08:16:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sangupta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sangupta/32/641_2.png) [@sangupta](https://discuss.elastic.co/u/sangupta)\
**Post date:** [June 12, 2015, 8:16am UTC](https://discuss.elastic.co/t/how-to-index-search-data-in-very-large-subset-of-documents/2546/1 "2015-06-12T08:16:19Z")

</div>

Hi - this might be a newbie question but I could not find a related answer in my search.

The use-case contains a lot of documents (100 million+) each tagged with a unique case number. The number of case numbers are currently 100 thousand or so. Thus, each case number can have 1000+ documents easily.

We want to do a search within a group of case numbers for a given agent - say at the max say 2000 case numbers.

How do we model this:

1. Should we fire an IN query in case numbers during Search.

2. Or, should we have one document for a case number - and update the same search-document when a new user-document is added against that case number.

Thanks in advance.

---

<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:07am UTC](https://discuss.elastic.co/t/how-to-index-search-data-in-very-large-subset-of-documents/2546/2 "2017-07-06T00:07:56Z")

</div>


