From 7d794d3ecec59e60a5e3db49f14eebd0333d0a71 Mon Sep 17 00:00:00 2001 From: Kishore Nallan Date: Fri, 31 Dec 2021 14:41:39 +0530 Subject: [PATCH] Remove approximate verbatim field count. This leads to false positives. --- src/index.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/index.cpp b/src/index.cpp index fc692d69..4d0e7d57 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -2285,6 +2285,8 @@ void Index::search(std::vector& field_query_tokens, auto& kvs = seq_id_kvs.second; // each `kv` can be from a different field std::sort(kvs.begin(), kvs.end(), Topster::is_greater); + + // kvs[0] will store query indices of the kv group (across fields) kvs[0]->query_indices = new uint64_t[kvs.size() + 1]; kvs[0]->query_indices[0] = kvs.size(); @@ -2400,7 +2402,7 @@ void Index::search(std::vector& field_query_tokens, if(field_typos == 0 && tokens_found == field_query_tokens[i].q_include_tokens.size()) { exact_match_fields += weight; - verbatim_match_fields += weight; // this is only an approximate + // not possible to calculate verbatim_match_fields accurately here, so we won't } auto weighted_tokens_match = (tokens_found * weight);