A CMIS query to retrieve the latest version of a document returns all versions of document with cmis:isLatestVersion = true if the CMIS-Elasticsearch bridge is enabled.
How to reproduce:
- make sure CMIS-Elasticsearch bridge is disabled (it is by default)
- under a Folderish document, create a File document named SUPNXP-17954
- create 2 versions of the document, 0.1 and 0.2
- executing CMIS query SELECT * FROM cmis:document WHERE cmis:name LIKE 'SUPNXP-17954' in CMIS Workbench gives 1 result
- in a terminal executing curl -s -u Administrator:Administrator "http://localhost:8080/nuxeo/json/cmis/default?cmisselector=query&succinct=true&q=SELECT+*FROM+cmis:document+WHERE+cmis:name+LIKE'SUPNXP-17954'" gives 1 result:
{ "numItems": 1, "hasMoreItems": false, "results": [ { "succinctProperties": { "dc:publisher": null, "dc:source": null, "cmis:name": "SUPNXP-17954", "dc:created": 1474067058144, "cmis:creationDate": 1474067058144, "nuxeo:lifecycleState": "project", "cmis:createdBy": "Administrator", "dc:format": null, "dc:expired": null, "dc:rights": null, "nuxeo:pathSegment": "SUPNXP-17954", "dc:description": "12", "dc:coverage": null, "dc:creator": "Administrator", "cmis:versionLabel": "0.2", "cmis:objectTypeId": "File", "dc:lastContributor": "Administrator", "cmis:description": "12", "nuxeo:isVersion": true, "dc:title": "SUPNXP-17954", "nuxeo:parentId": "null", "cmis:isLatestVersion": true, "cmis:lastModificationDate": 1474067417507, "nuxeo:pos": null, "cmis:objectId": "6dddbdb8-0fae-4989-892d-ea1f69571ed8", "dc:language": null, "dc:valid": null, "cmis:lastModifiedBy": "Administrator", "dc:modified": 1474067417507, "cmis:baseTypeId": "cmis:document", "dc:issued": null, "dc:nature": null, "nuxeo:isCheckedIn": false, "cmis:isLatestMajorVersion": false } } ] }
- make sure CMIS-ES bridge is enabled (org.nuxeo.cmis.elasticsearch=true) and restart the Nuxeo Platform
- executing CMIS query SELECT * FROM cmis:document WHERE cmis:name LIKE 'SUPNXP-17954' in CMIS Workbench gives 2 results, 2 versions of the document with attribute cmis:isLatestVersion=true
- in a terminal executing curl -s -u Administrator:Administrator "http://localhost:8080/nuxeo/json/cmis/default?cmisselector=query&succinct=true&q=SELECT+*FROM+cmis:document+WHERE+cmis:name+LIKE'SUPNXP-17954'" gives 2 results, 2 versions of the document with attribute cmis:isLatestVersion=true:
{ "numItems": 2, "hasMoreItems": false, "results": [ { "succinctProperties": { "dc:publisher": null, "dc:source": null, "cmis:name": "SUPNXP-17954", "dc:created": 1474067058140, "cmis:creationDate": 1474067058140, "nuxeo:lifecycleState": "project", "cmis:createdBy": "Administrator", "dc:format": null, "dc:expired": null, "dc:rights": null, "nuxeo:pathSegment": "SUPNXP-17954", "dc:description": "12", "dc:coverage": null, "dc:creator": "Administrator", "cmis:versionLabel": "0.2", "cmis:objectTypeId": "File", "dc:lastContributor": "Administrator", "cmis:description": "12", "nuxeo:isVersion": true, "dc:title": "SUPNXP-17954", "nuxeo:parentId": "1b5fb40b-4cca-4399-a6d1-9ce1f9796425", "cmis:isLatestVersion": true, "cmis:lastModificationDate": 1474067417500, "nuxeo:pos": null, "cmis:objectId": "6dddbdb8-0fae-4989-892d-ea1f69571ed8", "dc:language": null, "dc:valid": null, "cmis:lastModifiedBy": "Administrator", "dc:modified": 1474067417500, "cmis:baseTypeId": "cmis:document", "dc:issued": null, "dc:nature": null, "nuxeo:isCheckedIn": true, "cmis:isLatestMajorVersion": false } }, { "succinctProperties": { "dc:publisher": null, "dc:source": null, "cmis:name": "SUPNXP-17954", "dc:created": 1474067058140, "cmis:creationDate": 1474067058140, "nuxeo:lifecycleState": "project", "cmis:createdBy": "Administrator", "dc:format": null, "dc:expired": null, "dc:rights": null, "nuxeo:pathSegment": "SUPNXP-17954", "dc:description": "1", "dc:coverage": null, "dc:creator": "Administrator", "cmis:versionLabel": "0.1", "cmis:objectTypeId": "File", "dc:lastContributor": "Administrator", "cmis:description": "1", "nuxeo:isVersion": true, "dc:title": "SUPNXP-17954", "nuxeo:parentId": "1b5fb40b-4cca-4399-a6d1-9ce1f9796425", "cmis:isLatestVersion": true, "cmis:lastModificationDate": 1474067402890, "nuxeo:pos": null, "cmis:objectId": "f5c86a50-fbee-4afe-8053-720e8b0ba680", "dc:language": null, "dc:valid": null, "cmis:lastModifiedBy": "Administrator", "dc:modified": 1474067402890, "cmis:baseTypeId": "cmis:document", "dc:issued": null, "dc:nature": null, "nuxeo:isCheckedIn": true, "cmis:isLatestMajorVersion": false } } ] }
- depends on
-
NXP-20570 ecm:isLatestVersion is not properly indexed by ES
- Resolved