【问题标题】:SolrNet : Keep Facet count when filtering querySolrNet:过滤查询时保持 Facet 计数
【发布时间】:2016-11-23 08:11:22
【问题描述】:

当我查询 时,我收到以下方面:

"Field1": [
  {
    "Key": "Best Facet 1",
    "Value": 999
  },
  {
    "Key": "Best Facet 2",
    "Value": 999
  }
],
"Field2": [
  {
    "Key": "Second Best Facet 1",
    "Value": 421
  },
  {
    "Key": "Second Best Facet 2",
    "Value": 103
  }
]

现在我想在 Field2 = "Second Best Facet 2" 上应用过滤器查询 (fq)

我收到的结果是

"Field1": [
  {
    "Key": "Best Facet 1",
    "Value": 103
  },
  {
    "Key": "Best Facet 2",
    "Value": 103
  }
],
"Field2": [
  {
    "Key": "Second Best Facet 1",
    "Value": 103
  },
  {
    "Key": "Second Best Facet 2",
    "Value": 103
  }
]

我需要分面计数保持一致并且不受所应用过滤器的影响。我找不到任何问题的解决方案。

【问题讨论】:

    标签: solr solrnet


    【解决方案1】:

    计算方面分数时可以tag your filters and tell Solr to ignore those filters

    fq={!tag=dt}doctype:pdf&facet.field={!ex=dt}doctype
    

    fq= 应用过滤器,但使用标签dt 标记过滤器,并通过告诉facet.field 排除任何标记为dt 的过滤器,它仍然会计算整个集合的计数,而不仅仅是过滤值。

    所有类型的构面都支持过滤器排除。 tag 和 ex local 参数都可以通过逗号分隔来指定多个值。

    【讨论】:

      猜你喜欢
      • 2019-06-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多