在我对代码进行测试和调试之后,我可以清楚地看到,这是代码中的一个错误。
org.apache.solr.request.SimpleFacets#getListedTermCounts
for (String term : terms) {
int count = searcher.numDocs(ft.getFieldQuery(null, sf, term), parsed.docs);
res.add(term, count);
}
</code>
这显然是错误的,因为它只是遍历列表并按照您在查询参数中指定的顺序提供计数。
我创建了一个Solr问题 -
https://issues.apache.org/jira/browse/SOLR-13156
- 并提供补丁。它是
<a href="https://github.com/apache/lucene-solr/commit/43f2723213ed403a9f58d813d391ef26c961d909" rel="nofollow noreferrer">
提交
</A>
并很快将在Solr上市