Skip to content

Commit

Permalink
Fix mistake in IndexTestHelpers.cpp.
Browse files Browse the repository at this point in the history
  • Loading branch information
Flixtastic committed Feb 26, 2025
1 parent 90d8852 commit 2755fd8
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions test/util/IndexTestHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,15 @@ Index makeTestIndex(const std::string& indexBasename,

index.createFromFiles({spec});
if (createTextIndex) {
if (scoringMetric.has_value() && bAndKParam.has_value()) {
index.storeTextScoringParamsInConfiguration(scoringMetric.value(),
bAndKParam.value().first,
bAndKParam.value().second);
if (scoringMetric.has_value()) {
if (!bAndKParam.has_value()) {
index.storeTextScoringParamsInConfiguration(scoringMetric.value(),
0.75, 1.75);
} else {
index.storeTextScoringParamsInConfiguration(
scoringMetric.value(), bAndKParam.value().first,
bAndKParam.value().second);
}
}
if (contentsOfWordsFileAndDocsFile.has_value()) {
// Create and write to words- and docsfile to later build a full text
Expand Down

0 comments on commit 2755fd8

Please sign in to comment.