protected function modifyQuery(Query $query, SearchRequest $searchRequest, Search $search)
    {
        // hook to modify the search query
        if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['modifySearchQuery'])) {
            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['modifySearchQuery'] as $classReference) {
                $queryModifier = GeneralUtility::makeInstance($classReference);

                if ($queryModifier instanceof Modifier) {
                    if ($queryModifier instanceof SearchAware) {
                        $queryModifier->setSearch($search);
                    }

                    if ($queryModifier instanceof SearchRequestAware) {
                        $queryModifier->setSearchRequest($searchRequest);
                    }

                    $query = $queryModifier->modifyQuery($query);
                } else {
                    throw new \UnexpectedValueException(
                        get_class($queryModifier) . ' must implement interface ' . Modifier::class,
                        1310387414
                    );
                }
            }
        }

        return $query;
    }
protected function modifyQuery(Query $query, SearchRequest $searchRequest, Search $search)
    {
        // hook to modify the search query
        if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['modifySearchQuery'])) {
            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['modifySearchQuery'] as $classReference) {
                $queryModifier = GeneralUtility::makeInstance($classReference);

                if ($queryModifier instanceof Modifier) {
                    if ($queryModifier instanceof SearchAware) {
                        $queryModifier->setSearch($search);
                    }

                    if ($queryModifier instanceof SearchRequestAware) {
                        $queryModifier->setSearchRequest($searchRequest);
                    }

                    $query = $queryModifier->modifyQuery($query);
                } else {
                    throw new \UnexpectedValueException(
                        get_class($queryModifier) . ' must implement interface ' . Modifier::class,
                        1310387414
                    );
                }
            }
        }

        return $query;
    }
protected function modifyQuery ( Query $ query , SearchRequest $ searchRequest , Search $ search ) { // hook to modify the search query if ( is_array ( $ GLOBALS [ 'TYPO3_CONF_VARS' ] [ 'EXTCONF' ] [ 'solr' ] [ 'modifySearchQuery' ] ) ) { foreach ( $ GLOBALS [ 'TYPO3_CONF_VARS' ] [ 'EXTCONF' ] [ 'solr' ] [ 'modifySearchQuery' ] as $ classReference ) { $ queryModifier = GeneralUtility :: makeInstance ( $ classReference ) ; if ( $ queryModifier instanceof Modifier ) { if ( $ queryModifier instanceof SearchAware ) { $ queryModifier -> setSearch ( $ search ) ; } if ( $ queryModifier instanceof SearchRequestAware ) { $ queryModifier -> setSearchRequest ( $ searchRequest ) ; } $ query = $ queryModifier -> modifyQuery ( $ query ) ; } else { throw new \ UnexpectedValueException ( get_class ( $ queryModifier ) . ' must implement interface ' . Modifier :: class , 1310387414 ) ; } } } return $ query ; }
Allows to modify a query before eventually handing it over to Solr.

@param Query $query The current query before it's being handed over to Solr.
@param SearchRequest $searchRequest The searchRequest, relevant in the current context
@param Search $search The search, relevant in the current context
@throws \UnexpectedValueException
@return Query The modified query that is actually going to be given to Solr.
Allows to modify a query before eventually handing it over to Solr .