Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-19484

Add order by pos when querying and resolving document from list fields

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 8.10
    • Component/s: Core, Query & PageProvider

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: