Skip to content

Commit

Permalink
Fix block traversal issue
Browse files Browse the repository at this point in the history
  • Loading branch information
elshize committed Jan 16, 2019
1 parent 2f4d984 commit 44a5b03
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions include/query/algorithm/exhaustive_taat_query.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,15 @@ struct Simple_Accumulator : public std::vector<float> {

struct Taat_Traversal {
template <typename Cursor, typename Acc, typename Score>
void static traverse_term(Cursor &cursor, Score score, Acc &acc) {
void static traverse_term(Cursor &cursor, Score score, Acc &acc)
{
if constexpr (std::is_same_v<typename Cursor::enumerator_category,
ds2i::block_enumerator_tag>) {
while (cursor.docid() < acc.size()) {
auto const &documents = cursor.document_buffer();
auto const &freqs = cursor.frequency_buffer();
for (uint32_t idx = 0; idx < documents.size(); ++idx) {
acc.accumulate(documents[idx], score(documents[idx], freqs[idx]));
acc.accumulate(documents[idx], score(documents[idx], freqs[idx] + 1));
}
cursor.next_block();
}
Expand Down

0 comments on commit 44a5b03

Please sign in to comment.