Skip to content

Pull out common subclasses for our custom flat & hnsw vector formats #132663

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

thecoop
Copy link
Member

@thecoop thecoop commented Aug 11, 2025

Pull some common code into common subclasses. Whilst these are copied from Lucene, they share some duplicated functionality. We are likely to continue to have custom flat & HNSW formats for a good time yet, so we should aim to centralise our ES-specific settings and defaults into a single class.

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-search-relevance (Team:Search Relevance)

@elasticsearchmachine elasticsearchmachine added Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch v9.2.0 labels Aug 11, 2025
}
}

protected abstract KnnVectorsFormat flatVectorsFormat();
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we just pass KnnVectorsFormat flatVectorFormat as a ctor parameter? The inheritor could still just use a statically constructed object, but pass the reference for toString.

Copy link
Member Author

Choose a reason for hiding this comment

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

I did consider that, but there's already a lot of constructors and parameters, and I didn't want to add another. Either way would work though.

Copy link
Member

Choose a reason for hiding this comment

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

I did consider that, but there's already a lot of constructors and parameters, and I didn't want to add another. Either way would work though.

I am fine with this or a ctor parameter, as long as it doesn't force package private things to become visible outside of their packages.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's just exposing public classes in lucene, so it doesn't

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>refactoring :Search Relevance/Vectors Vector search Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch v9.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants