# PHP-Elasticsearch not returning all results like Kibana

**URL:** <https://discuss.elastic.co/t/php-elasticsearch-not-returning-all-results-like-kibana/56716>\
**Category:** Elasticsearch\
**Created:** [July 29, 2016, 10:11am UTC](https://discuss.elastic.co/t/php-elasticsearch-not-returning-all-results-like-kibana/56716 "2016-07-29T10:11:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Veer\_Shubhranshu\_Shr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/veer_shubhranshu_shr/32/9530_2.png) [@Veer\_Shubhranshu\_Shr](https://discuss.elastic.co/u/Veer_Shubhranshu_Shr)\
**Post date:** [July 29, 2016, 10:11am UTC](https://discuss.elastic.co/t/php-elasticsearch-not-returning-all-results-like-kibana/56716/1 "2016-07-29T10:11:53Z")

</div>

Hi,

We have configured ELK for our server logs.

We want to query elasticsearch using PHP. Below is our code:

```
//Change URL Accordingly
$elasticServer = ["172.29.106.202:9200"]; //Server IP / Name

//Create Elastic Search Object
$client = Elasticsearch\ClientBuilder::create()
	    ->setHosts($elasticServer)
	    ->setRetries(0)
	    ->build();

$result = new stdClass();

$params = array();
$params['index'] = '*'; //search all index
$params['type'] = 'Beta Logs from 51.66';
$params['body']['query']['match']['message'] = "Action:read_session";
$result->searches = $client->search($params);

```

This returns a set of data. But however, the data returned is not similar to what I get from Kibana UI.

Any explanation? or change in the code?

---

<div class="post-metadata">

**Author:** ![colings86](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/colings86/32/44960_2.png) [@colings86](https://discuss.elastic.co/u/colings86)\
**Post date:** [July 29, 2016, 12:13pm UTC](https://discuss.elastic.co/t/php-elasticsearch-not-returning-all-results-like-kibana/56716/2 "2016-07-29T12:13:11Z")

</div>

Could you explain how the results from this code differ from the results you see in Kibana? Without this it's going to be very hard for someone to give you a reason why you see a difference. Can you also tell us which versions of Kibana and Elasticsearch you are using?

---

<div class="post-metadata">

**Author:** ![Veer\_Shubhranshu\_Shr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/veer_shubhranshu_shr/32/9530_2.png) [@Veer\_Shubhranshu\_Shr](https://discuss.elastic.co/u/Veer_Shubhranshu_Shr)\
**Post date:** [August 1, 2016, 4:24am UTC](https://discuss.elastic.co/t/php-elasticsearch-not-returning-all-results-like-kibana/56716/3 "2016-08-01T04:24:29Z")

</div>

Total of 54 results are shown from Kibana - Discover Tab, whereas only few results (17) are returned from PHP Library. I am using Kibana 4.5 and Elasticsearch 2.3.2.

---

<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 5, 2017, 10:31pm UTC](https://discuss.elastic.co/t/php-elasticsearch-not-returning-all-results-like-kibana/56716/4 "2017-07-05T22:31:23Z")

</div>


