Word Metadata's count is hella broken, stopgap fix by bitCounting positions instead as this is messing with the search result ordering very badly.

This commit is contained in:
Viktor Lofgren 2023-03-09 17:58:56 +01:00
parent 9ece07d559
commit 8fb531c614

View File

@ -41,7 +41,7 @@ public record WordMetadata(int tfIdf,
this(
(int)((value >>> TF_IDF_SHIFT) & TF_IDF_MASK),
(int)((value >>> POSITIONS_SHIFT) & POSITIONS_MASK),
Math.max((int)((value >>> POSITIONS_SHIFT) & POSITIONS_MASK), (int)((value >>> COUNT_SHIFT) & COUNT_MASK)),
Integer.bitCount((int) ((value >>> POSITIONS_SHIFT) & POSITIONS_MASK)),
(byte) (value & FLAGS_MASK)
);
}