solr - Solr 中任何字段的空值或 null 值的 Facet

标签 solr lucene facet solrnet solr-search

我在 solr 实现中使用 Facet。显示具有具体值的字段的所有关键字的分面。

空值不会显示构面。我也想展示空值的一个方面。

例如,在下面的示例中,“国家/地区”字段中的值的数据方面显示为

Sample Data for Solr fields

美国 (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 Parameter

If 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/

相关文章:

c# - 通过传递图像 url 谓词值使用 lucene 搜索获取 Sitecore 项目

Solrfacet.query进行查询,不带filter.query

php - 在单个结果页面中实现 "Prev"和 "Next"功能但保持先前搜索结果的顺序的最佳方法是什么?

security - Solr 架构更改不会丢失数据且无需使用动态字段

solr - 如何减少生成的 Lucene/Solr 索引的大小?

Solr 多重过滤器标记/排除

r - ggplot2:更复杂的分面

solr - 从查询中作为多值返回的单值字段

java - Solr 中的架构解析失败

php - Zend Search Lucene 数值范围搜索