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

Type-erase the read_options parameter of SecondaryIndex::NewIterator #13334

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ltamasi
Copy link
Contributor

@ltamasi ltamasi commented Jan 27, 2025

Summary: The patch type-erases the read_options parameter of SecondaryIndex::NewIterator using std::any and renames the earlier SecondaryIndexReadOptions (which only contained options related to similarity search) to FaissIVFIndexReadOptions. This enables custom SecondaryIndex implementations to have their own read option structures and avoids the need to pass options which are irrelevant to them. At the same time, type erasure preserves the ability to call NewIterator polymorphically, which in turn enables us to hide the FaissIVFIndex class from the public API.

Differential Revision: D68694317

Summary: The patch type-erases the `read_options` parameter of `SecondaryIndex::NewIterator` using `std::any` and renames the earlier `SecondaryIndexReadOptions` (which only contained options related to similarity search) to `FaissIVFIndexReadOptions`. This enables custom `SecondaryIndex` implementations to have their own read option structures and avoids the need to pass options which are irrelevant to them. At the same time, type erasure preserves the ability to call `NewIterator` polymorphically, which in turn enables us to hide the `FaissIVFIndex` class from the public API.

Differential Revision: D68694317
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D68694317

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants