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.
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.