我在 solr 实现中使用 Facet。显示具有具体值的字段的所有关键字的分面。
空值不会显示构面。我也想展示空值的一个方面。
例如,在下面的示例中,“国家/地区”字段中的值的数据方面显示为
美国 (6) 加州 (5) IND (5)
我也想将方面显示为 [空](7)
请建议一些解决方法来获取空值的 Facet。
最佳答案
您可以use facet.missing
to get a count for the number of documents that doesn't have a value in the field .
The
facet.missing
ParameterIf set to true, this parameter indicates that, in addition to the Term-based constraints of a facet field, a count of all results that match the query but which have no facet value for the field should be computed and returned in the response.
The default value is
false
.This parameter can be specified on a per-field basis with the syntax of
f.<fieldname>.facet.missing
.
关于solr - Solr 中任何字段的空值或 null 值的 Facet,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61890070/