private function validateQuery(SearchQuery $query)
    {
        $indexNames = $this->getIndexNames();
        $queryIndexNames = $query->getIndexes();

        foreach ($queryIndexNames as $queryIndexName) {
            if (!in_array($queryIndexName, $indexNames)) {
                $unknownIndexes[] = $queryIndexName;
            }
        }

        if (false === empty($unknownIndexes)) {
            throw new Exception\SearchException(
                sprintf(
                    'Search indexes "%s" not known. Known indexes: "%s"',
                    implode('", "', $queryIndexNames),
                    implode('", "', $indexNames)
                )
            );
        }
    }
private function validateQuery(SearchQuery $query)
    {
        $indexNames = $this->getIndexNames();
        $queryIndexNames = $query->getIndexes();

        foreach ($queryIndexNames as $queryIndexName) {
            if (!in_array($queryIndexName, $indexNames)) {
                $unknownIndexes[] = $queryIndexName;
            }
        }

        if (false === empty($unknownIndexes)) {
            throw new Exception\SearchException(
                sprintf(
                    'Search indexes "%s" not known. Known indexes: "%s"',
                    implode('", "', $queryIndexNames),
                    implode('", "', $indexNames)
                )
            );
        }
    }
private function validateQuery ( SearchQuery $ query ) { $ indexNames = $ this -> getIndexNames ( ) ; $ queryIndexNames = $ query -> getIndexes ( ) ; foreach ( $ queryIndexNames as $ queryIndexName ) { if ( ! in_array ( $ queryIndexName , $ indexNames ) ) { $ unknownIndexes [ ] = $ queryIndexName ; } } if ( false === empty ( $ unknownIndexes ) ) { throw new Exception \ SearchException ( sprintf ( 'Search indexes "%s" not known. Known indexes: "%s"' , implode ( '", "' , $ queryIndexNames ) , implode ( '", "' , $ indexNames ) ) ) ; } }
If query has indexes, ensure that they are known.

@throws Exception\SearchException

@param SearchQuery $query
If query has indexes ensure that they are known .