1
votes

Greetings to the community! I am using alfresco community edition 6.0.0 and I just faced a very weird problem. I am using the Java API to access my alfresco repository by running CMIS queries. I successfully fetched documents using cmis-strict like shown below:

Example 1)

select * from cmis:document WHERE cmis:name like '%doc%' AND  cmis:objectId =  'e318a431-0ff4-4a4a-9537-394d2bd761af' "

Example 2)

SELECT * FROM cmis:document WHERE IN_FOLDER('63958f9c-819f-40f4-bedf-4a2e402f8b9f') AND cmis:name like '%temp%'

which work perfectly, what I would like to do is retrieve files/folders under a specific path (f.e fetch all folders under /app:company_home/app:user_homes)

what I do is running from the node browser of alfresco the following cmis-strict query

SELECT * FROM cmis:folder WHERE CONTAINS('PATH:"//app:company_home/app:user_homes//*"')

but even though there are existing folders under that directory nothing is returned. It seems that the PATH argument is not recognized as it should does, as when i run the query SELECT * FROM cmis:folder I get back many results that have as parent the

app:company_home/app:user_homes 

node

Any idea what may be the problem? Any help would be greatly appreciated, thanks :)

EDIT:

I have also tried to use lucene query like

PATH:"/app:company_home/app:user_homes//*") but no results returned too
2

2 Answers

2
votes

Your user homes contains query works for me in both 5.2 and 6.1.1.

I like @Lista's suggestion of checking into your index. If that doesn't bear fruit, you might go get the CMIS object ID of the user homes folder, then use it with the IN_FOLDER clause you've already proven works.

1
votes

I think both Lucene and CMIS queries (if using CONTAINS) end up on the index (not database), so it's not weird to assume something is off with the index itself. Have you tried rebuilding them? Are your nodes even in index (there's a SOLR admin console you can use to see this)?

https://docs.alfresco.com/6.0/concepts/query-lang-support.html