【问题标题】:Solr: Facet Count incorrect when using Collapse and Expand ResultsSolr:使用折叠和展开结果时分面计数不正确
【发布时间】:2022-06-22 00:57:36
【问题描述】:

使用折叠和展开结果时,返回的构面计数不正确。 如下面的屏幕截图所示,它应该是 1212 (numFound),但它返回 102(一些分组值)。

https://localhost/solr/index/select?q=*:*
&fq={!collapse+field%3Dcode_string}
&fq={!tag%3Dfk1}week_int:17
&expand=true
&expand.rows=100
&facet.field={!ex%3Dfk1}week_int
&facet=true
&facet.sort=count
&facet.mincount=1
&facet.limit=5000

我尝试了以下选项:

  1. 分组工作正常 - 解决方案group.field=code_string&group.main=true,但我有兴趣让折叠和展开功能与性能方面类似,这是更优选的方式。

  2. 尝试了fq={!collapse+field%3Dcode_string}facet.field={!ex=collapse}week_int - 不返回其他构面值,它只返回在fq 中添加的构面值week_int:17

  3. collapse.facet=facet.before|facet.after

  4. 我已尝试如下 JSON 构面,但它不返回不属于 fq 的其他构面值

`

https://localhost/solr/index/select?q=*:*
&fq={!collapse+field%3Dcode_string}
&fq={!tag%3Dfk2}week_int:17
&expand=true
&json.facet={
  week_int: {
    type: terms,
    field: week_int,
    facet: {
      workCount: "unique(code_string)"
    },
    domain: {
      excludeTags: [code_string]
    }
  }
}

`

如何获得实际的构面计数以及其他通常可以在不应用折叠的情况下工作的构面值?

【问题讨论】:

    标签: json solr collapse facet expand


    【解决方案1】:

    您使用排除的方式似乎不是所需的方式。之前尝试标记它。

    在您的情况下,首先标记折叠查询,然后在分面期间将其排除。 像这样的东西:-

    https://localhost/solr/index/select?q=*:*
    &fq={!tag%3Dcollapsetag}{!collapse+field%3Dcode_string}
    &fq={!tag%3Dfk1}week_int:17
    &expand=true
    &expand.rows=100
    &facet.field={!ex%3Dfk1,collapsetag}week_int
    &facet=true
    &facet.sort=count
    &facet.mincount=1
    &facet.limit=5000
    

    【讨论】:

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