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.
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.
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?
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:
$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.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.