summaryrefslogtreecommitdiff
path: root/src/mongo/db/fts/fts_spec.cpp
diff options
context:
space:
mode:
authorJason Rassi <rassi@10gen.com>2014-01-10 14:52:48 -0500
committerJason Rassi <rassi@10gen.com>2014-01-24 08:23:53 -0500
commitf03c5b1f6163be5de62b38294deeab310969a4ac (patch)
treef3a59b8ff9871bccb0a5c49d7777eb4d35722c41 /src/mongo/db/fts/fts_spec.cpp
parentf49669ffe3f267bedc258dd17ec1b2d45970ec8a (diff)
downloadmongo-f03c5b1f6163be5de62b38294deeab310969a4ac.tar.gz
SERVER-12325 Fix FTSSpec traversal logic for subdocuments
Fixed issue where FTSSpec::scoreDocument() would stop deep traversal of a document when it encountered a weight for the FTSSpec with a non-String BSON type which also happens to be a parent component of another weight.
Diffstat (limited to 'src/mongo/db/fts/fts_spec.cpp')
-rw-r--r--src/mongo/db/fts/fts_spec.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mongo/db/fts/fts_spec.cpp b/src/mongo/db/fts/fts_spec.cpp
index 2dd7e0ce8ba..be74ae79bf1 100644
--- a/src/mongo/db/fts/fts_spec.cpp
+++ b/src/mongo/db/fts/fts_spec.cpp
@@ -179,7 +179,9 @@ namespace mongo {
// weight that could possibly match or be a prefix of dottedName. And if this
// element fails to match, then no subsequent weight can match, since the weights
// are lexicographically ordered.
- Weights::const_iterator i = _weights.lower_bound( dottedName );
+ Weights::const_iterator i = _weights.lower_bound( elem.type() == Object
+ ? dottedName + '.'
+ : dottedName );
// possibleWeightMatch is set if the weight map contains either a match or some item
// lexicographically larger than fieldName. This boolean acts as a guard on