summaryrefslogtreecommitdiff
path: root/src/mongo/db/fts/fts_index_format.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/fts/fts_index_format.cpp')
-rw-r--r--src/mongo/db/fts/fts_index_format.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/mongo/db/fts/fts_index_format.cpp b/src/mongo/db/fts/fts_index_format.cpp
index ab9950635fb..b514a67a6dd 100644
--- a/src/mongo/db/fts/fts_index_format.cpp
+++ b/src/mongo/db/fts/fts_index_format.cpp
@@ -135,7 +135,12 @@ MONGO_INITIALIZER(FTSIndexFormat)(InitializerContext* context) {
return Status::OK();
}
-void FTSIndexFormat::getKeys(const FTSSpec& spec, const BSONObj& obj, BSONObjSet* keys) {
+void FTSIndexFormat::getKeys(const FTSSpec& spec,
+ const BSONObj& obj,
+ KeyStringSet* keys,
+ KeyString::Version keyStringVersion,
+ Ordering ordering,
+ boost::optional<RecordId> id) {
int extraSize = 0;
vector<BSONElement> extrasBefore;
vector<BSONElement> extrasAfter;
@@ -182,7 +187,11 @@ void FTSIndexFormat::getKeys(const FTSSpec& spec, const BSONObj& obj, BSONObjSet
verify(guess >= res.objsize());
- keys->insert(res);
+ KeyString::HeapBuilder keyString(keyStringVersion, res, ordering);
+ if (id) {
+ keyString.appendRecordId(*id);
+ }
+ keys->insert(keyString.release());
keyBSONSize += res.objsize();
}
}