Hi Team,
I am using neo4j version 4.4.19. We deal with an application that handles large sets of document nodes. Sort on the listing queries takes greater db hits. Please help here.
the below is some sample part of the query, where there are many sort parameters. Based on the user selection.
....WITH document,
CASE
WHEN sortBy='VersionDate' THEN document.version
WHEN sortBy='Title' THEN TRIM(TOLOWER(document.title))
WHEN sortBy='Source' THEN document.source
END AS sortVal
ORDER BY
CASE
WHEN sortOrder='Ascending' THEN sortVal ELSE NULL END
ASC,
CASE
WHEN sortOrder='Descending' THEN sortVal ELSE NULL END
DESC,document.GUID ASC
SKIP 0 LIMIT 10
RETURN document