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

Analytics dashboard for document created and modified should display histogram

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 9.10-HF04
    • Fix Version/s: 9.10-HF08, 10.2
    • Component/s: Web UI
    • Release Notes Summary:
      The analytics dashboards in Web UI, 'Documents Created Per Week' and 'Documents Modified Per Week', use the correct format when filtering documents by date.
    • Sprint:
      nxGang Sprint 10.2.4
    • Story Points:
      2

      Description

      Currently the admin analytics dashboard in WebUI is not able to fetch data to display the 2 histogram "Document created and modified per week". (see screenshot)

      Indeed there is a bug on the nuxeo-aggregate-data-behavior component that specify the following date format to query in ES : yyyy-MM-dd https://github.com/nuxeo/nuxeo-dataviz-elements/blob/master/nuxeo-aggregate-data-behavior.html#L114

      But the date format used in the date range filter contains the date with the timestamp and timezone like: 2018-03-12T07:00:00.000Z

      Therefore the following query fails :

      curl 'http://localhost:8080/nuxeo/site/es/_all/_search' -H 'Accept: application/json'  --data-binary '{"query":{"bool":{"must":[{"range":{"dc:created":{"gte":"2018-03-12T07:00:00.000Z","lte":"2018-04-13T07:00:00.000Z"}}}]}},"aggs":{"by":{"date_histogram":{"field":"dc:created","interval":"week","format":"yyyy-MM-dd","min_doc_count":0,"extended_bounds":{"min":"2018-03-12T07:00:00.000Z","max":"2018-04-13T07:00:00.000Z"}}}}}' --compressed
      

      Here is the response payload (although it returns a 200 there is actually a 400 returned from ES see NXP-24763):

      {"error":{"root_cause":[{"type":"parse_exception","reason":"failed to parse date field [2018-03-12T07:00:00.000Z] with format [yyyy-MM-dd]"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"nuxeo","node":"3KTG7wL2QJCez4oAQvrfYQ","reason":{"type":"parse_exception","reason":"failed to parse date field [2018-03-12T07:00:00.000Z] with format [yyyy-MM-dd]","caused_by":{"type":"illegal_argument_exception","reason":"Unrecognized chars at the end of [2018-03-12T07:00:00.000Z]: [T07:00:00.000Z]"}}}]},"status":400}
      

      Possible solution:

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 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 - 1 hour
                  1h