Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify positions #1022

Closed
4 tasks done
fulmicoton opened this issue Apr 22, 2021 · 0 comments
Closed
4 tasks done

Simplify positions #1022

fulmicoton opened this issue Apr 22, 2021 · 0 comments
Assignees

Comments

@fulmicoton
Copy link
Collaborator

fulmicoton commented Apr 22, 2021

Right now the positions of all terms are all encoded in the same position stream, delta and bitpacked.
The last block is simply padded.

We want to move from this to something closer to what is done for doc ids.
Each term would be encoded independently and the last block would be vint encoded.

This should unlock the possibility to use phrase query on "distant directory".

This means

  • encode/read the byte range in TermInfo
  • encode/read the new positions info.
  • limit the fetch on positions to our tight range
  • check for possible performance hits

Positions encoding:
Assuming the overall number of positions is P

- Positions: NumBitPackedBlocks BitPackedPositionBlock^(P/128) BitPackedPositionsDeltaBitWidth VIntPosDeltas?
- NumBitPackedBlocks: VInt = P / 128
- BitPackedPositionBlock: bit width encoded block of 128 delta pos
- BitPackedPositionsDeltaBitWidth: (BitWidth: u8)^NumBitPackedBlocks
- VIntPosDeltas: (VIntPosDelta)^(P % 128).
@fulmicoton fulmicoton self-assigned this Apr 23, 2021
fulmicoton added a commit that referenced this issue Apr 26, 2021
This was referenced Feb 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant