lucenenet-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anton <anton.te...@gmail.com>
Subject find out rank of document within a lucene query (with custom sorting)
Date Tue, 22 Dec 2015 15:46:20 GMT
Hi,

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):
http://stackoverflow.com/questions/7924146/is-there-a-way-for-solr-lucene-to-return-the-ranks-of-selected-documents-instead

Have a nice day,
Anton.

PS.: This is my first post to this mailing list. Forgive me, if I have
violated any rules.

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