1

I'd like to know how to get all nodes of a given type ts:folderSet which has no parent association of type ts:FolderSubSet informed.

Currently:

enter image description here

So, I mean, I need all nodes of type ts:folderSet where tsfss:folderSubSet-folder is null or not informed.

Currently, I'm using admin tool in order to build this query, but I'll need to use it into a java code.

enter image description here

So I mean, I can use FTS or lucene... Any ideas?

user10063942
  • 101
  • 3
  • 9
  • 1
    Possible duplicate of [How can I find alfresco empty foldres using Lucene Query](https://stackoverflow.com/questions/54902243/how-can-i-find-alfresco-empty-foldres-using-lucene-query) – Lista Mar 08 '19 at 12:41

3 Answers3

0

If your parent type is different you can do: +TYPE:"ts:folderSet"

Rbkpro Dev
  • 31
  • 1
0

The problem is that the PARENT keyword in search uses the primary parent. Your ts:folderSubSet object is a secondary parent to your ts:folderSet object. I don't think you will be able to write a single query that can find instances of ts:folderSet that do not have an instance of ts:folderSubSet as a secondary parent.

You can write a query that returns ts:folderSet objects and then you can iterate over each one of the results checking its list of parents for the secondary object. Not ideal, but it is probably the best you can do.

Jeff Potts
  • 10,468
  • 17
  • 40
-1

You can search for a type of nodes using the following Lucene query

TYPE:"cm:folder"
Kintu Barot
  • 320
  • 2
  • 11