1
votes

I'm trying to get search result in alfresco using cmis query.

The below query runs fine and returns result

SELECT * FROM my:content WHERE (cmis:name Like '%a%' And my:description Like '%a%')

whereas the same query with OR condition doesn't return any result.

SELECT * FROM my:content WHERE (cmis:name Like '%a%' OR my:description Like '%a%')

Please Help. Thanks in advance.

2
What version of Alfresco are you using? - Gagravarr
Which CMIS endpoint are you using? - Jeff Potts
Is my:description an attribute of a type named my:content or is it defined in an aspect? - Jeff Potts
@JeffPotts cmis endpoint : localhost:8080/alfresco/service/cmis - User14141111
@JeffPotts my description is property <property name="my:description"> <title>Description</title> <type>d:mltext</type></property> - User14141111

2 Answers

1
votes

You are not using the correct CMIS endpoint. For Alfresco, 4.2, you need to use one of the following:

ATOM Pub Binding, CMIS 1.0:

http://<host>/alfresco/api/-default-/public/cmis/versions/1.0/atom

ATOM Pub Binding, CMIS 1.1:

http://<host>/alfresco/api/-default-/public/cmis/versions/1.1/atom

Browser (JSON) Binding, CMIS 1.1:

http://<host>/alfresco/api/-default-/public/cmis/versions/1.1/browser

Using the correct binding, I cannot re-create this problem.

1
votes

For Alfresco 5, 5.0 don't support "OR" operator (!?!) :

http://docs.alfresco.com/5.0/concepts/intrans-metadata-query.html

Unsupported logical operators

The following logical operator is not supported: OR

But the 5.1 do :

http://docs.alfresco.com/5.1/concepts/intrans-metadata-query.html Supported logical operators

The following logical operators are supported:

AND

NOT

OR