cancel
Showing results for 
Search instead for 
Did you mean: 

CMIS Query with IN_TREE

viktoriyamoskov
Champ on-the-rise
Champ on-the-rise

Good day.

I don't understand why my query doesn't work, when I use several IN_TREE:

SELECT * from cmis:document WHERE IN_TREE('cb51f2f8-5ed1-49f6-a231-356c3b40c6d1')
AND IN_TREE('cecbca1b-c59c-4629-b8c0-0bdbc26fdf46')

If I use only one
IN_TREE, like:

SELECT * from cmis:document WHERE IN_TREE('cb51f2f8-5ed1-49f6-a231-356c3b40c6d1')

everything works.

I ran it using the Chemistry Workbench. I need to use several IN_TREE in my request.
How can I do that?


Thank You.
3 REPLIES 3

angelborroy
Community Manager Community Manager
Community Manager

You cannot combine more than one IN_TREE clause in your WHERE.

Depending on the condition, you can use something like

CONTAINS('PATH:\"/app:companyhome//*\"')
Hyland Developer Evangelist

afaust
Legendary Innovator
Legendary Innovator

The question then would be, "why" can't you combine more than one IN_TREE clause? Is this some hard-coded implementation of Alfresco that limits this? Because conceptually, it feels like one should be able to do something like this, since content items in CMIS are allowed to be multi-filed, and by combinding two IN_TREE clauses you could filter results to find only those that actually are multi-filed.

I have a GUI in which the user selects a list of sites for downloading documents. I can not get all the documents from the selected sites in one request? For each site will have to form a separate request?