protected function applyDefaultFilters($query)
    {
        // If not filtering by a Term then skip this altogether
        if (empty($this->params['Term'])) {
            return parent::applyDefaultFilters($query);
        }

        // Get an array of SiteTree record IDs that match the search term in nested element data
        /** @var ArrayList $siteTrees */
        $siteTrees = $query->filterByCallback(function (SiteTree $siteTree) {
            // Filter by elemental PHP
            if (!$siteTree->hasExtension(ElementalPageExtension::class)) {
                return false;
            }

            // Check whether the search term exists in the nested page content
            $pageContent = $siteTree->getElementsForSearch();
            return (bool) stripos($pageContent, $this->params['Term']) !== false;
        });

        if ($siteTrees->count()) {
            // Apply the list of IDs as an extra filter
            $this->extraTermFilters['ID:ExactMatch'] = $siteTrees->column('ID');
        }

        return $this->applyWithExtraTermFilters($query);
    }