-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Expose flat vectors in "user space" #13468
Comments
I'm not a fan of reusing E.g. maybe we could have |
What I want to do is index float vectors, have them quantized and scored using the quantized form. I just only want the quantization part of indexing, not the graph-building part. |
#13469 is just plumbing things through showing a possible way forward |
Thanks, I had missed the quantization requirement and that you were ok with configuring a codec on the |
I was thinking this could be used by PerFieldKnnVectorFormat since with this change a FlatVectorFormat is a KnnVectorFormat |
+1 on this. Currently the way I was thinking to achieve this was by creating my own KNNVectorsformat on top of FlatVectorsFormat and plumbing that vectors format for a field via Codec. Having this support in Lucene will go long way. Personally I think there should also be search api on the flat vectors format, which does nothing but just do a brute force/exact search on top of all the vectors. |
See #13469. This still leaves search() as throwing |
Maybe this is done? |
Yes, thanks - I'll resolve |
Description
There are use cases where we want to store medium-dimensional vectors (ie embedding space vectors from ML models), retrieve them, compute distances among them, and perform KNN search, but we don't want to HNSW or any other special index-time support. If we search, we'll do it using an index scan. For example this could happen if we partition the index by some key and then rank the resulting documents by their vector distance. Currently if you make a
KnnFloatVectorField
or aKnnByteVectorField
you get an HNSW graph even if you don't want it. We have all the tools to support this use case, but the API doesn't allow it.My question is how should the API look? I started to familiarize myself with the flat vectors support we now have and I see it was done so we now KnnVectorsFormat and FlatVectorsFormat as separate formats that do not share anny common ancestor. I wonder what you all would think about folding FlatVectorsFormat in to KnnVectorsFormat? The only difference today is the search() method, which I would like to support over flat vectors. Otherwise I guess we could add search to FlatVectorsFormat?? But in that case how would we select this format for a field? I'd rather avoid plumbing a whole new format through IndexWriter when it is effectively a flavor of a format we already have. But I may be missing the rationale behind this format forking ... was there some discussion about it you could point me to - I might have been sleeping, sorry!
The text was updated successfully, but these errors were encountered: