User14141111
User14141111

Reputation: 365

Alfresco CMIS query working with AND but not with OR

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.

Upvotes: 1

Views: 705

Answers (2)

PascalFr
PascalFr

Reputation: 11

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

Upvotes: 1

Jeff Potts
Jeff Potts

Reputation: 10538

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.

Upvotes: 1

Related Questions