【发布时间】:2014-01-07 23:04:44
【问题描述】:
背景
我正在尝试将 2 个单独工作的功能组合起来,但无法将它们一起工作。
*1) 正如solr wiki 中所述,我可以标记一个特定的 fq,然后在我的 facet.field 中排除它。即使选择一个值,这也会使我的构面计数保持不变,如下所示:
fq={!tag=pt}price:100&facet=true&facet.field={!ex=pt}price
*2) 我想使用 facet.query 如下:
facet=true&facet.query=price:[0 TO 100]&facet.query=price:[100 TO *]
所以我想结合*1和*2,这是我尝试的:
fq={!tag=pt}price:[0 to 100]&facet=true&facet.query={!ex=pt}price:[0 TO 100]&facet.query={!ex=pt}price:[100 TO *]
实际发生的情况是我收到了 Solr 的回复:
<lst name="facet_queries">
<int name="{!ex=pt}price:[0 TO 100]">8</int>
<int name="{!ex=pt}price:[100 TO *]">19</int>
</lst>
我的问题是:
为什么名称中有 {!ex=pt} 部分?这搞乱了我的一些逻辑。 也许我误用了它,如果是这样,那么正确的方法是什么?
更多信息
我的期望是这样的:(与运行 *2 而没有 *1 的情况相同)
<lst name="facet_queries">
<int name="price:[0 TO 100]">8</int>
<int name="price:[100 TO *]">19</int>
</lst>
这是有道理的,因为如果我正在运行 *1,这就是我在 facet_fields 中收到的内容:
<lst name="facet_fields">
<lst name="price">
<int name="80">8</int>
<int name="150">19</int>
</lst>
</lst>
它没有说 name="{!ex=pt}price"
【问题讨论】: