private function getTermVectors(RequestInterface $request)
    {
        $termVectorsQuery = [
            'index'           => $request->getIndex(),
            'type'            => $request->getType(),
            'term_statistics' => true,
            'fields'          => [
                MappingInterface::DEFAULT_SPELLING_FIELD,
                MappingInterface::DEFAULT_SPELLING_FIELD . "." . FieldInterface::ANALYZER_WHITESPACE,
            ],
        ];

        $termVectorsQuery['body']['doc'] = [MappingInterface::DEFAULT_SPELLING_FIELD => $request->getQueryText()];

        return $this->client->termvectors($termVectorsQuery);
    }
private function getTermVectors(RequestInterface $request)
    {
        $termVectorsQuery = [
            'index'           => $request->getIndex(),
            'type'            => $request->getType(),
            'term_statistics' => true,
            'fields'          => [
                MappingInterface::DEFAULT_SPELLING_FIELD,
                MappingInterface::DEFAULT_SPELLING_FIELD . "." . FieldInterface::ANALYZER_WHITESPACE,
            ],
        ];

        $termVectorsQuery['body']['doc'] = [MappingInterface::DEFAULT_SPELLING_FIELD => $request->getQueryText()];

        return $this->client->termvectors($termVectorsQuery);
    }
private function getTermVectors ( RequestInterface $ request ) { $ termVectorsQuery = [ 'index' => $ request -> getIndex ( ) , 'type' => $ request -> getType ( ) , 'term_statistics' => true , 'fields' => [ MappingInterface :: DEFAULT_SPELLING_FIELD , MappingInterface :: DEFAULT_SPELLING_FIELD . "." . FieldInterface :: ANALYZER_WHITESPACE , ] , ] ; $ termVectorsQuery [ 'body' ] [ 'doc' ] = [ MappingInterface :: DEFAULT_SPELLING_FIELD => $ request -> getQueryText ( ) ] ; return $ this -> client -> termvectors ( $ termVectorsQuery ) ; }
Run a term vectors query against the index and return the result.

@param RequestInterface $request The spellcheck request.

@return array
Run a term vectors query against the index and return the result .