Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-4265

XPath: support limited form of "union"

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.5.12, 1.6.0
    • query
    • None

    Description

      Currently, SQL-2 supports multiple paths restrictions combined with "or", and it supports "union". XPath doesn't support either. It would be good if this is supported, specially the "multiple paths" part.

      I think it makes sense to convert this to a SQL-2 "union" in all cases, even if it's just multiple paths.

      It doesn't need to be a "generic" solution, so that "|" doesn't need to be supported at every place (for example in the condition, or in the "order by"). But it would be nice if multiple independent queries, with one order by, could be supported.

      Implementation note: what makes this a bit complicated is support for "order by".

      For example:

      /jcr:root/(content|lib)/element(*, nt:base) order by @title
      
      select [jcr:path], [jcr:score], * 
      from [nt:base] as a 
      where ischildnode(a, '/content') 
      /* xpath: /jcr:root/content/element(*, nt:base) order by @title */ 
      union select [jcr:path], [jcr:score], * 
      from [nt:base] as a 
      where ischildnode(a, '/lib') 
      /* xpath: /jcr:root/lib/element(*, nt:base) order by @title */ 
      order by [title]
      

      Attachments

        Issue Links

          Activity

            People

              thomasm Thomas Mueller
              thomasm Thomas Mueller
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: