# Search response accuracy

**URL:** <https://discuss.elastic.co/t/search-response-accuracy/192309>\
**Category:** Elasticsearch\
**Created:** [July 25, 2019, 7:31pm UTC](https://discuss.elastic.co/t/search-response-accuracy/192309 "2019-07-25T19:31:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Castillo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_castillo/32/46548_2.png) [@David\_Castillo](https://discuss.elastic.co/u/David_Castillo)\
**Post date:** [July 25, 2019, 7:31pm UTC](https://discuss.elastic.co/t/search-response-accuracy/192309/1 "2019-07-25T19:31:15Z")

</div>

Warning this is probably not a good use case for Elasticsearch but...

I have an index which will containing millions of documents. We have built a real-time API which  
allows customers search and return less than 1000 documents and a second API which will call a batch search API where customers will submit a search asynchronously and an app will search the index and when complete stream the resultss back to the consumer - our index and apps are deployed in AWS and the consumers are on prem. Consumers on the batch search may expect up to 2 million documents returned

I've tested the batch search API and is accurate at ~100K documents; however I have also searched using a criteria that should have return 1.6 million documents and missed returning a few hundred documents.

1. How accurate should I expect the Elasticsearch response to be and 2) is there any method I can use to increase the accuracy of the response?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![William\_Brafford](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/william_brafford/32/51559_2.png) [@William\_Brafford](https://discuss.elastic.co/u/William_Brafford)\
**Post date:** [August 2, 2019, 10:02pm UTC](https://discuss.elastic.co/t/search-response-accuracy/192309/2 "2019-08-02T22:02:14Z")

</div>

Hi, David. Welcome to the forums!

A few questions:

1.) Which version of Elasticsearch are you using?  
2.) How are you retrieving documents? Are you using the [Elasticsearch `scroll` API](https://www.elastic.co/guide/en/elasticsearch/reference/7.3/search-request-body.html#request-body-search-scroll)?

In Elasticsearch, the `scroll` API is the intended method for retrieving all documents matching a particular search. From the documents:

> While a `search` request returns a single “page” of results, the `scroll` API can be used to retrieve large numbers of results (or even all results) from a single search request, in much the same way as you would use a cursor on a traditional database.

---

<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 30, 2019, 10:02pm UTC](https://discuss.elastic.co/t/search-response-accuracy/192309/3 "2019-08-30T22:02:16Z")

</div>

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