well, it is "approximate" KNN and can get caught in local minima (maxima?). Increasing K has, indirectly, the effect of expanding the search space because the minimum score in the priority score (score of the Kth item) is used as a threshold for deciding when to terminate the search
On Wed, Aug 2, 2023 at 5:19 PM Michael Wechner <michael.wech...@wyona.com> wrote: > > Hi > > I use Lucene 9.7.0 but experienced the same behaviour with Lucene 9.6.0 > when doing vector search as follows: > > I have indexed about 200 vectors (dimension 768) > > I build the query as follows > > Query query = new KnnFloatVectorQuery("vector-field-name", > queryVector, k); > > and do the search as follows: > > TopDocs topDocs = searcher.search(query, k); > > When I set k=27 then the top doc has a score of 0.7757 > > When I set the "k" value a little lower, e.g. k=24 then the top doc has > a score of 0.7319 and is not the same document as the one with the score > of 0.7757 > > And idea what I might be doing wrong or what I misunderstand? > > Why does the value of k has an effect on the returned top doc? > > Thanks > > Michael > > > > --------------------------------------------------------------------- > 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