Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
8.2
-
None
-
New
Description
In CompressingTermVectorsWriter.flushOffsets, we count
sumPos and sumOffsets by the way
for (int i = 0; i < fd.numTerms; ++i) { int previousPos = 0; int previousOff = 0; for (int j = 0; j < fd.freqs[i]; ++j) { final int position = positionsBuf[fd.posStart + pos]; final int startOffset = startOffsetsBuf[fd.offStart + pos]; sumPos[fieldNumOff] += position - previousPos; sumOffsets[fieldNumOff] += startOffset - previousOff; previousPos = position; previousOff = startOffset; ++pos; } }
we always use the position - previousPos, it can be summarized like this:
(position5-position4)+(position4-position3)+(position3-position2)+(position2-position1)
If we should simplify it: position5-position1
Attachments
Issue Links
- links to