PHP Class Smile\ElasticsuiteCore\Search\Adapter\Elasticsuite\Spellchecker

This implementation rely on the ES term vectors API.
Author: Aurelien FOUCRET ([email protected])
Inheritance: implements Smile\ElasticsuiteCore\Api\Search\SpellcheckerInterface
Afficher le fichier Open project: smile-sa/elasticsuite

Méthodes publiques

Méthode Description
__construct ( Smile\ElasticsuiteCore\Api\Client\ClientFactoryInterface $clientFactory, Cache $cacheHelper ) Constructor.
getSpellingType ( Smile\ElasticsuiteCore\Api\Search\Spellchecker\RequestInterface $request ) {@inheritDoc}

Private Methods

Méthode Description
extractTermStatsByPoisition ( array $termVectors ) : array Extract term stats by position from a term vectors query response.
getAnalyzer ( string $propertyName ) : string Extract analayser from a mapping property name.
getCacheKey ( Smile\ElasticsuiteCore\Api\Search\Spellchecker\RequestInterface $request ) : string Compute an unique caching key for the spellcheck request.
getCutoffrequencyLimit ( Smile\ElasticsuiteCore\Api\Search\Spellchecker\RequestInterface $request ) : integer Count document into the index and then multiply it by the request cutoff frequency to compute an absolute cutoff frequency limit (max numbre of doc).
getTermVectors ( Smile\ElasticsuiteCore\Api\Search\Spellchecker\RequestInterface $request ) : array Run a term vectors query against the index and return the result.
loadSpellingType ( Smile\ElasticsuiteCore\Api\Search\Spellchecker\RequestInterface $request ) : integer Compute the spelling time using the engine.
parseTermVectors ( array $termVectors, integer $cutoffFrequencyLimit ) : array Parse the terms vectors to extract stats on the query.

Method Details

__construct() public méthode

Constructor.
public __construct ( Smile\ElasticsuiteCore\Api\Client\ClientFactoryInterface $clientFactory, Cache $cacheHelper )
$clientFactory Smile\ElasticsuiteCore\Api\Client\ClientFactoryInterface ES Client Factory.
$cacheHelper Smile\ElasticsuiteCore\Helper\Cache ES cache helper.

getSpellingType() public méthode

{@inheritDoc}
public getSpellingType ( Smile\ElasticsuiteCore\Api\Search\Spellchecker\RequestInterface $request )
$request Smile\ElasticsuiteCore\Api\Search\Spellchecker\RequestInterface