I am interested in querying Solr with query q and charting its recall of a set of documents D when {10, 20, 30, ...} documents are returned.
Currently, I am having the full results, i.e. a list of docids returned (through solrpy), and iterate through it to find the ranks of D, i.e. a mapping from D to their indices in the search results. I do not strictly require the mapping, only mapped ranks.
Is there a way to have Solr/Lucene return ranks for a set of IDs instead of the full results?
Other ways of approaching this problem:
You can retrieve rank by score
field.
Append &fl=KeyFieldName,score
to retrieve document id and score to your query. If you need all fields append &fl=*,score
to your query.
See http://wiki.apache.org/solr/SolrRelevancyFAQ#How_can_I_see_the_relevancy_scores_for_search_results for details.
No I cannot think of a SOLR or Lucene way to do this. I think the simplest solution here is to program this yourself with a simple HashSet...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With