Have you seen FloatVectorSimilarityQuery (and other *SimilarityQuery types)? They are designed to retrieve by threshold
On Fri, Oct 23, 2026 at 12:49 PM Kai Grossjohann via java-user <[email protected]> wrote: > > Hi, > > I need to return results based on a score threshold, instead of based on > a number of results. I want to use a paging approach: request the first > 30 results, then the next 30, and so on, until I reach the score > threshold, or the end of the results. > > But for vector based queries, this doesn't seem easy to do, as > KnnFloatVectorQuery wants the number of results right in the query. > > So I request the first 30 results, then the first 60 results, and so on, > and obviously that takes a long time if the score threshold is low. > > Can I “cheat” by computing the first query with number of results = 30, > then computing a second query with number of results = 60, and passing > the ScoreDoc from the first query to searchAfter on the second query? > > Kai > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
