Persistent Filters

Hidden rules applied to every search

Persistent Filters

Rules your visitors never see, applied to every search on your native search page: show only one kind of document, or keep one out.

Where: Configuration › Search and metadata › Opensolr Search › Filters tab (/admin/config/search/opensolr/filters)

Add a filter

  1. Mode: + Must Match (include only) keeps only what matches; - Must Not Match (exclude) drops what matches.
  2. Field: any field of your index, with its type in brackets.
  3. Value: the value to match.
  4. Click Add Filter. It applies to the next search. Active Filters lists them, each with Remove.

How a value matches

  • The value is matched exactly, as written. On a text field of a single value, such as content_type or uri, the whole field must equal it.
  • Wildcards do not work. A * is taken as a plain character, so */admin/* matches nothing, even though the hint on the tab offers it.
  • On full-text fields, such as title or text, the value is searched as a phrase: the words, in that order.

Examples that work

ModeFieldValueEffect
- Must Not Matchcontent_typeapplication/pdfNo PDFs in the results.
+ Must Matchmeta_detected_languageenEnglish documents only.
- Must Not MatchcategoryBasic pageLeaves out one content type, by its name.
- Must Not Matchurithe full address of one pageHides that page.

To keep whole sections of your site out of search, leave their content types unticked on the Data Crawler and Data Ingestion tabs. To hide one page for every search from the results page itself, use EXCLUDE ALL in Query Elevation.

In Embeddable Search UI mode this tab only shows a note: filters are then set in the configuration of your index in Opensolr.