-
Type: Task
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 8.10
-
Component/s: Core, Query & PageProvider
-
Epic Link:
-
Tags:
-
Sprint:nxGang Sprint 8.3.1, nxFG 8.4.1
-
Story Points:3
VCS does not scan the list in any explicit order when doing SELECT dc:subjects/* FROM Document.
Having a fixed order is useful so the NXQLQueryMaker code should ORDER BY dc_subjects.pos in that case. Note that interactions are possible with other NXQL ORDER BY already in the query, and with the case where list elements for several documents are returned.
Internally a query such as SELECT dc:subjects/* FROM Document WHERE ecm:name = 'doc3' ORDER BY dc:title should be turned into something like:
SELECT DC_SUBJECTS.ITEM FROM HIERARCHY LEFT JOIN DC_SUBJECTS ON HIERARCHY.ID = DC_SUBJECTS.ID LEFT JOIN DUBLINCORE ON HIERARCHY.ID = DUBLINCORE.ID WHERE HIERARCHY.PRIMARYTYPE IN (?, ?) AND HIERARCHY.NAME = ? ORDER BY DUBLINCORE.TITLE, HIERARCHY.ID, DC_SUBJECTS.POS
As we can only order by POS if there is already a document-based sort happening before.