Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/mongo/db/exec/text.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,16 @@ unique_ptr<PlanStage> TextStage::buildTextTree(OperationContext* opCtx,

ixparams.bounds.startKey = FTSIndexFormat::getIndexKey(
MAX_WEIGHT, term, _params.indexPrefix, _params.spec.getTextIndexVersion());

string term_end = term;
term_end[term_end.size() - 1]++; // increment last character key code of search term for End-Key
ixparams.bounds.endKey = FTSIndexFormat::getIndexKey(
0, term, _params.indexPrefix, _params.spec.getTextIndexVersion());
ixparams.bounds.boundInclusion = BoundInclusion::kIncludeBothStartAndEndKeys;
MAX_WEIGHT, term_end, _params.indexPrefix, _params.spec.getTextIndexVersion());
ixparams.bounds.endKeyInclusive = false; // End key is not inclusive (endKey is artificially generated)

ixparams.bounds.isSimpleRange = true;
ixparams.descriptor = _params.index;
ixparams.direction = -1;
ixparams.direction = 1;

textScorer->addChild(make_unique<IndexScan>(opCtx, ixparams, ws, nullptr));
}
Expand Down