Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

search sort problem #18

Open
lionelbzv opened this issue Nov 12, 2014 · 1 comment
Open

search sort problem #18

lionelbzv opened this issue Nov 12, 2014 · 1 comment

Comments

@lionelbzv
Copy link

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
Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant