sqlite-okapi-bm25
sqlite-okapi-bm25 copied to clipboard
Wrong index in `x` info table
Line 33
is currently int currentX = X_OFFSET + (3 * searchTextCol * (i + 1));
should become int currentX = X_OFFSET + (3 * (searchTextCol + i * colCount));
or similar.
Here is a sinppet from sqlite docs for matchinfo
hits_this_row = array[3 * (c + p*cols) + 0]
hits_all_rows = array[3 * (c + p*cols) + 1]
docs_with_hits = array[3 * (c + p*cols) + 2]
where column idx c
is searchTextCol
, phrase idx p
is i
and number of cols cols
is colCount
+1. currentX is calculated wrongly. It should be modified as wqweto are saying.