# What is difference between size in search and body

**URL:** <https://discuss.elastic.co/t/what-is-difference-between-size-in-search-and-body/138374>\
**Category:** Elasticsearch\
**Created:** [July 3, 2018, 12:15pm UTC](https://discuss.elastic.co/t/what-is-difference-between-size-in-search-and-body/138374 "2018-07-03T12:15:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yolo\_1900](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yolo_1900/32/32877_2.png) [@yolo\_1900](https://discuss.elastic.co/u/yolo_1900)\
**Post date:** [July 3, 2018, 12:15pm UTC](https://discuss.elastic.co/t/what-is-difference-between-size-in-search-and-body/138374/1 "2018-07-03T12:15:19Z")

</div>

Hello everyone

For instance, I have the following code:

```auto
page = es.search(
          index = 'index',
          scroll = '2m',
          size = 20,
          body = {
            "size":10,
            "query": {"match_all": {}}
            }
        )

```

There is `size` inside the `search` and another `size` inside `body`. What is the difference and what are the purpose of them?

Thank you

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [July 6, 2018, 1:52pm UTC](https://discuss.elastic.co/t/what-is-difference-between-size-in-search-and-body/138374/2 "2018-07-06T13:52:13Z")

</div>

I am not quite sure which language this is, but assuming this is javascript, the `size` inside the `search` will go [on URI](https://www.elastic.co/guide/en/elasticsearch/reference/6.3/search-uri-request.html) and the `size` in the body will remain in [the body](https://www.elastic.co/guide/en/elasticsearch/reference/6.3/search-request-from-size.html). If you specify both, the value in URI will be used.

---

<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 3, 2018, 1:52pm UTC](https://discuss.elastic.co/t/what-is-difference-between-size-in-search-and-body/138374/3 "2018-08-03T13:52:14Z")

</div>

Closed on August 3, 2018, 1:52pm UTC

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