cloudkey-php icon indicating copy to clipboard operation
cloudkey-php copied to clipboard

search sort problem

Open lionelbzv opened this issue 10 years ago • 1 comments

How could I sort a media.search listing result in created desc order?

$res = $cloudkey->media->search(array( 'per_page' => 6, 'page' => 1, 'fields' => array('id', 'meta.title'), 'sort' => array(array('-created')), 'query' => 'meta.title: football' ));

This code give me a "need more than 1 value to unpack" error. If I put only one array, I've got the error: {"sort": {"0": "must be of list type"}}

I can't find any doc on this point. Thanks.

lionelbzv avatar Nov 12 '14 11:11 lionelbzv

It seems that I could do the sort with the "query" arg

'query' => 'meta.category: football SORT:-created'

So what's the purpose of the "sort" argument of the media.search api call?

lionelbzv avatar Nov 12 '14 13:11 lionelbzv