public function getSearchFieldSchema()
    {
        $schemaUrl = $this->Link('schema/SearchForm');

        $context = $this->getSearchContext();
        $params = $this->getRequest()->requestVar('q') ?: [];
        $context->setSearchParams($params);

        $placeholder = _t('SilverStripe\\CMS\\Search\\SearchForm.FILTERLABELTEXT', 'Search') . ' "' .
            SiteTree::singleton()->i18n_plural_name() . '"';

        $searchParams = $context->getSearchParams();

        $searchParams = array_combine(array_map(function ($key) {
            return 'Search__' . $key;
        }, array_keys($searchParams)), $searchParams);

        $schema = [
            'formSchemaUrl' => $schemaUrl,
            'name' => 'Term',
            'placeholder' => $placeholder,
            'filters' => $searchParams ?: new \stdClass // stdClass maps to empty json object '{}'
        ];

        return json_encode($schema);
    }