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

Page Provider truncates timestamp milliseconds

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2021.28
    • Fix Version/s: None
    • Component/s: Query & PageProvider

      Description

      Define a "custom" Page Provider, with predicates:

      • dc:created >= (dublincore_created)
      • dc:created < (dublincore_created_1)

      Create Web UI search form to enter date/time range start/end values (I'm using a nuxeo-custom-date-time-picker element, but it's not directly relevant here).

      Perform search query using (e.g.) start time = 2023-01-26T16:01:36.600Z and end time = 2023-01-26T16:01:37.600Z (note the 600 millisecond specifiers).

      From browser dev tools, see query made to repo:

      http://localhost:8080/nuxeo/api/v1/search/pp/custom/execute?currentPageIndex=0&offset=0&pageSize=40&sortBy=dc%3Acreated&sortOrder=asc&quickFilters=&dublincore_created=2023-01-26T16%3A01%3A36.600Z&dublincore_created_1=2023-01-26T16%3A01%3A37.600Z
      

      The query made to ES is as follows:

      [org.nuxeo.elasticsearch.core.ElasticSearchServiceImpl] Search query: curl -XGET 'http://localhost:9200/nuxeo/_search?pretty&search_type=dfs_query_then_fetch' -d '{"from":0,"size":40,"query":{"bool":{"must":[{"constant_score":{"filter":{"range":{"dc:created":{"from":"2023-01-26T16:01:36.000Z", ...
      

      Actual Result:

      Note how the "from" value is 2023-01-26T16:01:36.000Z and has truncated the milliseconds.

      Expected Result:

      The ES query should show the milliseconds as made in the REST API request.

      Notes:

      The Web UI NXQL Admin shows correct results by evaluating NXQL against the DB (MongoDB in my case) i.e.

      http://localhost:8080/nuxeo/api/v1/search/pp/nxql_search/execute?currentPageIndex=0&offset=0&pageSize=40&queryParams=SELECT%20*%20FROM%20TmpFolder%20WHERE%20dc%3Acreated%20%3E%20TIMESTAMP%20%272023-01-26T16%3A01%3A36.600Z%27%20AND%20dc%3Acreated%20%3C%3D%20TIMESTAMP%20%272023-01-26T16%3A01%3A37.600Z%27
      

      The REST API Search Endpoint can be used to query NXQL against ES, and this also shows the correct results e.g.

      > curl -X GET -H 'properties: *' -u "Administrator:Administrator" 'http://localhost:8080/nuxeo/api/v1/search/lang/NXQL/execute?pageSize=20&currentPageIndex=0&query=SELECT%20*%20FROM%20TmpFolder%20WHERE%20dc%3Acreated%20%3E%20TIMESTAMP%20%272023-01-26T16%3A01%3A36.600Z%27%20AND%20dc%3Acreated%20%3C%3D%20TIMESTAMP%20%272023-01-26T16%3A01%3A37.600Z%27&sortBy=dc%3Acreated&sortOrder=asc'
      

      which generates the following ES request:

      Search query: curl -XGET 'http://localhost:9200/nuxeo/_search?pretty&search_type=dfs_query_then_fetch' -d '{"from":0,"size":20,"query":{"bool":{"must":[{"bool":{"must":[{"constant_score":{"filter":{"range":{"dc:created":{"from":"2023-01-26T16:01:36.600Z", ...
      

      So it appears that the Page Provider is truncating the milliseconds in the request.

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              msaye Mark Saye
              Participants:
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: