Solr/Lucene是否有办法返回所选文档的排名而不是完整结果? [英] Is there a way for Solr/Lucene to return the ranks of selected documents instead of full results?

查看:146
本文介绍了Solr/Lucene是否有办法返回所选文档的排名而不是完整结果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有兴趣通过查询 q 查询Solr并绘制出{10,20,30,...}文档为{em> D 的一组文档的调用图.返回.

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.

目前,我得到了完整的结果,即(通过solrpy)返回的docid列表,并对其进行迭代以找到 D 的等级,即从 D 到搜索结果中的索引.我不严格要求映射,只要求映射等级.

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.

是否有办法让一组ID的Solr/Lucene返回排名而不是完整结果?

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:

  • 对于查询,返回文档 d
  • 的等级
  • 对于不超过指定等级的查询,返回是否存在文档 d
  • 从查询 q1 的结果直到指定的记录数,返回与另一个查询 q2
  • 匹配的记录数
  • For a query, return the rank of document d
  • For a query up to a specified rank, return whether or not document d is present
  • From a query q1 result up to a specified number of records, return the number of records matched by another query q2

推荐答案

否,我想不出采用SOLR或Lucene的方式. 我认为这里最简单的解决方案是使用一个简单的HashSet对此进行编程...

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

这篇关于Solr/Lucene是否有办法返回所选文档的排名而不是完整结果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆