CMIS query using IN_TREE and multi-value property

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Member II

CMIS query using IN_TREE and multi-value property

Jump to solution

I am trying to query an Alfresco 5.2 repo using cmis-strict in the node browser.

I have 5 documents in a folder tree.

2 of those 5 documents have a multi-value property accountreference = 1927615 and a single value property crmindex = X1943G;.UL

Example 1

SELECT * FROM figaro:basetype WHERE  IN_TREE('06080482-d235-4dec-bf7b-4e6027e88aab')

Expected result = 5 documents

Actual result = 5 documents

Example 2

SELECT * FROM figaro:basetype WHERE  '1927615' = ANY figaro:accountreference

Expected result = 2 documents

Actual result = 2 documents

Example 3

SELECT * FROM figaro:basetype WHERE figaro:crmindex='X1943G;.UL'

Expected result = 2 documents

Actual result = 2 documents

Example 4

SELECT * FROM figaro:basetype WHERE  IN_TREE('06080482-d235-4dec-bf7b-4e6027e88aab') AND figaro:crmindex='X1943G;.UL'

Expected result = 2 documents

Actual result = 2 documents

Example 5

SELECT * FROM figaro:basetype WHERE '1927615' = ANY figaro:accountreference AND figaro:crmindex='X1943G;.UL'

Expected result = 2 documents

Actual result = 2 documents

Example 6

SELECT * FROM figaro:basetype WHERE  IN_TREE('06080482-d235-4dec-bf7b-4e6027e88aab') AND '1927615' = ANY figaro:accountreference

Expected result = 2 documents

Actual result = 0 documents

THE PROBLEM

Using an AND in a WHERE clause that uses IN_TREE and a multi-value property returns zero results.

Does anyone have any ideas about this?

1 Solution

Accepted Solutions
Highlighted
Alfresco Employee

Re: CMIS query using IN_TREE and multi-value property

Jump to solution

I've tried a similar approach with Alfresco 6.1 and Search Services 1.3.0.1 and it works for me.

SELECT * 
FROM figaro:basetype
WHERE IN_TREE('e416ed7a-bb59-4805-ac86-aa6cbdcc4c9e') AND
'1927615' = ANY figaro:accountreference‍‍‍

Upgrading is an option?

Software Engineer in Alfresco Search Team.

View solution in original post

6 Replies
Highlighted
Alfresco Employee

Re: CMIS query using IN_TREE and multi-value property

Jump to solution

I've tried a similar approach with Alfresco 6.1 and Search Services 1.3.0.1 and it works for me.

SELECT * 
FROM figaro:basetype
WHERE IN_TREE('e416ed7a-bb59-4805-ac86-aa6cbdcc4c9e') AND
'1927615' = ANY figaro:accountreference‍‍‍

Upgrading is an option?

Software Engineer in Alfresco Search Team.

View solution in original post

Highlighted
Member II

Re: CMIS query using IN_TREE and multi-value property

Jump to solution

Thanks for your input. 

I’ve just rebuilt the entire Solr index and cleared out the Solr models. 

The query now works as expected. 

I’m not sure what went wrong there. It’s a bit worrying. 

Highlighted
Alfresco Employee

Re: CMIS query using IN_TREE and multi-value property

Jump to solution

Re-indexing is required when introducing changes in the model. If your model is stable, no re-indexing should be required.

Software Engineer in Alfresco Search Team.
Highlighted
Member II

Re: CMIS query using IN_TREE and multi-value property

Jump to solution

That might explain it. I added a new doc type using the model manager. 

It it seems unfortunate that you can change the model interactively in model manager but still need to clear down Solr manually under the covers and rebuild the index. 

Is there a simple way of doing this?

Highlighted
Alfresco Employee

Re: CMIS query using IN_TREE and multi-value property

Jump to solution

You can change the model, and the changes are updated in SOLR.

However if you are working with a new Model and make some tests, this documents will be indexed with existing properties.

When you modify the model and (for instance) you add a new property, new documents will be indexed with this new property, but old documents are not being indexed with the new one. You can re-index them manually or perform a full re-indexation.

In PROD environments, playing live with the Model is not the recommended approach.

Software Engineer in Alfresco Search Team.
Highlighted
Member II

Re: CMIS query using IN_TREE and multi-value property

Jump to solution

Many thanks for the clarification