Persistent Filters

Hidden filter rules applied to every search

Persistent Filters

Persistent filters are hidden filter rules that apply to every search automatically. They let you control what content appears in search results without visitors knowing.

Where to configure

Go to the Filters tab (/admin/config/search/opensolr/filters).

Include vs. Exclude

+ Include

Only show results matching this filter. Example: include only content_type = text/html to hide PDFs from all searches.

- Exclude

Hide results matching this filter. Example: exclude uri = */admin/* to prevent admin pages from appearing in search.

Adding a filter

  1. Select Include or Exclude
  2. Pick a Field from the dropdown (all facetable Solr fields are listed)
  3. Enter a Value to match
  4. Click "Add Filter"

Value syntax

  • Exact value β€” text/html matches exactly that content type
  • Wildcards β€” */blog/* matches any URL containing /blog/. Only works on string fields.
  • Quoted phrases β€” "annual report" matches the exact phrase in text fields

Use cases

  • Exclude admin pages β€” exclude uri = */admin/*
  • Only web pages β€” include content_type = text/html
  • Hide test content β€” exclude uri = */test/*
  • Single language β€” include meta_detected_language = en
  • Exclude PDFs β€” exclude content_type = application/pdf
⚠️ Be careful with Include filters

An Include filter restricts ALL searches to only results matching that filter. If you include meta_detected_language = en, all non-English content becomes invisible in search. Make sure that's what you want!

💡 Invisible to visitors

Persistent filters are applied server-side. Visitors can't see, remove, or override them. They don't appear in the URL or in the active filters bar on the search page.