5 Replies Latest reply on Oct 7, 2013 4:54 AM by hchiorean

    Filter by root path not working?

    kurtstam

      Hi, guys,

       

      I only want to find artifacts in the /s-ramp root folder and am executing the following query:

       

      SELECT * FROM [sramp:baseArtifactType] WHERE [sramp:uuid] = 'db6940d3-e9cf-4d0e-a8bb-785a13fc4a15' AND (ISDESCENDANTNODE([sramp:baseArtifactType],'/s-ramp'))

       

      However I am still getting artifacts from path:

       

      Path = /s-ramp-trash/artifacts/be/27/b9/6f-114b-485c-b2d6-9bb459cf46b4/6b98a808-452b-4d9c-ad6c-7a7d56f8fa63

       

      I also tried a root paths of

      • '/s-ramp/', and
      • '/s-ramp/artifact/'

       

      but I still find the artifact in '/s-ramp-trash'

       

      I must be doing something very obviously wrong? Is this not how 'ISDESCENDANTNODE' is supposed to work?

       

      Thx,

       

      --Kurt

        • 1. Re: Filter by root path not working?
          kurtstam

          Note that the filter works fine for 'primary artifacts', but for this derived (deleted child node)

           

          SELECT artifact1.* FROM [sramp:baseArtifactType] AS artifact1 WHERE (artifact1.[sramp:uuid] = '2e1f2b1a-4a8c-457d-a93a-1e78caf97c89') AND (ISDESCENDANTNODE([sramp:baseArtifactType],'/s-ramp/artifacts')) ORDER BY artifact1.[sramp:name] ASC

           

          See how the path is

          /{}s-ramp-trash/{}artifacts/{}1c/{}ca/{}a2/{}e1-3d4b-412f-9100-f5c180c3e93c/{}2e1f2b1a-4a8c-457d-a93a-1e78caf97c89
          and location:

          /{}s-ramp-trash/{}artifacts/{}1c/{}ca/{}a2/{}e1-3d4b-412f-9100-f5c180c3e93c/{}2e1f2b1a-4a8c-457d-a93a-1e78caf97c89 @ 7f42af07505d64dedbbcb8-6961-4dc3-a279-d73bf410771f

           

          +---+--------------------------------------+----------------------+-------------------------------+------------------------------+------------------------------+----------------------------------------+-----------------------------+-------------------------+-------------------------------+-------------------------+-------------------------------+------------------------------+--------------------------------------+----------------------------------------------------+----------------------------------------------------+----------------------------------------------------+---------------------------+------------------------+-----------------------------+----------------------------+--------------------------------------------------------------------------------------------------------------------+----------------------------------------+---------------------+--------------------------------------+----------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------+
          | # | artifact1.sramp:uuid                | artifact1.sramp:name | artifact1.sramp:artifactModel | artifact1.sramp:artifactType | artifact1.sramp:classifiedBy | artifact1.sramp:normalizedClassifiedBy | artifact1.sramp:description | artifact1.sramp:derived | artifact1.jcr:created        | artifact1.jcr:createdBy | artifact1.jcr:lastModified    | artifact1.jcr:lastModifiedBy | artifact1.jcr:uuid                  | artifact1.jcr:versionHistory                      | artifact1.jcr:baseVersion                          | artifact1.jcr:predecessors                        | artifact1.jcr:mergeFailed | artifact1.jcr:activity | artifact1.jcr:configuration | artifact1.jcr:isCheckedOut | artifact1.jcr:path                                                                                                | artifact1.jcr:name                    | artifact1.jcr:score | artifact1.mode:localName            | artifact1.mode:depth | Location(artifact1)                                                                                                                                                    | Score(artifact1)  |
          +---+--------------------------------------+----------------------+-------------------------------+------------------------------+------------------------------+----------------------------------------+-----------------------------+-------------------------+-------------------------------+-------------------------+-------------------------------+------------------------------+--------------------------------------+----------------------------------------------------+----------------------------------------------------+----------------------------------------------------+---------------------------+------------------------+-----------------------------+----------------------------+--------------------------------------------------------------------------------------------------------------------+----------------------------------------+---------------------+--------------------------------------+----------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------+
          | 1 | 2e1f2b1a-4a8c-457d-a93a-1e78caf97c89 | CreditAgency        | wsdl                          | PortType                    |                              |                                        |                            | true                    | 2013-10-03T16:31:36.107-04:00 | kurt                    | 2013-10-03T16:31:37.186-04:00 | kurt                        | dedbbcb8-6961-4dc3-a279-d73bf410771f | 7f42af0317f1e7dedbbcb8-6961-4dc3-a279-d73bf410771f | 7f42af0317f1e7788ea382-5127-4ee2-ad2e-bdb293ad8343 | 7f42af0317f1e7788ea382-5127-4ee2-ad2e-bdb293ad8343 |                          |                        |                            | true                      | /{}s-ramp-trash/{}artifacts/{}1c/{}ca/{}a2/{}e1-3d4b-412f-9100-f5c180c3e93c/{}2e1f2b1a-4a8c-457d-a93a-1e78caf97c89 | {}2e1f2b1a-4a8c-457d-a93a-1e78caf97c89 |                    | 2e1f2b1a-4a8c-457d-a93a-1e78caf97c89 | 7                    | /{}s-ramp-trash/{}artifacts/{}1c/{}ca/{}a2/{}e1-3d4b-412f-9100-f5c180c3e93c/{}2e1f2b1a-4a8c-457d-a93a-1e78caf97c89 @ 7f42af07505d64dedbbcb8-6961-4dc3-a279-d73bf410771f | 1.139431118965149 |
          +---+--------------------------------------+----------------------+-------------------------------+------------------------------+------------------------------+----------------------------------------+-----------------------------+-------------------------+-------------------------------+-------------------------+-------------------------------+------------------------------+--------------------------------------+----------------------------------------------------+----------------------------------------------------+----------------------------------------------------+---------------------------+------------------------+-----------------------------+----------------------------+--------------------------------------------------------------------------------------------------------------------+----------------------------------------+---------------------+--------------------------------------+----------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------+

          • 2. Re: Filter by root path not working?
            rhauch

            This is likely a bug in the path criteria we're using in Lucene. I suspect because "/s-ramp" is a prefix of "/s-ramp-trash" that the trash-related paths are not properly excluded.

             

            Can you log a bug? Also, it'd be really helpful if you could check whether my hypothesis is correct, and that something that does not begin with the "/s-ramp" path string is not found. (Not sure how easy that is for you to try.)

            • 3. Re: Filter by root path not working?
              kurtstam

              Thx for the followup Randall,

               

              So for the artifact being on root path "/s-ramp-trash"

              (ISDESCENDANTNODE([sramp:baseArtifactType],'/s-ramp')) - results returned

              (ISDESCENDANTNODE([sramp:baseArtifactType],'/s-ramp-trash')) - no results returned

               

              1. This is for the data as described in the first comment of this thread. The above results are quite the opposite of what I was expecting.

              2. For the non-child nodes this works fine; maybe there the lucene index is updated, while for the child nodes it is not?

               

              I opened: [MODE-2068] Child nodes can still be found in their old folder after a folder move - JBoss Issue Tracker

              • 4. Re: Filter by root path not working?
                rhauch

                I saw MODE-2068, but that you were using ModeShape 3.2. There were a couple of issues related to indexing after nodes are moved: MODE-1940 was fixed in 3.3, and MODE-2030 will be fixed in 3.6. The first one is what you might be seeing. Any chance yo can try with the latest 3.5?