cancel
Showing results for 
Search instead for 
Did you mean: 

CMIS Query with custom property issue

mikemars
Champ in-the-making
Champ in-the-making
Hi,

I am running a CMIS Query against an Alfresco Labs 4.0d repository.

The query uses an aspect and a custom property which is a String. The query looks like:

SELECT d.cmis:objectid FROM cmis:document as d join sa:myCustomAspect as g on d.cmis:objectid = g.cmis:objectid  WHERE g.sa:myCustomProperty like 'Hello'
The query as above executes and finds all the documents which have 'Hello' in the myCustomProperty property. e.g 'Hello', 'Hello World' e.t.c

However, if I change the search string from 'Hello' to 'Hello World', documents which have 'Hello World' set in the property are not returned.

I have tried several different aspect and properties, but each time a search string has a space in it when comparing against a custom property, no results are returned.

As a seperate test I tried a similar query without using a custom property and the results were returned as expected:

SELECT d.cmis:objectid FROM cmis:document as d  WHERE d.cmis:name LIKE 'Hello World'
Am I missing something from my first query above which will allow it to match against strings with spaces?

Thanks.
3 REPLIES 3

jpotts
World-Class Innovator
World-Class Innovator
Try using equals instead of like. Despite what you might think, it isn't an exact match and appears to behave more like a like.

Jeff

mikemars
Champ in-the-making
Champ in-the-making
Many thanks Jeff, that has worked!!

andy
Champ on-the-rise
Champ on-the-rise
Hi

You can also set the tokenisation mode for the property to "both" in the model - your field will then behave as you would expect in SQL (as cm:name does).

Andy