cancel
Showing results for 
Search instead for 
Did you mean: 

How to use CONTAINS on metadata ?

berguiz
Champ in-the-making
Champ in-the-making

Hello,

I try to use the function CONTAINS in my query but I can not to get my documents with it.

SELECT * FROM my:medatas WHERE my:type='TYPE1'

works fine. While the query :

SELECT * FROM my:medatas m WHERE CONTAINS(m, 'TYPE1')

works (no exceptions) but I have not any documents.

I want to use this function because I would like to make a search on all the properties and not only on my:type.

1 ACCEPTED ANSWER

andy1
Star Collaborator
Star Collaborator

Hi

CMIS  CONTAINS() by default matches only content.

If you are using the public API it is possible to change this default.

There is an example here.

You can specify the field in the query. Beware, the CMIS specification is quite limited but we support any Alfresco full text search expression in CONTAINS() - the CMIS specification is a sub-set that assumes you mean content.

SELECT * FROM my:medatas WHERE CONTAINS('my:type=TYPE1')

Andy

View answer in original post

1 REPLY 1

andy1
Star Collaborator
Star Collaborator

Hi

CMIS  CONTAINS() by default matches only content.

If you are using the public API it is possible to change this default.

There is an example here.

You can specify the field in the query. Beware, the CMIS specification is quite limited but we support any Alfresco full text search expression in CONTAINS() - the CMIS specification is a sub-set that assumes you mean content.

SELECT * FROM my:medatas WHERE CONTAINS('my:type=TYPE1')

Andy