开发者

Retrieving per keyword/field match position in Lucene Solr -- possible?

Is there any way to retrieve the match field/position for each keyword for each matching document from solr?

开发者_Python百科

For example, if the document has title "Retrieving per keyword/field match position in Lucene Solr -- possible?" and the query is "solr keyword", I'd like to get, in addition to the doc-id (I normally only want the doc-id, not the full document), something that can tell me the matches are at:

solr:
  title: 9
keyword:
  title: 3

I'm pretty sure such info is computing during query execution (for phrase queries), but is it possible to return these to the application?

Thanks!


Debugging Relevance Issues in Search suggest using Solr analysis, which you can get to from the admin URL, using something like http://localhost:8983/solr/admin/analysis.jsp?highlight=on . This highlights matching terms and gives their position.


AFAIK there is no way to do that directly, but you can use hit highlighting to implement it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜