public function alterQuery($query, $index)
    {
        if ($this->isFieldFiltered('_subsite', $query) || !$this->appliesToEnvironment()) {
            return;
        }

        $subsite = $this->currentState();
        $query->addFilter('_subsite', [$subsite, SearchQuery::$missing]);
    }
public function alterQuery($query, $index)
    {
        if ($this->isFieldFiltered('_subsite', $query) || !$this->appliesToEnvironment()) {
            return;
        }

        $subsite = $this->currentState();
        $query->addFilter('_subsite', [$subsite, SearchQuery::$missing]);
    }
public function alterQuery ( $ query , $ index ) { if ( $ this -> isFieldFiltered ( '_subsite' , $ query ) || ! $ this -> appliesToEnvironment ( ) ) { return ; } $ subsite = $ this -> currentState ( ) ; $ query -> addFilter ( '_subsite' , [ $ subsite , SearchQuery :: $ missing ] ) ; }
This field has been altered to allow a user to obtain search results for a particular subsite
When attempting to do this in project code, SearchVariantSubsites kicks and overwrites any filter you've applied
This fix prevents the module from doing this if a filter is applied on the index or the query, or if a field is
being excluded specifically before being executed.

A pull request has been raised for this issue. Once accepted this forked module can be deleted and the parent
project should be used instead.

@param SearchQuery $query
@param SearchIndex $index
This field has been altered to allow a user to obtain search results for a particular subsite When attempting to do this in project code SearchVariantSubsites kicks and overwrites any filter you ve applied This fix prevents the module from doing this if a filter is applied on the index or the query or if a field is being excluded specifically before being executed .