# How to increase the totalresults count? currently it is capped to 10000

**URL:** <https://discuss.elastic.co/t/how-to-increase-the-totalresults-count-currently-it-is-capped-to-10000/289624>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [November 18, 2021, 4:43pm UTC](https://discuss.elastic.co/t/how-to-increase-the-totalresults-count-currently-it-is-capped-to-10000/289624 "2021-11-18T16:43:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mecadamia.nut](https://avatars.discourse-cdn.com/v4/letter/m/e79b87/32.png) [@Mecadamia.nut](https://discuss.elastic.co/u/Mecadamia.nut)\
**Post date:** [November 18, 2021, 4:43pm UTC](https://discuss.elastic.co/t/how-to-increase-the-totalresults-count-currently-it-is-capped-to-10000/289624/1 "2021-11-18T16:43:18Z")

</div>

We have around 35k records ingested in the appsearch engine. when we do the default search without any searchTerm it gives 10000 as the totalResults count instead of 35000 even though the user may not scroll through all the 35k records. does the AppSearch actually searches the full 35k docs or will it only searches the 10k documents as it says 10k results only.

---

<div class="post-metadata">

**Author:** ![jgr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jgr/32/97041_2.png) [@jgr](https://discuss.elastic.co/u/jgr)\
**Post date:** [November 18, 2021, 11:51pm UTC](https://discuss.elastic.co/t/how-to-increase-the-totalresults-count-currently-it-is-capped-to-10000/289624/2 "2021-11-18T23:51:46Z")

</div>

Hi Mecadamia.nut,

> [@Mecadamia.nut](#):
>
> ...does the AppSearch actually searches the full 35k docs...

App Search does search over all the documents in your engine, it just [limits the size of the documents returned](https://www.elastic.co/guide/en/app-search/current/limits.html#plan-api-limitations-query-limits) as a query result to 10,000.

---

<div class="post-metadata">

**Author:** ![Mecadamia.nut](https://avatars.discourse-cdn.com/v4/letter/m/e79b87/32.png) [@Mecadamia.nut](https://discuss.elastic.co/u/Mecadamia.nut)\
**Post date:** [November 22, 2021, 10:07am UTC](https://discuss.elastic.co/t/how-to-increase-the-totalresults-count-currently-it-is-capped-to-10000/289624/3 "2021-11-22T10:07:07Z")

</div>

Thanks James. Is there a way to show the full number rather than showing 10000?

---

<div class="post-metadata">

**Author:** ![Carlos\_D](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carlos_d/32/126245_2.png) [@Carlos\_D](https://discuss.elastic.co/u/Carlos_D)\
**Post date:** [November 22, 2021, 12:08pm UTC](https://discuss.elastic.co/t/how-to-increase-the-totalresults-count-currently-it-is-capped-to-10000/289624/4 "2021-11-22T12:08:59Z")

</div>

Hi @Mecadamia.nut !

When there are more than 10,000 matches, the number of results will be fixed to 10,000. You can use that information in your UI (displaying "10,000+" for example).

In case you need to exactly count the number of results beyond 10,000, you can use facets. Check [display the total number of search results](https://www.elastic.co/guide/en/app-search/current/search-guide.html#search-guide-display-total) in the Search Guide for guidance on how to achieve an exact count of results.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![Mecadamia.nut](https://avatars.discourse-cdn.com/v4/letter/m/e79b87/32.png) [@Mecadamia.nut](https://discuss.elastic.co/u/Mecadamia.nut)\
**Post date:** [November 22, 2021, 6:36pm UTC](https://discuss.elastic.co/t/how-to-increase-the-totalresults-count-currently-it-is-capped-to-10000/289624/5 "2021-11-22T18:36:00Z")

</div>

Thanks Carolos. I am able to add the facet count for each of them and then show the result count now.

```auto
  function getTotalResultsCount(mainfilter, filters, totalcount) {
    if (totalcount && totalcount < 10000 && filters.length != 0)
      return totalcount;
    let totalCount = 0;
    mainfilter.map(s => {
      var data = s.data;
      data.forEach(element => {
        if (filters.length === 0)
          totalCount += element.count;
        else
          filters.map(f => {
            if (f.values.indexOf(element.value) != -1)
              totalCount += element.count;
          })
      })
    });
    return totalCount;
  }

...
                              {wasSearched && <><PagingInfo
                                mapContextToProps={context => {
                                  if (!context.facets.mainfilter) return context;
                                  return {
                                    ...context,
                                    totalResults: getTotalResultsCount(context.facets.mainfilter, context.filters, context.totalResults),
                                  };
                                }}
                                view={({ start, end, totalResults, searchTerm }) => (
                                  <div className="paging-info">
                                    <span>Showing <strong>{start}</strong> - <strong>{end}</strong> out of <strong>
                                      {totalResults} </strong>{searchTerm && searchTerm.length > 0 && <span>for:</span>}<i>{searchTerm}</i>
                                      <Paging className="classPaging" /></span>

                                  </div>
                                )}
                              /> </>}

```

---

<div class="post-metadata">

**Author:** ![Carlos\_D](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carlos_d/32/126245_2.png) [@Carlos\_D](https://discuss.elastic.co/u/Carlos_D)\
**Post date:** [November 22, 2021, 7:07pm UTC](https://discuss.elastic.co/t/how-to-increase-the-totalresults-count-currently-it-is-capped-to-10000/289624/6 "2021-11-22T19:07:54Z")

</div>

Nice! Thanks for sharing your solution!

---

<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:** [December 20, 2021, 7:08pm UTC](https://discuss.elastic.co/t/how-to-increase-the-totalresults-count-currently-it-is-capped-to-10000/289624/7 "2021-12-20T19:08:02Z")

</div>

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