Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-30888

Fix DocumentModel#isVersion value when document is fetched from Elasticsearch

    XMLWordPrintable

    Details

    • Release Notes Summary:
      The property isVersion is set on a DocumentModel fetch from Elasticsearch.
    • Tags:
    • Backlog priority:
      800

      Description

      Pre-requisite : nxql_search page provider must use Elasticsearch

      Steps to reproduce:

      1. add elasticsearch.fetchDocFromEs=true to nuxeo.conf
      2. start Nuxeo
      3. create a document and do a major version
      4. go to NXQL search and run NXQL query "select * from Document Where isVersion = 1"
      5. 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

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours
                2h