src/Graviton/RestBundle/Service/QueryService.php
private function hasSearchIndex()
    {
        $metadata = $this->repository->getClassMetadata();
        $indexes = $metadata->getIndexes();
        if (empty($indexes)) {
            return false;
        }

        $text = array_filter(
            $indexes,
            function ($index) {
                if (isset($index['keys'])) {
                    $hasText = false;
                    foreach ($index['keys'] as $name => $direction) {
                        if ($direction == 'text') {
                            $hasText = true;
                        }
                    }
                    return $hasText;
                }
            }
        );

        return !empty($text);
    }
private function hasSearchIndex()
    {
        $metadata = $this->repository->getClassMetadata();
        $indexes = $metadata->getIndexes();
        if (empty($indexes)) {
            return false;
        }

        $text = array_filter(
            $indexes,
            function ($index) {
                if (isset($index['keys'])) {
                    $hasText = false;
                    foreach ($index['keys'] as $name => $direction) {
                        if ($direction == 'text') {
                            $hasText = true;
                        }
                    }
                    return $hasText;
                }
            }
        );

        return !empty($text);
    }
private function hasSearchIndex ( ) { $ metadata = $ this -> repository -> getClassMetadata ( ) ; $ indexes = $ metadata -> getIndexes ( ) ; if ( empty ( $ indexes ) ) { return false ; } $ text = array_filter ( $ indexes , function ( $ index ) { if ( isset ( $ index [ 'keys' ] ) ) { $ hasText = false ; foreach ( $ index [ 'keys' ] as $ name => $ direction ) { if ( $ direction == 'text' ) { $ hasText = true ; } } return $ hasText ; } } ) ; return ! empty ( $ text ) ; }
Check if collection has search indexes in DB

@return bool
Check if collection has search indexes in DB