summaryrefslogtreecommitdiff
path: root/src/mongo/db/fts/fts_index_format.cpp
diff options
context:
space:
mode:
authorGregory Noma <gregory.noma@gmail.com>2019-08-08 10:55:52 -0400
committerGregory Noma <gregory.noma@gmail.com>2019-08-08 10:55:52 -0400
commit75d6c5116dd1aefa6c6daebd2cab0d47498db706 (patch)
treec73225c0086d76612448cd947c9ccbc88c941150 /src/mongo/db/fts/fts_index_format.cpp
parent8457da2f81b5378fa7485a151cb2255700a6c31a (diff)
downloadmongo-75d6c5116dd1aefa6c6daebd2cab0d47498db706.tar.gz
SERVER-41721 Make IndexAccessMethod::getKeys output a KeyString set
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();
}
}