Skip to content

Conversation

@CascadingRadium
Copy link
Member

IndexInternalID is defined in bleve_index_api, but its constructors previously lived in bleve.
To keep the API self-contained and consistent, this change adds:

  • NewIndexInternalID — encodes a uint64 into an 8-byte big-endian IndexInternalID, reusing a provided buffer when possible.

  • NewIndexInternalIDFrom — constructs a new IndexInternalID by copying from another, also reusing a provided buffer when possible.

  • Value — decodes and returns the uint64 stored in the ID.

This improves API cleanliness and keeps IndexInternalID construction and access logic in one place.

@CascadingRadium CascadingRadium changed the title Add helper methods to work with IndexInternalIID Add helper methods to work with IndexInternalID Dec 9, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds helper methods for working with IndexInternalID by moving constructor logic from the bleve package into bleve_index_api to keep the API self-contained. It also fixes a spelling error in the type comment.

  • Adds NewIndexInternalID to encode uint64 values into 8-byte big-endian IDs with buffer reuse
  • Adds NewIndexInternalIDFrom to copy IDs with buffer reuse
  • Adds Value method to decode the uint64 from an ID

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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 this pull request may close these issues.

2 participants