How to retrieve vectors from the IndexReader

2025-02-10 Thread Viliam ġurina
Dear all, when indexing vector fields, Lucene doesn't allow specifying the vector field as stored (it throws `IllegalStateException: Cannot store value of type class [F`). When trying to retrieve the value using `IndexReader.storedFields()`, the vector field isn't stored. However, Lucene 10 store

Re: How to retrieve vectors from the IndexReader

2025-02-10 Thread Adrien Grand
Hi Viliam, Your logic is mostly correct, here is a version that should be a bit simpler and correct (but beware, untested): IndexReader reader; // your multi-reader int docID; // top-level doc ID int readerID = ReaderUtil.subIndex(docID, reader.leaves()); LeafReaderContext leafContext = reader.le