在Solr facet.prefix响应中合并多个构面字段计数

时间:2018-10-05 08:43:21

标签: solr facet

我正在尝试确定Solr是否能够组合不同字段的构面计数。我正在发出如下请求:

http://host:port/solr/collection/select?facet.field=title&facet.field=intro_text&facet.prefix=par&rows=0&q=*:*&facet=on

在两个字段中,两个词的计数都显示在响应中:

"facet_counts": {
    "facet_queries": {},
    "facet_fields": {
        "title": [
            "parcel",
            5,
            "part",
            1
        ],
        "intro_text": [
            "partners",
            3,
            "partnerships",
            2,
            "parcel",
            1,
            "paris",
            1,
            "part",
            1,
            "particularly",
            1,
            "partly",
            1,
            "partn",
            1
        ]
    },
    "facet_ranges": {},
    "facet_intervals": {},
    "facet_heatmaps": {}
}

是否可以将这些结果合并到一个字段中?

例如

"facet_counts": {
    "facet_queries": {},
    "facet_fields": {
        "combined_counts": [
            "partners",
            3,
            "partnerships",
            2,
            "parcel",
            6,
            "paris",
            1,
            "part",
            2,
            "particularly",
            1,
            "partly",
            1,
            "partn",
            1
        ]
    },
    "facet_ranges": {},
    "facet_intervals": {},
    "facet_heatmaps": {}
}

在此示例中,“包裹”和“零件”计数是每个字段的两个结果之和。

我尝试创建具有相同名称的局部参数,但是一个总是覆盖另一个参数-它们从未相加。

0 个答案:

没有答案