# Total documents count in a certain engine

**URL:** <https://discuss.elastic.co/t/total-documents-count-in-a-certain-engine/222310>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [March 5, 2020, 2:19pm UTC](https://discuss.elastic.co/t/total-documents-count-in-a-certain-engine/222310 "2020-03-05T14:19:54Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![JyL](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jyl/32/53869_2.png) [@JyL](https://discuss.elastic.co/u/JyL)\
**Post date:** [March 5, 2020, 2:19pm UTC](https://discuss.elastic.co/t/total-documents-count-in-a-certain-engine/222310/1 "2020-03-05T14:19:54Z")

</div>

Hi, I am working on pushing data to app-search in a certain engine, i could see documents get created in the API Logs but the total number of the documents doesn't get increased.  
Is there a API that I could create a RESTful request to see the total number of documents? or what is the issue there?

Thanks,  
JL

---

<div class="post-metadata">

**Author:** ![JasonStoltz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonstoltz/32/49893_2.png) [@JasonStoltz](https://discuss.elastic.co/u/JasonStoltz)\
**Post date:** [March 5, 2020, 2:48pm UTC](https://discuss.elastic.co/t/total-documents-count-in-a-certain-engine/222310/2 "2020-03-05T14:48:31Z")

</div>

An empty search request will give you the total number of documents

```auto
GET /engines/{{engine_name}}/search

{
  "query": "",
  "page": {
  	"size": 0
  }
}

```

```auto
{
    "meta": {
        "alerts": [],
        "warnings": [],
        "page": {
            "current": 1,
            "total_pages": 1,
            "total_results": 9598,
            "size": 0
        },
        "request_id": "98a4004bf8670a1ee135c3a0cd98f4c9"
    },
    "results": []
}

```

See the `total_results` field.

---

<div class="post-metadata">

**Author:** ![JyL](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jyl/32/53869_2.png) [@JyL](https://discuss.elastic.co/u/JyL)\
**Post date:** [March 5, 2020, 8:35pm UTC](https://discuss.elastic.co/t/total-documents-count-in-a-certain-engine/222310/3 "2020-03-05T20:35:46Z")

</div>

> [@JasonStoltz](#):
>
> { "query": "", "page": { "size": 0 } }

thanks a lot Jason

---

<div class="post-metadata">

**Author:** ![JyL](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jyl/32/53869_2.png) [@JyL](https://discuss.elastic.co/u/JyL)\
**Post date:** [March 9, 2020, 6:17pm UTC](https://discuss.elastic.co/t/total-documents-count-in-a-certain-engine/222310/4 "2020-03-09T18:17:32Z")

</div>

thanks Jason.  
I have another question:  
when I did a request (post) to get the meta data which includes the total\_results, the number is different than what it showed in the UI. I got `"total_results":10000` while it shows `Total Documents` is 560 on the Engine Overview.

Another question I have is that I did push around 2w+ documents to the same engine, why it gives the `"total_results":10000` when I did the search request?

Thanks a lot,  
JL

---

<div class="post-metadata">

**Author:** ![JasonStoltz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonstoltz/32/49893_2.png) [@JasonStoltz](https://discuss.elastic.co/u/JasonStoltz)\
**Post date:** [March 10, 2020, 10:34am UTC](https://discuss.elastic.co/t/total-documents-count-in-a-certain-engine/222310/5 "2020-03-10T10:34:26Z")

</div>

What version of App Search are you using?

Can you confirm which number is correct? Do you have 560 documents in your engine, or 10000?

Jason

---

<div class="post-metadata">

**Author:** ![JyL](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jyl/32/53869_2.png) [@JyL](https://discuss.elastic.co/u/JyL)\
**Post date:** [March 10, 2020, 12:59pm UTC](https://discuss.elastic.co/t/total-documents-count-in-a-certain-engine/222310/6 "2020-03-10T12:59:36Z")

</div>

> [@JasonStoltz](#):
>
> which number is correct?

I used version 7.3.0, and yesterday I upgraded the app-search to 7.6.1. None of them works.

Both of the number is not correct. I pushed around 3w+ documents as the end of yesterday. The total number in the UI stuck with 560 and the search request always be 10000 (when the total number of documents that I posted to this engine less than 10000, this search request gave the correct number, while after the number got to 100000, it stuck with 10000 and did not increase anymore).

Thanks,  
JL

---

<div class="post-metadata">

**Author:** ![JasonStoltz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonstoltz/32/49893_2.png) [@JasonStoltz](https://discuss.elastic.co/u/JasonStoltz)\
**Post date:** [March 10, 2020, 3:01pm UTC](https://discuss.elastic.co/t/total-documents-count-in-a-certain-engine/222310/7 "2020-03-10T15:01:28Z")

</div>

Oh my bad, you're right, queries are limited to 10,000 results.

Has the UI been stuck at 560 only after upgrading?

---

<div class="post-metadata">

**Author:** ![JyL](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jyl/32/53869_2.png) [@JyL](https://discuss.elastic.co/u/JyL)\
**Post date:** [March 10, 2020, 3:04pm UTC](https://discuss.elastic.co/t/total-documents-count-in-a-certain-engine/222310/8 "2020-03-10T15:04:04Z")

</div>

Yeap, the UI never changed after it got to 560.

Is there a way that I could know the correct number of documents in an engine?

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![orhantoy](https://avatars.discourse-cdn.com/v4/letter/o/c5a1d2/32.png) [@orhantoy](https://discuss.elastic.co/u/orhantoy)\
**Post date:** [March 27, 2020, 2:33pm UTC](https://discuss.elastic.co/t/total-documents-count-in-a-certain-engine/222310/9 "2020-03-27T14:33:12Z")

</div>

Hi @JyL ✌ Could you try to index a new document, as that should trigger a background job that will update the count you see in the dashboard? Once the count hopefully updates, you can just delete that document again.

---

<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:** [April 24, 2020, 2:41pm UTC](https://discuss.elastic.co/t/total-documents-count-in-a-certain-engine/222310/10 "2020-04-24T14:41:26Z")

</div>

Closed on April 24, 2020, 2:41pm UTC

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