Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-21291

Never tagged pages are not listed in query results when searching for pages without a specific tag

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Major
    • None
    • 15.7
    • Query
    • Ubuntu 20.04, MariaDB
    • Unknown
    • N/A
    • N/A

    Description

      When running a query to find pages in a particular space without a specific tag, the query only returns pages that have been tagged at some point, even if the tags have been deleted.  Pages that have never had any tag set on them are not in the results, even though they don't have the specific tag from the query.

      For example, if I run the following query in a velocity script:

      #set ($spaceReferenceString = "Development")
        #set ($query = $services.query.xwql("select doc.title, doc.fullName from Document doc, doc.object(XWiki.TagClass) tag  where ('someTag' not member of tag.tags) and (doc.space like :space or doc.space like ':space.%') order by doc.fullName asc"))
        #set ($query = $query.bindValue('space').literal("${spaceReferenceString}.").anyChars().query())
        #set ($results = $query.execute()) 

      The results will include:

      • Pages with tag(s) that are not 'someTag'
      • Pages that previously had a tag, but they have been deleted (no tags currently)

      The results will NOT include:

      • Pages that have never had a tag

      Logically, pages that have never been tagged should also be included in the group of pages that do not include 'someTag'.

       

      Attachments

        Activity

          People

            mleduc Manuel Leduc
            Redhorse Rob Ostapiuk
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: