Faceted Navigation & Field Mapping

Filter results by category, price, date, and more

Facets & Filters

Facets let your visitors narrow down search results by clicking on categories, date ranges, price ranges, and other attributes. The plugin discovers available facets automatically from your Solr index using the Luke schema handler.

Where to configure

Go to Settings → Opensolr Search → Facet Mapping tab in your WordPress admin. This page shows a table of all facetable fields discovered from your Solr index.

Schema discovery

The plugin queries your Solr index via the Luke handler to discover all available fields and their types. This means you do not need to manually define which fields exist — the plugin sees every field in your schema automatically, including dynamic fields created by the web crawler (e.g., product_category_sm, price_f, creation_date).

Widget types

Each facet field can be displayed using one of four widget types:

List

Checkbox-style list of values with document counts. Click a value to filter, click again to remove. Works for all field types — strings, numbers, dates.

Slider

A min/max range slider powered by noUiSlider. Includes text input boxes for typing exact values. Best for numeric fields like price, rating, or score. Numbers display with thousands separators (e.g., 15,637.00).

Date Range

Two date picker inputs (From / To) for filtering by date fields. Click "Apply" to filter, "Clear" to reset. Works with any Solr date field.

Hierarchical

Multi-level drill-down navigation (e.g., Products › Electronics › Phones). Auto-detected from JSON-LD BreadcrumbList or WooCommerce category taxonomy. Click a value to drill into the next level. A back button (‹) and breadcrumb trail appear at the top of the facet for navigation.

Solr IndexLuke DiscoveryFacet ConfigSidebar

Reordering facets

Facets are ordered by weight — lower weight means higher position in the sidebar. You can reorder them by:

  • Drag-and-drop in the Facet Mapping admin table — drag the handle on each row to reorder. Weights update automatically.
  • Enabled facets are always pinned to the top of the table, so active facets stay together and easy to manage.

Enable / Disable

Each facet has an enable/disable toggle. Disabled facets do not appear on the search page but remain in your configuration so you can re-enable them later. Enabled facets are always pinned to the top of the admin table for visibility.

"Show more" expand dialog

When a list facet has many values, a "Show more" link appears at the bottom. Clicking it opens an expanded dialog showing all values in a grid layout with:

  • A letter index for quick alphabetical jumping (A, B, C, ...)
  • A search filter at the top to narrow down values by typing
  • Document counts next to each value

Values in the expand dialog are truncated with ellipsis if they are very long, while the count always stays visible.

Tag exclusion

Facet exclusion

Facets use Solr's tag/exclusion feature ({!ex=field} and {!tag=field}). When you select a facet value, the other values in that same facet group still show their full counts — they are not zeroed out. This lets visitors see all available options even while filtering.

Active filter pills

When a facet filter is active, it appears as a removable pill above the search results. The pill shows the field label and selected value. Click the × to remove that filter. When multiple filters are active, a "Clear all" link appears to reset everything at once.

The pills use smart label cleaning:

  • Solr field suffixes like _sm, _f, _dtm are stripped automatically
  • Range filters strip _min / _max suffixes before label lookup (e.g., "Price min: 19" not "Price f min: 19")
  • Labels use smart title case normalization while preserving acronyms (e.g., "SKU" stays uppercase)

Mobile behavior

On screens narrower than 768px, the facet sidebar collapses. A Filters toggle button appears above results. Tap it to expand the sidebar, tap again to collapse. The sidebar becomes full-width and facet groups stack vertically. All touch targets meet the 44px minimum for comfortable tapping.

Always-visible facets

Slider and date range facets remain visible even when the current filter narrows results down to a single value (when min equals max). This prevents the confusing behavior of facets disappearing after filtering.

Built-in facets (no mapping required)

Some fields are always available without any configuration because the crawler and ingestion system extract them automatically:

  • Content type (content_type) — MIME type (text/html, application/pdf, etc.)
  • Language (meta_detected_language) — auto-detected page language
  • Creation date (creation_date) — when the page was published
  • Price (price_f) — extracted from WooCommerce products or structured data
  • Category hierarchy (item_list_element_N_name_sm) — auto-extracted from BreadcrumbList JSON-LD or WooCommerce taxonomy
Re-crawl after changes

After adding new facet fields or changing your content structure, run a re-crawl so the crawler picks up the new data from your pages. New facets will not appear until pages are re-indexed with the updated fields.