# How to get results over 10K in App search

**URL:** https://discuss.elastic.co/t/how-to-get-results-over-10k-in-app-search/351310
**Category:** Elastic Search
**Tags:** elastic-app-search
**Created:** [January 17, 2024, 9:42pm UTC](https://discuss.elastic.co/t/how-to-get-results-over-10k-in-app-search/351310 "2024-01-17T21:42:07Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![pradeepjanga](https://avatars.discourse-cdn.com/v4/letter/p/9e8a1a/32.png) [@pradeepjanga](https://discuss.elastic.co/u/pradeepjanga)
#### Post date: [January 17, 2024, 9:42pm UTC](https://discuss.elastic.co/t/how-to-get-results-over-10k-in-app-search/351310/1 "2024-01-17T21:42:07Z")

</div>

HI,

We have 27K documents ingested into our engine. and we are trying to do a rest api call to gather the distinct field value across all the documents and that would be 27k id. how can gather those array of id's as a response. Currently i can get only 10k results and how to get the other 17K ids.

when i use current 11 and size 1000 it returns empty results. how can this achieved in App search.

```auto
{
    "query": "",
    "facets": {
        "u_number": [
            {
                "type": "value",
                "name": "u_number",
                "sort": {
                    "count": "desc"
                },
                "size": 1000
            }
        ]
    },
    "page": {
        "size": 1000,
        "current": 10
    },
    "result_fields": {
        "id": {
            "raw": {}
        }
    }
}

```

Thanks  
Pradeep

---

<div class="post-metadata">

### Author: ![Kathleen\_DeRusso](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kathleen_derusso/32/132039_2.png) [@Kathleen\_DeRusso](https://discuss.elastic.co/u/Kathleen_DeRusso)
#### Post date: [January 17, 2024, 9:57pm UTC](https://discuss.elastic.co/t/how-to-get-results-over-10k-in-app-search/351310/2 "2024-01-17T21:57:31Z")

</div>

Hi @pradeepjanga thanks for your question.

Unfortunately 10,000 is a [hard limit](https://www.elastic.co/guide/en/app-search/8.12/limits.html) in App Search.

You may be able to get what you want using the [Elasticsearch API](https://www.elastic.co/guide/en/app-search/8.12/elasticsearch-search-api-reference.html). Note that by default you'll still run into a max result window of 10,000 but this can be [configured](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#dynamic-index-settings) in Elasticsearch using `index.max_result_window`. As noted in the documentation, scroll may be more efficient to get large document sets.

---

<div class="post-metadata">

### Author: ![pradeepjanga](https://avatars.discourse-cdn.com/v4/letter/p/9e8a1a/32.png) [@pradeepjanga](https://discuss.elastic.co/u/pradeepjanga)
#### Post date: [January 17, 2024, 10:54pm UTC](https://discuss.elastic.co/t/how-to-get-results-over-10k-in-app-search/351310/3 "2024-01-17T22:54:23Z")

</div>

@Kathleen_DeRusso But if i want to compare the data between 2 engines to see if a specific fields exist in one engine and not in other engine, i need to view the total documents right ?. Are you telling there is no way i can view the whole documents in the engine via Rest Api call. In my scenario, i just want to view for some analytics purpose. so performance doesn't matter to me.

---

<div class="post-metadata">

### Author: ![pradeepjanga](https://avatars.discourse-cdn.com/v4/letter/p/9e8a1a/32.png) [@pradeepjanga](https://discuss.elastic.co/u/pradeepjanga)
#### Post date: [January 17, 2024, 11:14pm UTC](https://discuss.elastic.co/t/how-to-get-results-over-10k-in-app-search/351310/4 "2024-01-17T23:14:23Z")

</div>

All i want to see array of values in the field u\_number in whole engine ?. is that possible ?

```auto
 "facets": {
    "u_number": [
      {
        "type": "value",
        "name": "u_number",
        "sort": { "count": "desc" }
      }
    ]
  },

```

---

<div class="post-metadata">

### Author: ![Kathleen\_DeRusso](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kathleen_derusso/32/132039_2.png) [@Kathleen\_DeRusso](https://discuss.elastic.co/u/Kathleen_DeRusso)
#### Post date: [January 18, 2024, 10:08pm UTC](https://discuss.elastic.co/t/how-to-get-results-over-10k-in-app-search/351310/5 "2024-01-18T22:08:25Z")

</div>

You can't do that without performing multiple API calls and evaluating the responses.

---

<div class="post-metadata">

### Author: ![pradeepjanga](https://avatars.discourse-cdn.com/v4/letter/p/9e8a1a/32.png) [@pradeepjanga](https://discuss.elastic.co/u/pradeepjanga)
#### Post date: [January 18, 2024, 10:22pm UTC](https://discuss.elastic.co/t/how-to-get-results-over-10k-in-app-search/351310/6 "2024-01-18T22:22:12Z")

</div>

I tried multiple search but still how can we tell to not to search in already searched results.

Could you provide an example where i can get all the results to display ids in the whole engine ?

```auto
{"queries": [
    {
        "query": "",
        "page": {
            "size": 1000,
            "current": 10
        },
        "result_fields": {
            "id": {
                "raw": {}
            }
        }
    },
    {
        "query": "",
        "page": {
            "size": 1000,
            "current": 10
        },
        "result_fields": {
            "id": {
                "raw": {}
            }
        }
    }
]
}

```

---

<div class="post-metadata">

### Author: ![pradeepjanga](https://avatars.discourse-cdn.com/v4/letter/p/9e8a1a/32.png) [@pradeepjanga](https://discuss.elastic.co/u/pradeepjanga)
#### Post date: [January 18, 2024, 10:22pm UTC](https://discuss.elastic.co/t/how-to-get-results-over-10k-in-app-search/351310/7 "2024-01-18T22:22:54Z")

</div>

The above query still return in only first 10k. doesn;t return over 10k

---

<div class="post-metadata">

### Author: ![pradeepjanga](https://avatars.discourse-cdn.com/v4/letter/p/9e8a1a/32.png) [@pradeepjanga](https://discuss.elastic.co/u/pradeepjanga)
#### Post date: [January 19, 2024, 4:54pm UTC](https://discuss.elastic.co/t/how-to-get-results-over-10k-in-app-search/351310/8 "2024-01-19T16:54:33Z")

</div>

@Kathleen_DeRusso  
is there any other way. please let me know. This is to compare something out of the code. we are trying to make some Rest API calls so there is no need for me to worry about performance.

---

<div class="post-metadata">

### Author: ![Kathleen\_DeRusso](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kathleen_derusso/32/132039_2.png) [@Kathleen\_DeRusso](https://discuss.elastic.co/u/Kathleen_DeRusso)
#### Post date: [January 22, 2024, 1:15pm UTC](https://discuss.elastic.co/t/how-to-get-results-over-10k-in-app-search/351310/9 "2024-01-22T13:15:50Z")

</div>

The only way you can do this is to:

1. Increase your `index.max_result_window` value to a value above the 27K documents you are looking for
2. Get the [raw Elasticsearch query](https://www.elastic.co/guide/en/app-search/8.12/search-explain.html) that app search generates via the `explain` API
3. Run the Elasticsearch query with an updated from/size using the [Elasticsearch search API](https://www.elastic.co/guide/en/app-search/8.12/elasticsearch-search-api-reference.html).

This is not a use case that App Search was optimized for, so expect very slow performance and I can't guarantee there won't be timeouts or errors doing this based on your data. If you run into errors the only other option is to use the scroll/ES queries I noted above.

---

<div class="post-metadata">

### Author: ![Bikash\_Hutait](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bikash_hutait/32/126087_2.png) [@Bikash\_Hutait](https://discuss.elastic.co/u/Bikash_Hutait)
#### Post date: [January 30, 2024, 6:31pm UTC](https://discuss.elastic.co/t/how-to-get-results-over-10k-in-app-search/351310/10 "2024-01-30T18:31:04Z")

</div>

In Elasticsearch, including App Search, there are limitations on the number of results returned for a single query to prevent excessive resource usage. The default limit is often set to 10,000 results.

To work around this limitation and retrieve more than 10,000 results, you can consider the following options:

1. Pagination:

2. Scroll API:

3. Increase `index.max_result_window`:

Remember to consider the performance implications of your chosen method, and choose the approach that best fits your use case and infrastructure.

---

<div class="post-metadata">

### Author: ![oppocreaty](https://avatars.discourse-cdn.com/v4/letter/o/258eb7/32.png) [@oppocreaty](https://discuss.elastic.co/u/oppocreaty)
#### Post date: [January 30, 2024, 8:28pm UTC](https://discuss.elastic.co/t/how-to-get-results-over-10k-in-app-search/351310/11 "2024-01-30T20:28:13Z")

</div>

The above query still return in only first 10k.

---

<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: [February 27, 2024, 8:28pm UTC](https://discuss.elastic.co/t/how-to-get-results-over-10k-in-app-search/351310/12 "2024-02-27T20:28:32Z")

</div>

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