Closed danielmewes closed 10 years ago
Apart from OrderBy itself, we must also update Asc and Desc.
@danielmewes can we get this fixed ran into this one right now thankfully @neumino was able to help me find this issue after we both tried a few things :)
A fix has been released in version 1.11.2 (this is the only change in that version).
It turned out that Asc and Desc don't have to be changed, because indexes cannot be used with those.
To use an index with name 'ind' in an orderBy:
r\table('test')->orderBy(array('index' => 'ind'))
To combine an index with a secondary ordering criteria:
r\table('test')->orderBy(array('index' => 'ind', 'other_field'))
Hmm, it seems that Asc and Desc can actually be combined with indexes. Re-opening.
Oh it actually already works:
r\table('test')->orderBy(array('index' => r\desc('ind')))
The API documentation suggests that it does (http://php-rql.dnsalias.net/api/#ph:transformations-order_by), but it actually does not use indexes.