Facets Integration
When to Use
When adding faceted search navigation to your Search API-powered search page.
Decision: Facets Module Compatibility
Facets 3.x only works with Search API. It does not work with core Views database queries.
Decision: Architecture Approach
| Approach | Module | AJAX | Recommended |
|---|---|---|---|
| Exposed Filters | facets_exposed_filters + BEF |
Yes (native Views) | Yes — for new projects |
| Blocks | facets (core) |
No | Legacy approach |
Pattern: Setup with Exposed Filters (Recommended)
drush en facets facets_exposed_filters better_exposed_filters
- Create View using Search API index
- Save the View (required before adding facets)
- Add Filter Criteria → select from "Facets" category
- Configure facet processors in filter settings
- Change exposed form style to "Better Exposed Filters"
- Configure BEF widgets (checkboxes, links, etc.)
Pattern: Key Integration Points
- Index the field as String type (not Fulltext) for faceting
- Enable
translate_entityprocessor on the facet for entity reference fields - Use
hide_non_narrowing_result_processorfor clean UX - Exposed filter facets produce no crawlable URLs (SEO safe — see the Drupal Facets guide)
Common Mistakes
- Using Fulltext type for facet fields — Fulltext tokenizes values. "Web Development" becomes two facet items: "web" and "development". Use String type.
- Facets on non-indexed fields — The field must be in the Search API index.
- Not saving the View first — Facet source doesn't exist until the View is saved.
See Also
- The dedicated Drupal Facets Guide covers facets comprehensively:
- Facets overview and architecture
- All processors, widgets, and hierarchy
- SEO & bot protection (critical!)
- BEF integration details
- Drupal Facets guide