我需要在 n 个文档中分面,这些文档被选中,例如
... ORDER BY something DESC LIMIT 100
Solr 有可能吗?如何?
这是一个彻底的黑客,但这里......
http://localhost:8080/solr/select/?q=id%3A123+OR+id%3A456...(继续OR-ing 他们)...&facet=true&facet.field=something
使用 OR 将所有 id 连接到一个新查询。然后,当您在您的字段上进行构面时,构面摘要将仅适用于结果。
AFAIK no, that's not supported / implemented. Facets aren't really meant to be "stats" but a guidance to the end-user. Picture yourself browsing a faceted interface and seeing facets change whenever you change sort order or paging. Faceted browsing would be useless if it worked like that.
I think this would be a nice feature for the StatsComponent though.
我认为这可以通过结果分组(现在在主干!):
http://wiki.apache.org/solr/FieldCollapsing
...唯一的问题是您只能设置一个'facet.field'(即group.field)
但最棒的是你得到了得分方面!