# How to change the default response payload 10 to a custom number in app search php client

**URL:** https://discuss.elastic.co/t/how-to-change-the-default-response-payload-10-to-a-custom-number-in-app-search-php-client/317716
**Category:** Elastic Search
**Tags:** elastic-app-search
**Created:** [October 29, 2022, 4:20am UTC](https://discuss.elastic.co/t/how-to-change-the-default-response-payload-10-to-a-custom-number-in-app-search-php-client/317716 "2022-10-29T04:20:01Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Dhanushka\_Samarasing](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dhanushka_samarasing/32/112421_2.png) [@Dhanushka\_Samarasing](https://discuss.elastic.co/u/Dhanushka_Samarasing)
#### Post date: [October 29, 2022, 4:20am UTC](https://discuss.elastic.co/t/how-to-change-the-default-response-payload-10-to-a-custom-number-in-app-search-php-client/317716/1 "2022-10-29T04:20:01Z")

</div>

I was using the app-search php client for my application using below code block. What it does is that, get the results from a app-search engine based on the query we provide in the `$search` variable.

```auto
$search = new Schema\SearchRequestParams($search);
$client = new ElasticEnterpriseSearchClient([
    'host' => 'http://<App-Search-IP>:<Port>',
    'app-search' => [
        'token' => '<API token>'
    ]
    
]);
$appSearch = $client->appSearch();
$result = $appSearch->search(new ElasticAppSearchRequest\Search('dvf-data', $search))->asArray();

```

```auto
use Elastic\EnterpriseSearch\Client as ElasticEnterpriseSearchClient;
use Elastic\EnterpriseSearch\AppSearch\Request as ElasticAppSearchRequest;
use Elastic\EnterpriseSearch\AppSearch\Schema;

```

These are the packages I'm using

I get the response but there is only 10 results in the array, how can I increase that response value like to 100 or 1000? I have also checked the app-search PHP client doc, but did not find a solution there.

Note: I'm using ES and APP-Search version 8.3.3

Any help would be appreciated! 🙂

---

<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: [October 30, 2022, 2:03pm UTC](https://discuss.elastic.co/t/how-to-change-the-default-response-payload-10-to-a-custom-number-in-app-search-php-client/317716/2 "2022-10-30T14:03:16Z")

</div>

The size of the result set can be adjusted using the `page.size` parameter on your request. [Search API | Elastic App Search Documentation [8.4] | Elastic](https://www.elastic.co/guide/en/app-search/current/search.html#search-api-request-body)

---

<div class="post-metadata">

### Author: ![Dhanushka\_Samarasing](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dhanushka_samarasing/32/112421_2.png) [@Dhanushka\_Samarasing](https://discuss.elastic.co/u/Dhanushka_Samarasing)
#### Post date: [October 30, 2022, 2:57pm UTC](https://discuss.elastic.co/t/how-to-change-the-default-response-payload-10-to-a-custom-number-in-app-search-php-client/317716/3 "2022-10-30T14:57:48Z")

</div>

Hi @JasonStoltz

Thanks for you reply.  
I saw that in the documentation, but my question is how can we pass it in the below code block. it only accepts engine name and the search keyword. How to set/[pass the other parameters to that funtion?

> [@Dhanushka\_Samarasing](#):
>
> `$result = $appSearch->search(new ElasticAppSearchRequest\Search('dvf-data', $search))->asArray();`

---

<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: [October 31, 2022, 1:41pm UTC](https://discuss.elastic.co/t/how-to-change-the-default-response-payload-10-to-a-custom-number-in-app-search-php-client/317716/4 "2022-10-31T13:41:04Z")

</div>

Have you checked the docs for the PHP client? I'm guessing the answer is there.

---

<div class="post-metadata">

### Author: ![Dhanushka\_Samarasing](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dhanushka_samarasing/32/112421_2.png) [@Dhanushka\_Samarasing](https://discuss.elastic.co/u/Dhanushka_Samarasing)
#### Post date: [November 1, 2022, 2:01am UTC](https://discuss.elastic.co/t/how-to-change-the-default-response-payload-10-to-a-custom-number-in-app-search-php-client/317716/5 "2022-11-01T02:01:18Z")

</div>

Hi @JasonStoltz

Yes, I did check the documentation. I guess below doc is the correct one.  
[app-search php client](https://www.elastic.co/guide/en/enterprise-search-clients/php/current/app-search-api.html)

---

<div class="post-metadata">

### Author: ![ezimuel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ezimuel/32/49516_2.png) [@ezimuel](https://discuss.elastic.co/u/ezimuel)
#### Post date: [November 2, 2022, 12:40pm UTC](https://discuss.elastic.co/t/how-to-change-the-default-response-payload-10-to-a-custom-number-in-app-search-php-client/317716/6 "2022-11-02T12:40:26Z")

</div>

Hi @Dhanushka_Samarasing ,  
for setting the `size` parameter you need to create a Schema\Page object and assign it to `page` property of Request\Search, as follows:

```auto
$appSearch = $client->appSearch();
$request = new ElasticAppSearchRequest\Search('dvf-data', $search);
$request->page = new Schema\Page(100);
$result = $appSearch->search($request)->asArray();

```

We should definitely improve our documentation here 🙂  
Let me know if you need more assistance, thanks.

---

<div class="post-metadata">

### Author: ![Dhanushka\_Samarasing](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dhanushka_samarasing/32/112421_2.png) [@Dhanushka\_Samarasing](https://discuss.elastic.co/u/Dhanushka_Samarasing)
#### Post date: [November 24, 2022, 3:30pm UTC](https://discuss.elastic.co/t/how-to-change-the-default-response-payload-10-to-a-custom-number-in-app-search-php-client/317716/7 "2022-11-24T15:30:15Z")

</div>

Hi @ezimuel ,  
Thanks for your reply.

---

<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 22, 2022, 3:30pm UTC](https://discuss.elastic.co/t/how-to-change-the-default-response-payload-10-to-a-custom-number-in-app-search-php-client/317716/8 "2022-12-22T15:30:40Z")

</div>

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