How to sort results of a MATCH query

#1

Is there a way to sort the results of a MATCH query? The only way I see is to nest the MATCH statement inside a SELECT with ORDER BY, but that doesn’t seem very efficient on large record sets.

#2

Hi @eric24

In v 3.0 MATCH statement supports most of the operators available in the SELECT, ie GROUP BY, ORDER BY, SKIP, LIMIT, UNWIND

You can just do a

MATCH ... RETURN x, y ORDER BY x

V 2.2 does not have these capabilities, so you have to use a SELECT FROM (MATCH...) ORDER BY

Thanks

Luigi

#3

Ah, good. And yes, I was trying this on 2.2. Thanks!