-
Type: Bug
-
Status: Resolved
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 10.10
-
Fix Version/s: 10.10-HF59, 2021.17
-
Component/s: Elasticsearch
-
Release Notes Summary:The property isVersion is set on a DocumentModel fetch from Elasticsearch.
-
Tags:
-
Backlog priority:800
Pre-requisite : nxql_search page provider must use Elasticsearch
Steps to reproduce:
- add elasticsearch.fetchDocFromEs=true to nuxeo.conf
- start Nuxeo
- create a document and do a major version
- go to NXQL search and run NXQL query "select * from Document Where isVersion = 1"
- open the Developer tools and watch the value "isVersion" for the first entry in the response
Observed behavior:
isVersion is set to false
Expected behavior:
isVersion is set to true, which would match the NXQL query which filters on versions
Quick analysis:
JsonDocumentModelRead#getDocumentModel ignores all "ecm" properties from the JSON but "ecm:currentLifeCycleState" : https://github.com/nuxeo/nuxeo/blob/10.10/nuxeo-features/nuxeo-elasticsearch/nuxeo-elasticsearch-core/src/main/java/org/nuxeo/elasticsearch/io/JsonDocumentModelReader.java#L122
=> it's probably the reason why "ecm:isVersion" which is set to "true" is not used to update the DocumentModel