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

Incorrect resultset from XPATH, multiple ORs and Lucene full-text

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 1.2.10, 1.3.15
    • 1.0.37, 1.2.15, 1.3.16, 1.4
    • lucene, query
    • None

    Description

      In case of more complex xpath queries with a mix of ORs, ANDs and
      full-text the returned resultset is wrong. Some of the conditions are
      lost during the query execution. Most probably during the Filter
      creation.

      The query is:

      /jcr:root/test//element(*, nt:unstructured)[ 
        (
          jcr:contains(., 'cinema') 
          or @tags = 'architecture-keywords:building/cinema' 
          or @tags = '/tags/architecture-keywords/building/cinema' 
        ) 
        and @status = 'amber' 
        and ( 
          not(@id) 
          and ( not(@types) 
          or (
            not(@types = 'published') 
            and not(@types = 'page') 
            and not(@types = 'asset') 
          ) 
        )
      )]
      

      In this case if you replace the @tags conditions with a
      jcr:contains rather than = it will make the query works. Which
      suggests the same root cause of OAK-2660.

      OAK-2660 was indirectly addressed by OAK-1617 but the OR->UNION
      conversion is not applied to subqueries of a UNION set.

      See attached patch for a reproducing test case.

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            thomasm Thomas Mueller
            edivad Davide Giannella
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment