1

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
NickAth
  • 1,089
  • 1
  • 14
  • 35

2 Answers2

2

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.

Jeff Potts
  • 10,468
  • 17
  • 40
  • Hi Jeff, thanks for your response, I already use the method you propose but I would really want to retrieve documents using the path. So I guess I have to perform some kind of indexing in my repository? or in any specific node? – NickAth Dec 17 '18 at 00:33
1

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

Lista
  • 2,186
  • 1
  • 15
  • 18
  • Thanks for your reply :) Where is exactly that SOLR admin console you refer? In the same section with the Node Browser and Workflow console? – NickAth Dec 17 '18 at 00:35
  • No, this is a separate application. https://docs.alfresco.com/5.0/tasks/ssl-protect-solrwebapp.html – Lista Dec 17 '18 at 10:51
  • Thanks for the resources, will check it out :) – NickAth Dec 18 '18 at 13:45