Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-13210

Investigate changes in SERVER-44056: regression in {$meta: "textScore"} projection

    XMLWordPrintable

Details

    • Task
    • Status: Closed
    • Major - P3
    • Resolution: Gone away
    • None
    • 4.3.1
    • manual, Server

    Description

      Description

      Downstream Change Summary

      In 4.2, a find() command with a textScore $meta projection, e.g.
      db.c.find({}, {a: {$meta: "textScore"}})

      would assign a value of 0 to 'a' if no textScore metadata was available.

      The default value in 4.3/master is missing (that is, 'a' will not be present in the returned document).

      Feel free to slack me if you have questions.

      Description of Linked Ticket

      A Java driver functional test of  {$meta: "textScore"} projection recently regressed when running against latest mongod. The regression occurred somewhere between the commit hashes 560b542 and c119ef4.

      Test setup:

      > db.test.insert({x: 1, y: [{a: 1, b: 2}, {a: 2, b: 3}, {a: 3, b: 4}]})
      > db.test.createIndex({y: "text"})
      

      Expected results contain a synthetic score field:

      > db.test.find({}, {score: {"$meta": "textScore"}})
      { "_id" : ObjectId("5da7cc88458e2388ffaedd5f"), 
        "x" : 1, 
        "y" : [ { "a" : 1, "b" : 2 }, { "a" : 2, "b" : 3 }, { "a" : 3, "b" : 4 } ], 
        "score" : 0 
      }
      

      Results after the regression omit the score field:

      MongoDB Enterprise > db.test.find({}, {score: {"$meta": "textScore"}})
      { "_id" : ObjectId("5da7ce30522390ed46b8b869"), 
         "x" : 1, 
         "y" : [ { "a" : 1, "b" : 2 }, { "a" : 2, "b" : 3 }, { "a" : 3, "b" : 4 } ] 
      }
      

      Educated guess is that the fix for SERVER-42423 is the culprit.

      Scope of changes

      Impact to Other Docs

      MVP (Work and Date)

      Resources (Scope or Design Docs, Invision, etc.)

      Attachments

        Issue Links

          Activity

            People

              jeffrey.allen@mongodb.com Jeffrey Allen
              backlog-server-pm Backlog - Core Eng Program Management Team
              Jeffrey Allen Jeffrey Allen
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                2 years, 26 weeks ago