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

make example use index view #392

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

sam-herman
Copy link
Contributor

Description

I noticed in the SiftSmall examples that when we demo persisting and loading back from disk we are still using the original flat vectors accessor which seem a bit counter intuitive since we are expecting OnDiskGraphIndex to already have the node vector values included.
https://github.com/jbellis/jvector/blob/main/jvector-examples/src/main/java/io/github/jbellis/jvector/example/SiftSmall.java#L163

Proposed Solution

So in the example line above, should we switch this line: (using raav )

            Function<VectorFloat<?>, SearchScoreProvider> sspFactory = q -> SearchScoreProvider.exact(q, VectorSimilarityFunction.EUCLIDEAN, ravv);

To this (using the index view index.getView()):

            Function<VectorFloat<?>, SearchScoreProvider> sspFactory = q -> SearchScoreProvider.exact(q, VectorSimilarityFunction.EUCLIDEAN, index.getView());

Signed-off-by: Samuel Herman <[email protected]>
@sam-herman sam-herman force-pushed the make-example-use-index-view branch from f67d2a8 to 2d2d181 Compare January 28, 2025 00:09
@jbellis jbellis merged commit e2eaa23 into jbellis:main Jan 28, 2025
1 of 6 checks passed
@jbellis
Copy link
Owner

jbellis commented Jan 28, 2025

lgtm, thanks!

@sam-herman sam-herman deleted the make-example-use-index-view branch January 28, 2025 02:12
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