ISSUE SUMMARY
When inserting a document into a collection with a text index, the weight value for each field in that document is reflected in scores stored inside the index key. If the index has both a wildcard text index and one or more weighted fields, the index will assign an incorrect weight to any field that is lexicographically smaller (alphabetically earlier, so attribute < name < profession) than a field with specified weight. Instead of assigning the default weight for the wildcard, the field will be assigned the weight of the next specified field in the index.
USER IMPACT
Documents in collections with text indexes that have both a wildcard match and a weighted field may have incorrect text scores in the index, and therefore get incorrect scores back when querying and projecting or sorting on {$meta: "textScore" }.
RECOVERY STEPS
Dropping and recreating a text index on a version of mongod that includes the patch will fix this issue. This should be done for every wildcard text index with custom weights on specific fields.
AFFECTED VERSIONS
This affects all versions prior to 4.3.3.
FIX VERSION
The fix will be included in 4.3.3, 4.2.4, 4.0.17 and 3.6.18.
- depends on
-
SERVER-85089 User Summary for SERVER-45363
- Closed