04-04-2019 08:24 AM
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?
04-05-2019 04:23 AM
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?
04-05-2019 04:23 AM
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?
04-05-2019 04:31 AM
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.
04-05-2019 04:36 AM
Re-indexing is required when introducing changes in the model. If your model is stable, no re-indexing should be required.
04-05-2019 05:50 AM
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?
04-05-2019 06:15 AM
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.
04-05-2019 06:26 AM
Many thanks for the clarification
Explore our Alfresco products with the links below. Use labels to filter content by product module.