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
- Select Include or Exclude
- Pick a Field from the dropdown (all facetable Solr fields are listed)
- Enter a Value to match
- Click "Add Filter"
Value syntax
- Exact value β
text/htmlmatches 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
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!
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.