roblib/solr_facet_field_formatter
Composer 安装命令:
composer require roblib/solr_facet_field_formatter
包简介
Format text and string fields to link to solr facet searches
关键字:
README 文档
README
Formats a field as links into a Search API search page, pre-filtered by a Facets facet whose value is set to the field value.
For example, a "Genus" field rendered with this formatter becomes a link to your search page with the Genus facet already filtered to that value.
Supported field types
The formatter is available for every field type. The value used in the facet query is resolved per field type:
- Reference fields (
entity_reference,typed_relation, …): the referenced entity's label is used, so the facet is filtered by the readable value (e.g. the taxonomy term name) rather than the internal entity id. - All other fields (text, string, list, numeric, boolean, datetime, …): the field's main property value is used.
This matches how such fields are normally indexed and faceted in Solr — make sure the facet you select indexes the same readable value.
You can override this per field with the Facet value setting:
- Automatic (default): referenced entity label for reference fields, the field value otherwise.
- Referenced entity label: always use the referenced entity's label.
- Raw stored value: use the stored value — the entity id for reference fields. Choose this when your facet indexes entity ids rather than labels.
Dependencies
search_api_solrfacets
Configuration
The formatter is configured per field, under Manage display for the entity
(e.g. /admin/structure/types/manage/<bundle>/display). Choose the
Solr Facet Field Formatter format for a text/string field and set:
- Search page (facet source): the search results page the link points to. This determines both the URL path and the facet filter key, read from the selected facet source.
- Facet: the facet to filter on. Pick the facet configured for this field on the chosen search page. Its URL alias is used as the facet key in the generated query.
- Facet value: which value of the field to filter by. See Supported field types above.
- Reset fulltext search (optional): adds an empty fulltext query parameter
so following the link starts a fresh, facet-only search. The parameter name
(default
search_api_fulltext) is configurable to match your view's exposed fulltext filter.
The generated link matches the query string that Facets itself produces, e.g.
/<search-path>?f[0]=<facet-alias>:<field-value>.
Upgrading
Earlier versions hardcoded a specific view (herbarium_search). After
upgrading, each field using this formatter must be reconfigured on its
Manage display page to select a facet source and facet. Until configured,
the field renders as plain text.
roblib/solr_facet_field_formatter 适用场景与选型建议
roblib/solr_facet_field_formatter 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 07 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「drupal」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 roblib/solr_facet_field_formatter 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 roblib/solr_facet_field_formatter 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 roblib/solr_facet_field_formatter 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Provides an add-on purchasable entity.
Drupal integration module for the Kalastatic prototyping and styleguide tool
Provides a base set of configuration and module dependencies for starting new Drupal projects.
This module extends Drupal Migrate framework.
Installs and configures the WissKI base environment with mandatory modules.
Tiny set of PHP text utility classes.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0
- 更新时间: 2026-07-15