3

我需要在 n 个文档中分面,这些文档被选中,例如

... ORDER BY something DESC LIMIT 100

Solr 有可能吗?如何?

4

3 回答 3

1

这是一个彻底的黑客,但这里......

  1. 做你的初始查询,并得到你的结果。
  2. 构造一个新查询,如下所示:

http://localhost:8080/solr/select/?q=id%3A123+OR+id%3A456...(继续OR-ing 他们)...&facet=true&facet.field=something

使用 OR 将所有 id 连接到一个新查询。然后,当您在您的字段上进行构面时,构面摘要将仅适用于结果。

于 2010-01-06T00:02:15.117 回答
0

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.

于 2010-01-05T13:34:06.437 回答
0

我认为这可以通过结果分组(现在在主干!):

http://wiki.apache.org/solr/FieldCollapsing

...唯一的问题是您只能设置一个'facet.field'(即group.field)

但最棒的是你得到了得分方面!

于 2010-11-03T10:17:15.617 回答