This {@link DocsAndPositionsEnum} implementation is a decorator over a{@link DocsNodesAndPositionsEnum} which:
- is used to supply the {@link DocsNodesAndPositionsEnum} in{@link Siren10PostingsWriter#merge(org.apache.lucene.index.MergeState,DocsEnum,org.apache.lucene.util.FixedBitSet)}and in {@link NodeScorer}.
- emulate a {@link DocsAndPositionsEnum} to be compatible with Lucene'sinternal mechanism, especially with {@link CheckIndex}.
This implementation is very inefficient and should not be used outside unit tests.
Positions in {@link DocsNodesAndPositionsEnum} are local to a node.This implementation emulates {@link #nextPosition()} by scalingup positions with a position gap that are relative to the node id. Therefore, the positions returned by this enum are not the real positions.
The position gap is based on a hash of the node id. The hash of the node id is computed by normalising the node order between 0 and {@link Integer#MAX_VALUE}.
If this enum is used with Lucene's Positional Scorers, there is a chance of false-positive results.
There is a chance that the position returned is negative, in case the number of nodes are close to {@link Integer#MAX_VALUE}.
This position is only used in {@link CheckIndex} after unit tests, wherethe node tree structure is relatively simple.