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

NXQL queries not translating properly into MongoDB for multi-valued, complex types

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 9.2
    • Fix Version/s: 9.3
    • Component/s: Core MongoDB

      Description

      When searching for multi-valued complex properties using NXQL (in JSF UI Search tab), the resulting MongoDB query is not returning the expected results.

      Steps to reproduce:

      1. Create data model with each field in the complex field being a multi-valued string.
        Example: Complex Multi-Valued Field: Vehicle. Sub Fields: Make & Year - both multi-valued string fields
      2. One document has 2 vehicles - 1st: 2008, Chevy; 2nd: 2010, Ford
      3. Example NXQL Search (should not return document above):
        `SELECT * FROM HotlineArchive WHERE ecm:path STARTSWITH '/default-domain/vehicleTestHotlineArchiveContainer' AND (vehicleList:vehicles/*1/make/* = 'Ford' OR vehicleList:vehicles/*1/make/* IS NULL) AND (vehicleList:vehicles/*1/year/* = '2008' OR vehicleList:vehicles/*1/year/* IS NULL)"`
        
      4. Translated Mongo search (returns document - not desired):
        `{ "$and" : [ { "ecm:primaryType" : "HotlineArchive"} , { "ecm:ancestorIds" : "427b9e7d-226c-4ae2-8e31-cb320756d709"} , { "$or" : [ { "vehicleList:vehicles.make" : "Ford"} , { "vehicleList:vehicles.make" :  null }]} , { "$or" : [ { "vehicleList:vehicles.year" : "2008"} , { "vehicleList:vehicles.year" :  null }]}]}`
        

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                2 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 days
                  2d