kuzzleio / sdk-php

Official php SDK for Kuzzle
http://docs.kuzzle.io/sdk-reference
Apache License 2.0
6 stars 1 forks source link

fetchAllDocuments handles a "parse exception" #10

Closed ballinette closed 8 years ago

ballinette commented 8 years ago

While using fetchAllDocuments, we have following exception from Kuzzle: "[parse_exception] Failed to derive xcontent"

ballinette commented 8 years ago

cause: fetchAllDocuments calls advancedFilters with an empty array as filters parameters: https://github.com/kuzzleio/sdk-php/blob/master/src/DataCollection.php#L240

But we need a JSON object instead of an array, according to ElasticSearch.

ballinette commented 8 years ago

NB: we need also to document the PHP SDK to explain when the developer should create empty arrays ($myArr = []), and when he should create empty objects ($myObj = (object)[])