Hi, > Using LeafReader’s API to read vector. Here the Random accessing of documents is very slow.
Is it possible that you are creating a new VectorValues instance for every doc whose value you want to look up? Ideally, you should sort your docids and then advance to them one by one, or call nextDoc. Then retrieve the value stored at the position pointed to by the iterator. This would look something like this method: https://github.com/apache/lucene/blob/branch_9_7/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextKnnVectorsReader.java#L226 TLDR: I don't think it should be *that* slow.. maybe share the code you are using to retrieve the vectors? Regards, Gautam Worah. On Sun, Feb 11, 2024 at 4:40 AM Uthra <uthrakuma...@gmail.com> wrote: > Hi Michael, > The use case is to handle index updates along with its vector > field without resending the vector in change data every time. The change > data will consist of only “updated_field(s):value(s)” wherein I will read > the vector value from Index to update the document. > > Thanks, > Uthra > > > On 09-Feb-2024, at 7:13 PM, Michael Wechner <michael.wech...@wyona.com> > wrote: > > > > Can you describe your use case in more detail (beyond having to read the > vectors)? > > > > Thanks > > > > Michael > > > > Am 09.02.24 um 12:28 schrieb Uthra: > >> Hi, > >> Our project uses Lucene 9_7_0 and we have a requirement of > frequent vector read operation from the Index for a set of documents. We > tried two approaches > >> 1. Index vector as Stored field and retrieve whenever needed using > StoredFields APIs. > >> 2. Using LeafReader’s API to read vector. Here the Random accessing of > documents is very slow. > >> Which one is the right approach and can you suggest me a better > approach.Also why isn’t there a straightforward API like the StoredFields > API to read vector. > >> > >> Regards, > >> Uthra > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > > For additional commands, e-mail: java-user-h...@lucene.apache.org > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org > >