From c588fddb835ef7ff541dfea95931d261024ff9e9 Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Sat, 6 Jul 2019 11:38:21 +0200 Subject: [PATCH] hldata: matchGroup: return false if no match found --- src/utils/hldata.cpp | 6 +++--- src/utils/hldata.h | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/utils/hldata.cpp b/src/utils/hldata.cpp index da49b4de..c3b9b0a7 100644 --- a/src/utils/hldata.cpp +++ b/src/utils/hldata.cpp @@ -206,7 +206,7 @@ bool matchGroup(const HighlightData& hldata, orplists.back().addplist(pl->first, &(pl->second)); } if (orplists.back().plists.empty()) { - LOGINF("No positions list found for group " << + LOGRP("No positions list found for group " << stringsToString(group) << std::endl); orplists.pop_back(); } @@ -215,7 +215,7 @@ bool matchGroup(const HighlightData& hldata, // I think this can't actually happen, was useful when we used to // prune the groups, but doesn't hurt. if (orplists.size() < 2) { - LOGINF("TextSplitPTR::matchGroup: no actual groups found\n"); + LOGRP("TextSplitPTR::matchGroup: no actual groups found\n"); return false; } @@ -261,7 +261,7 @@ bool matchGroup(const HighlightData& hldata, } } - return true; + return !tboffs.empty(); } string HighlightData::toString() const diff --git a/src/utils/hldata.h b/src/utils/hldata.h index e9900c95..e4e54369 100644 --- a/src/utils/hldata.h +++ b/src/utils/hldata.h @@ -86,7 +86,8 @@ struct GroupMatchEntry { // Find NEAR matches for one group of terms. // -// @param hldata User query expansion descriptor (see above). +// @param hldata User query expansion descriptor (see above). We only use +// the index_term_groups entry // // @param grpidx Index in hldata.index_term_groups for the group we // process. This is used by us to get the terms and slacks, and