src/Kunstmaan/NodeSearchBundle/Search/NodeSearcher.php
protected function applySecurityFilter($elasticaQueryBool)
    {
        $roles = $this->getCurrentUserRoles();

        $elasticaQueryRoles = new Query\Terms();
        $elasticaQueryRoles
            ->setTerms('view_roles', $roles);
        $elasticaQueryBool->addMust($elasticaQueryRoles);
    }
protected function applySecurityFilter($elasticaQueryBool)
    {
        $roles = $this->getCurrentUserRoles();

        $elasticaQueryRoles = new Query\Terms();
        $elasticaQueryRoles
            ->setTerms('view_roles', $roles);
        $elasticaQueryBool->addMust($elasticaQueryRoles);
    }
protected function applySecurityFilter ( $ elasticaQueryBool ) { $ roles = $ this -> getCurrentUserRoles ( ) ; $ elasticaQueryRoles = new Query \ Terms ( ) ; $ elasticaQueryRoles -> setTerms ( 'view_roles' , $ roles ) ; $ elasticaQueryBool -> addMust ( $ elasticaQueryRoles ) ; }
Filter search results so only documents that are viewable by the current
user will be returned...

@param \Elastica\Query\BoolQuery $elasticaQueryBool
Filter search results so only documents that are viewable by the current user will be returned ...