SolrJ を使用して Solr インデックスを検索し、さらに使用するためにログに記録するための Lucene の説明を取得しようとしています。
コードは次のようになります。
SolrServer server = new CommonsHttpSolrServer("solr_url");
SolrQuery solrquery = new SolrQuery();
solrquery.set("fl", "score, id"); // id is a String field
solrquery.set("rows", "1000");
solrquery.set("debugQuery", "on");
solrquery.setQuery("query words here");
try {
QueryResponse response = server.query(solrquery);
SolrDocumentList docs = response.getResults();
Iterator<SolrDocument> dociterator = docs.iterator();
while (dociterator.hasNext())
{
SolrDocument doc = dociterator.next();
String id = (String) doc.getFirstValue(idfield);
Float relevance = (Float) doc.getFirstValue("score");
String explanation = ???;
}
} catch (SolrServerException e) {
e.printStackTrace();
}
response.getEplainMap() には response.getEplainMap().get(id) のような値を持つマップが含まれると考えましたが、explainmap には最後に見つかったドキュメントの値を持つキー null のみが含まれているようです。
正しい説明を得る方法はありますか?