Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-101653

Do not allow rankFusion to run on views

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1 Required, 8.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Integration
    • Fully Compatible
    • ALL
    • v8.1
    • 200

      For timeseries we always add a $_internalUnpackBucket stage in the beginning of the pipeline to change bucket documents into user expected documents. However, the $unionWith stage that is generated during the desugaring for $rankFusion
       is on the buckets namespace, and we never add the $_internalUnpackBucket stage to turn buckets into user facing documents. This is a problem for two reasons:

      1. The pipelines in $rankFusion are running on different documents. One pipeline is sorting the user documents (because it does have the $_internalUnpackBucket stage and one pipeline (inside the $unionWith) is running on the buckets namespace and therefore sorting bucket documents.
      2. All of the subsequent stages will not have expected behavior for the bucket documents. Bucket documents have different field names, so all $sort stages are not doing any sorting because the field names are wrong.

      Since rankFusion is most useful for search, vectorSearch and geoNear queries and those stages are all banned in timeseries collections, we should just ban rankFusion for now for timeseries collections 

            Assignee:
            will.buerger@mongodb.com Will Buerger
            Reporter:
            gil.alon@mongodb.com Gil Alon
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: