03-26-2012 03:32 PM
<type name="test:document">
<title>Document</title>
<parent>cm:content</parent>
<property name="test:keywords">
<title>Keywords</title>
<type>d:text</type>
<mandatory>true</mandatory>
<multiple>true</multiple>
<index enabled="true">
<tokenised>both</tokenised>
</index>
</property>
</type>
SELECT cmis:name, test:keywords FROM test:document WHERE ANY test:keywords in ('one')
SELECT cmis:name, test:keywords FROM test:document WHERE ANY test:keywords in ('two')
SELECT cmis:name, test:keywords FROM test:document WHERE ANY test:keywords in ('two', 'one')
03-27-2012 05:14 AM
03-27-2012 10:59 AM
03-28-2012 05:27 AM
04-09-2012 06:35 PM
>>> query = "select * from cmis:document as d join sc:productRelated as p on d.cmis:objectId = p.cmis:objectId where ANY p.sc:version in ('1.1')"
>>> rs = repo.query(query)
>>> len(rs)
1
>>> rs[0].name
u'test-plain-1.txt'
>>> query = "select * from cmis:document as d join sc:productRelated as p on d.cmis:objectId = p.cmis:objectId where ANY p.sc:version in ('5.5')"
>>> rs = repo.query(query)
>>> len(rs)
1
>>> rs[0].name
u'test-plain-2.txt'
>>> query = "select * from cmis:document as d join sc:productRelated as p on d.cmis:objectId = p.cmis:objectId where ((ANY p.sc:version in ('3.3')) OR (ANY p.sc:version in ('6.6')))"
>>> rs = repo.query(query)
>>> len(rs)
2
>>> rs[0].name
u'test-plain-1.txt
'>>> rs[1].name
u'test-plain-2.txt'
>>> query = "select * from cmis:document as d join sc:productRelated as p on d.cmis:objectId = p.cmis:objectId where ANY p.sc:version in ('3.3','6.6')"
>>> rs = repo.query(query)
>>> len(rs)
2
>>> rs[0].name
u'test-plain-1.txt'
>>> rs[1].name
u'test-plain-2.txt'
>>> query = "select * from cmis:document as d join sc:productRelated as p on d.cmis:objectId = p.cmis:objectId where ANY p.sc:version in ('7.7')"
>>> rs = repo.query(query)
>>> len(rs)
0
One difference between my example and yours is that I'm using a property defined in an aspect, so I have to do the join. But that shouldn't matter.04-10-2012 05:35 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.