lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anton <>
Subject find out rank of document within a lucene query (with custom sorting)
Date Wed, 06 Jan 2016 09:26:44 GMT

I am interested to find out what rank a document holds within a search
query among all documents within the index.

In more detail: I would like to create a query with a sorting. But I am not
interested in getting, for instance, the top 10 search hits for that query
and sorting. I am only interested what rank a certain document from the
index would be in the result of that query and sorting. It could be the
42nd from 1024 documents in that result. I could identify the document via
an ID field.

Is there a possibility to do get that rank number efficiently?
(A simple, but probably time consuming, solution would be: Get all
documents according to query and sorting. Loop through the result list and
find the specific document. Return the counter of the loop.)

Here is a similar question on stackoverflow (without a satisfying answer):

Have a nice day,

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message