Volto Facet default value

I created a querystring record as shown in 21. Custom Search – Mastering Plone 6 development — Plone Training 2026 documentation.

I would like this to default to 'Active' selected, is there a way to do this? I don't see any options out of the box, would I need a custom facet widget?

Playing around with this a bit. First, it seems the base search query (block setting for Search block) is not appropriate here. If I set that to status="Active" then the only option is "Active". And if I uncheck it, it still only returns status=active content (bug?)

Instead I'm looking at customization of components. First I customized components/manage/Blocks/Search/schema.js

const FacetSchema = ({ intl }) => ({
  title: intl.formatMessage(messages.facet),
  fieldsets: [
    {
      id: 'default',
      title: 'Default',
      fields: ['title', 'field', 'type', 'hidden', 'default_value', 'advanced'],
    },
  ],
  properties: {
...

    default_value: {
      title: 'Default Value'
    },
...

The general idea is - if no query params are found, I want to set a value for any facet that has a default_value. I am assuming that the appropriate place to do this is when those values are initialized from query data, so I customized intializeFacetWithQueryValue [sic] volto/packages/volto/src/components/manage/Blocks/Search/hocs/withSearch.jsx at 18.32.1 · plone/volto · GitHub with this

for (let value of configuredFacets) {
      const queryString = queryData.find((item) => item.i === value),
        settings = data.facets[configuredFacets.indexOf(value)];
      if (queryString) {
        intializeFacetWithQueryValue = [
          ...intializeFacetWithQueryValue,
          { [queryString.i]: queryString.v },
        ];
      } else if (settings.default_value != null) {
        intializeFacetWithQueryValue = [
          ...intializeFacetWithQueryValue,
          {
            [value]: settings.multiple
              ? [settings.default_value]
              : settings.default_value,
          },
        ];
      }
    }

This seems to work as a proof of concept. It needs data validation etc.