My entities have an attribute with the name "size". The value of this attribute is one of the followings: "huge", "normal", "small".
Is there a way to order my nodes where "huge">"normal">"small"?
If you are using Cypher 2.0, yes.
Try using the CASE expression http://docs.neo4j.org/chunked/milestone/cypher-expressions.html#query-syntax-case
Example:
MATCH n:MyNode
WITH n, CASE n.size
WHEN 'small' THEN 0
WHEN 'normal' THEN 1
WHEN 'huge' THEN 2
ELSE -1
END as sortOrder
RETURN n ORDER BY sortOrder
order by node.size asc
syntax. – ulkas