1
votes

I'm using the OPENCMIS library to connect Sharepoint's CMIS connector. After connecting to a specific Library(Repository in CMIS language), were trying to retrieve the list of documents from that specific library that met a criteria (ex: name = myTestDocument). It's works perfectly with the following query:

select * from document where cmis:name = 'myTestDocument'

This is ok, but since the criteria will be filled by a user, we switch to use the CONTAINS predicate to be able to search without having the complete name (ex: Only "Test" instead of "myTestDocument"). So the query looks more like this:

select * from document where contains('Test').

It returns the documents meeting the criteria in the library, but also documents from other libraries.

Does anybody have an idea on how to enforce search only in the connected library.

1
Can you tell how you managed to make CONTAINS predicate work at all with Sharepoint through CMIS? - Vlad Grichina

1 Answers

1
votes

I had the same problem, and I resolved it using the IN_TREE() predicate function, as documented in the CMIS Documentation 1

The resulting query is:

select * from document where contains('Test') and IN_TREE(-1)

"-1" stand for the repository root ID (also in the CMIS Documentation)

Regards,

Jerome