# How to search with pagination in search app?

**URL:** https://discuss.elastic.co/t/how-to-search-with-pagination-in-search-app/187709
**Category:** Elastic Search
**Tags:** elastic-app-search
**Created:** [June 27, 2019, 3:47am UTC](https://discuss.elastic.co/t/how-to-search-with-pagination-in-search-app/187709 "2019-06-27T03:47:03Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Ricky\_Tokdis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ricky_tokdis/32/45283_2.png) [@Ricky\_Tokdis](https://discuss.elastic.co/u/Ricky_Tokdis)
#### Post date: [June 27, 2019, 3:47am UTC](https://discuss.elastic.co/t/how-to-search-with-pagination-in-search-app/187709/1 "2019-06-27T03:47:03Z")

</div>

[https://xxxxxxxxxx.swiftype.com/api/as/v1/engines/xxxxxxxx/search?page[size]=15&page[current]=2&query=jam&filters[is\_deleted]=0&sort[total\_sold]=desc](https://xxxxxxxxxx.swiftype.com/api/as/v1/engines/xxxxxxxx/search?page%5Bsize%5D=15&page%5Bcurrent%5D=2&query=jam&filters%5Bis_deleted%5D=0&sort%5Btotal_sold%5D=desc)

This my error :  
"Page contains invalid option: size; must be an integer",  
"Page contains invalid option: current; must be an integer"

how to can i to fix this error help me please

---

<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: [June 27, 2019, 6:52am UTC](https://discuss.elastic.co/t/how-to-search-with-pagination-in-search-app/187709/2 "2019-06-27T06:52:09Z")

</div>

Hi @Ricky_Tokdis.

The search payload should be set as a request body, not as query parameters. Examples can be found here: [https://swiftype.com/documentation/app-search/api/search/filters](https://swiftype.com/documentation/app-search/api/search/filters)

Just out of curiosity: did you find some docs saying that query parameters, as you're using, would also work?

---

<div class="post-metadata">

### Author: ![Ricky\_Tokdis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ricky_tokdis/32/45283_2.png) [@Ricky\_Tokdis](https://discuss.elastic.co/u/Ricky_Tokdis)
#### Post date: [June 27, 2019, 10:33am UTC](https://discuss.elastic.co/t/how-to-search-with-pagination-in-search-app/187709/3 "2019-06-27T10:33:01Z")

</div>

i am using query parameter, if i not use page in query parameter it can be work it

---

<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: [June 27, 2019, 4:05pm UTC](https://discuss.elastic.co/t/how-to-search-with-pagination-in-search-app/187709/4 "2019-06-27T16:05:33Z")

</div>

You're right - unfortunately the search endpoint does not currently fully support query parameters for all options. So you would need to create a JSON request body, as seen in the documentation page I previously linked to.

---

<div class="post-metadata">

### Author: ![Ricky\_Tokdis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ricky_tokdis/32/45283_2.png) [@Ricky\_Tokdis](https://discuss.elastic.co/u/Ricky_Tokdis)
#### Post date: [June 28, 2019, 2:29am UTC](https://discuss.elastic.co/t/how-to-search-with-pagination-in-search-app/187709/5 "2019-06-28T02:29:03Z")

</div>

okay sir, thank you very much to your response

---

<div class="post-metadata">

### Author: ![Ricky\_Tokdis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ricky_tokdis/32/45283_2.png) [@Ricky\_Tokdis](https://discuss.elastic.co/u/Ricky_Tokdis)
#### Post date: [June 28, 2019, 2:33am UTC](https://discuss.elastic.co/t/how-to-search-with-pagination-in-search-app/187709/6 "2019-06-28T02:33:40Z")

</div>

now in my endpoint, i am request method GET and send parameter to request body ?

---

<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: [June 28, 2019, 7:46am UTC](https://discuss.elastic.co/t/how-to-search-with-pagination-in-search-app/187709/7 "2019-06-28T07:46:00Z")

</div>

Yes, GET request with a JSON body would work but some HTTP libraries might not support that. So a POST request would be the option I would go with.

---

<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: [July 26, 2019, 7:46am UTC](https://discuss.elastic.co/t/how-to-search-with-pagination-in-search-app/187709/8 "2019-07-26T07:46:10Z")

</div>

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